disikexing 的专栏

高尚是高尚者的墓志铭 : 卑鄙是卑鄙者的通行证

原创 Python模块 pysqlite收藏


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模块了!!!

   

发表于 @ 2008年04月25日 13:42:45|评论(loading...)

新一篇: 关于Django学习 | 旧一篇: Django入门 - 环境搭建

Csdn Blog version 3.1a
Copyright © 陈胜云