django之异常错误2(Error was: No module named sqlite3.base)

具体错误代码为:

C:\djangoweb\helloworld>manage.py syncdb
Traceback (most recent call last):
  File "C:\djangoweb\helloworld\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
453, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
272, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
77, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in im
port_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django\core\management\commands\syncdb.py"
, line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
  File "C:\Python27\lib\site-packages\django\core\management\sql.py", line 9, in
 <module>
    from django.db import models
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 40, in <modul
e>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "C:\Python27\lib\site-packages\django\db\__init__.py", line 34, in __geta
ttr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 93, in __getitem
__
    backend = load_backend(db['ENGINE'])
  File "C:\Python27\lib\site-packages\django\db\utils.py", line 45, in load_back
end
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django.db.sqlite3' isn't an availa
ble database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
    u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: No module named sqlite3.base

C:\djangoweb\helloworld>

在同步数据库的时候,出现以上错误提示,请注意看错误提示,

Try using 'django.db.backends.XXX', where XXX is one of:
    u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: No module named sqlite3.base

 

系统让您尝试“django.db.backends.XXX”这样的写法,果然解决了

posted @ 2016-04-05 12:12  Xiao|Deng  阅读(1926)  评论(0编辑  收藏  举报