1 下载
首先查看settings.py文件中如下内容:
DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
sqllit3对应的是pysqllite2模块,可以从 http://pysqlite.org 下载到最新版本
2 安装
安装下载文件。
3 初始化数据库
在相应的实例下,执行django-admin.py 或 manage.py
如下图:
4 修改settings.py
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = './data.db' # Or path to database file if using sqlite3.
DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
哦了,现在你可以使用sqlite模块了!!!