如何为不同分支中的Django ROOT_URLCONF设置设置正确的值 [英] How to set correct value for Django ROOT_URLCONF setting in different branches
问题描述
我将版本控制(Mercurial)下的 django-admin startproject
创建的站点目录。假设这个网站被称为 frobnicator
。
现在我想做一些严重的重构,所以我克隆网站使用命令
hg clone frobnicator frobnicator-refactoring`
$ p $
settings.py
中的ROOT_URLCONF
仍然表示frobnicator.urls
。
有没有更好的方法来克服这个问题,而不是将网站移动到包装器目录中并存储目录下版本控制(在分支后保持相同的站点名称)或使用本地分支?
解决方案只需删除项目名称表单
ROOT_URLCONF
定义 - 它是可选的。然后可以使用不同名称的项目文件夹。I've put site directory created by
django-admin startproject
under version control (Mercurial). Let's say, the site is calledfrobnicator
.Now I want to make some serious refactoring, so I clone the site using command
hg clone frobnicator frobnicator-refactoring`
but
ROOT_URLCONF
insettings.py
still saysfrobnicator.urls
.Is there a better way to overcome this problem rather than moving the site in a wrapper directory and storing this directory under version control (to maintain the same site name after branching) or using local branches?
解决方案Simply remove project name form
ROOT_URLCONF
definition - it is optional. Then you can have project folder with different names.这篇关于如何为不同分支中的Django ROOT_URLCONF设置设置正确的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!