如何解决django配置settings时遇到Could not import settings 'conf.local'

yipeiwu_com6年前Python基础

举个例子吧

Django最佳实践与部署:Nginx + Gunicorn + Supervisor(Ubuntu和CentOS)
http://sfdye.com/articles/django-best-practice-and-deployment-with-nginx-gunicorn-and-supervisor/
结果出现runserver --settings=...的时候出现报错Could not import settings 'conf.local' (Is it on sys.path? Is there an import error in the settings file?): N
o module named conf.local

怎么调整也找不到,很是奇怪
最后发现 原来又是这个万恶的

init.py
一定要在自建的文件夹里面建立这个空文件才会被django扫描为模块啊....

相关文章

python使用str & repr转换字符串

可能比较 low 还是记录一下: str 和 repr的使用过程 str 是一个类型 (int, long 类似), 同样她也可以作为一个工厂方法 实例一个 string re...

解决Python print输出不换行没空格的问题

今天在做编程题的时候发现Python的print输出默认换行输出,并且输出后有空格。 题目要求输出 122 而我的输出是: 1 2 2 于是我百度查到取消print自动换行的方法:就是在...

python实现向ppt文件里插入新幻灯片页面的方法

本文实例讲述了python实现向ppt文件里插入新幻灯片页面的方法。分享给大家供大家参考。具体实现方法如下: # -*- coding: UTF-8 -*- import win32...

python中while和for的区别总结

Python中for循环和while循环本质上是没有区别的,但是在实际应用上,针对性不太一样。 while循环适用于未知循环次数的循环,for循环适用于已知循环次数的循环 。 for主...

Centos Python2 升级到Python3的简单实现

1. 从Python官网到获取Python3的包, 切换到目录/usr/local/src #wget https://www.python.org/ftp/python/3.5.1...