相关疑难解决方法(0)

使用带有Python 2.7的Sqlite3将数据库添加到Django项目

我正在尝试使用Sqlite3和Python 2.7向Django项目添加数据库.

这就是我的setting.py的样子:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'dev.db',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}
Run Code Online (Sandbox Code Playgroud)

它允许我创建数据库,它要求我创建超级用户:

You just installed Django's auth system, which means you …
Run Code Online (Sandbox Code Playgroud)

python database django python-2.7

9
推荐指数
1
解决办法
2258
查看次数

标签 统计

database ×1

django ×1

python ×1

python-2.7 ×1