import os import socket SITE_ID = 1 # 项目的根目录 # 简化后面的操作 PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__)) # 加载应用 # 把应用添加到INSTALLED_APPS中 from apps.kuser.mysetting import myapp as kuser_app from apps.blog.mysetting import myapp as blog_app MY_APPS = blog_app + kuser_app # 加载静态文件 from apps.blog.mysetting import my_staticfiles as blog_staticfiles from apps.kuser.mysetting import my_staticfiles as kuser_staticfiles MY_STATIC_DIRS = blog_staticfiles + kuser_staticfiles # 加载模板文件 from apps.blog.mysetting import my_templates as blog_templates from apps.kuser.mysetting import my_templates as kuser_templates MY_TEMPLATE_DIRS = blog_templates + kuser_templates # 密钥配置 # 适用于开发环境和部署环境 # 可以从系统环境中,配置文件中,和硬编码的配置中得到密钥 try: SECRET_KEY = os.enviro
django settings最佳配置
最新推荐文章于 2023-04-05 17:01:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)