views:

556

answers:

1

I've put site directory created by django-admin startproject under version control (Mercurial). Let's say, the site is called frobnicator.

Now I want to make some serious refactoring, so I clone the site using command

hg clone frobnicator frobnicator-refactoring`

but ROOT_URLCONF in settings.py still says frobnicator.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?

+5  A: 

Simply remove project name form ROOT_URLCONF definition - it is optional. Then you can have project folder with different names.

Alex Koshelev
Yes, it works indeed! I should've try this first before posting the question!
Eugene Morozov
Yes, I've never understood why the Django docs seem to recommend hardcoding the name of your project directory in your settings, when it is simply not necessary.
Carl Meyer
Carl: because once you graduate past very simple/introductory projects, it's unlikely that you'll have such a thing as a "project directory", or URLs inside it.
James Bennett
James: How is that a reason for the Django introductory docs to recommend (and demonstrate) hardcoding the name of a project directory into your settings?
Carl Meyer