Using django 1.4 and have seen that when you use startproject it now creates a folder within your project with the same name.
-myproject/
manage.py
myproject/
settings.py
urls.py
Previously for my urls I could input
ROOT_URLCONF = 'urls'
But that no longer works. Am I now supposed to prefix this with project name? i.e.
ROOT_URLCONF = 'myproject.urls'
—
In my urls.py I’d import settings but now I have to prefix it with from myproject import settings.
I thought prefixing variables with the project name was against django standards as it breaks reuseability?
Yes, prefix
ROOT_URLCONFwith your project name:You shouldn’t import settings directly anyway (see Using settings in Python code). Instead, use the following, which works for both the old and new project layouts.