开发者

Customised settings files using django-admin.py startproject?

开发者 https://www.devze.com 2023-02-25 17:15 出处:网络
Whenever you run the command django-admin.py startproject, django automatically loads up a default settings file.

Whenever you run the command django-admin.py startproject, django automatically loads up a default settings file.

Is it possible to enhance the way this works so that it loads up your customized settings so you don't have to go in and change most of the defaults?

For开发者_JAVA技巧 example things like time zones etc. Just to make the whole process quicker.


You can modify the project template files in your Django install. In the directory where Django is installed, go to django/conf/project_template/. Here, you can modify the settings.py file used when you create a new project.


You can don't use django-admin.py startproject commant at all. Just create your own project template with your own settings and structure, copy-paste it every time for each new site.

But don't forget about SECRET_KEY, it should be unique for each project.


you can fork and customize the django-startproject https://github.com/lincolnloop/django-startproject

0

精彩评论

暂无评论...
验证码 换一张
取 消