AttributeError: 'Settings' object has no attribute 'DATABASE_ENGINE'
settings.py 里的部分配置:
INSTALLED_APPS = (
'south',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls'
)
其中south:为同步模型到数据库的第三方模块,用来取代syncdb。
polls:为自己的投票应用。
目前我执行python manage.py syncdb或者python manage.py startmigration polls --initial均报错,报错信息如下:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.7-py2.7.egg/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.7-py2.7.egg/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.7-py2.7.egg/django/core/management/__init__.py", line 238, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.7-py2.7.egg/django/core/management/__init__.py", line 41, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/local/python2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.6-py2.7.egg/south/management/commands/syncdb.py", line 5, in <module>
from south import migration
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.6-py2.7.egg/south/migration.py", line 17, in <module>
from south.db import db
File "/usr/local/python2.7/lib/python2.7/site-packages/South-0.6-py2.7.egg/south/db/__init__.py", line 9, in <module>
module_name = '.'.join(['south.db', settings.DATABASE_ENGINE])
File "/usr/local/python2.7/lib/python2.7/site-packages/Django-1.7-py2.7.egg/django/conf/__init__.py", line 47, in __getattr__
return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'DATABASE_ENGINE'
相关推荐
多线程爬虫出现报错AttributeError: ‘NoneType’ object has no attribute ‘xpath’
多线程爬虫出现报错AttributeError: ‘NoneType’ object has no attribute ‘xpath’一、前言二、问题三、思考和解决问题四、运行效果 一、前言 mark一下,本技术小白的第一篇CSDN博客! 最近在捣鼓爬虫,看的是机械工业出版社的《从零开始学Python网络爬虫》。这书吧,一言难尽,优点是案例比较多,说的也还算清楚,但是槽点更多:1、较多低级笔误;2、基础知识一笔带过,简单得不能再简单,对Python基础不好的人不友好;3、代码分析部分,相同的代码反复啰嗦解释多次,而一些该解释的新代码却只字不提;4、这是最重要的一点,但也不全是本书的锅。就是书中
python的mysql数据查询及报错AttributeError: ‘Connection’ object has no attribute ‘curson’
import pymysql #创建连接 con = pymysql.connect(host='localhost',user='root',password='123456',port=3306,database='zhy') #创建游标对象 cur = con.curson() #编写查询的sql语句 sql = 'select * from t_student' try: cur.execute(sql) print(查询成功) students = cur.fetchall() print(students) except Exception as
解决python3 Pycharm上连接数据库时报错的问题
最近在学习python。 今天在学习python连接Mysql数据库时报错: AttributeError: 'NoneType' object has no attribute 'encoding 使用pyCharm+python3+pyMysql+mysql5.56 数据库连接: connect = pymysql.Connect(host='localhost',port=3333,user='root',passwd='root',db='circle',charset='utf-8'); 最后查看发现,在数据库连接时不需要编码: connect = pymysql.Connec
解决运行django程序出错问题 'str'object has no attribute'_meta'
主要介绍了解决运行django程序出错问题 'str'object has no attribute'_meta',具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
【榆钱】#错误实践 安装pymysql时发生错误AttributeError: module ‘pip’ has no attribute ‘main’
今天安装pymysql时发生了错误AttributeError: module ‘pip’ has no attribute ‘main’ 解决方法如下: 1.找到PyCharm 2017.1\helpers\packaging_tool.py 2.打开packaging_tool.py,注意,最好用pycharm打开,因为这样可以直接定位到104行左右的位置 3.找到104行,会看到两个函数: def do_install(pkgs): try: import pip except ImportError: error_no_pip()


