python3
zero成
这个作者很懒,什么都没留下…
展开
-
django2.0的media配置
MEDIA_URL='/Upload/' //设置上传文件的urlMEDIA_ROOT=os.path.join(BASE_DIR,'Upload') //设置上传文件保存的路径在setting.py中的TEMPLATES中的OPTIONS中的context_processors中添加:django.template.context_processors.media ...原创 2018-10-14 21:42:25 · 1453 阅读 · 0 评论 -
django2.0生产环境的日志配置
import osBASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))BASE_LOG_DIR = os.path.join(BASE_DIR, "log")if not os.path.exists(BASE_LOG_DIR): os.makedirs(BASE_LOG_DIR)LOGGIN...原创 2018-10-25 15:51:51 · 1019 阅读 · 0 评论