zoukankan      html  css  js  c++  java
  • django

    settings.py : 一个 python语法 写满 变量 的文件。

    1. 启动主程序中,可能是对 一段我不太明白的代码 的解释:

    On the server (mod_wsgi)

    In your live server environment, you’ll need to tell your WSGI application what settings file to use. Do that with os.environ:

    import os
    
    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
    

    Read the Django mod_wsgi documentation for more information and other common elements to a Django WSGI application.

    2. 差分 `自己的settings.py` 和 `Django默认配置的settings.py`

    python manage.py diffsettings

    3. 自己写的app,开始debug模式的方法:

    In your Django apps, use settings by importing the object django.conf.settings. Example:

    from django.conf import settings
    
    if settings.DEBUG:
        # Do something

    Note that django.conf.settings isn’t a module – it’s an object. 

    4. 安全

    settings.py 的 读写权限:自己 和 自己的程序 可读就ok。

  • 相关阅读:
    BZOJ1208
    BZOJ1024
    BZOJ_day4&&DSFZ_day1
    BZOJ day2_plus
    BZOJ day2
    系统设计2:数据库设计
    设计模式8:外观模式
    系统设计1:概述
    设计模式7:模板方法模式
    九章算法班ladder题目梳理
  • 原文地址:https://www.cnblogs.com/kevin922/p/3587963.html
Copyright © 2011-2022 走看看