Django 1.4 new project folder structure forces project prefixes?

后端 未结 2 1026
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 14:13

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/
               


        
2条回答
  •  生来不讨喜
    2020-12-24 14:54

    Yes, prefix ROOT_URLCONF with your project name:

    ROOT_URLCONF = 'myproject.urls'
    

    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.

    from django.conf import settings
    

提交回复
热议问题