首页 > 数据库技术 > 详细

Django下编译项目出错,需要安装sqlite3

时间:2016-03-29 19:12:59      阅读:448      评论:0      收藏:0      [点我收藏+]

Django装完,创建第一个项目,并运行:python manage.py runserver。提示出错:

 

   raise ImproperlyConfigured("Error loading either pysqlite2 or
sqlite3 modules (tried in that order): %s" % exc)
django.core.exceptions.ImproperlyConfigured: Error loading either
pysqlite2 or sqlite3 modules (tried in that order): No module named
_sqlite3


需要安装sqlite3.


SQLite3下载地址:http://www.sqlite.org/download.html


进入下载目录,解压文件tar -zxvf sqlite-amalgamation-3.7.3.tar.gz.

 

解压后生成sqlite-3.7.3目录. cd 进入sqlite-3.7.3。

./configure

make

sudo make install

安装完成。

2测试

在任意目录下新建一个数据库,比如student ,

命令: sqlite3 student

出现如下提示:

 

SQLite version 3.7.2
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

 

 

进入python安装目录,重新make/make install。

 

再运行:

python manage.py runserver

 

ok啦:

 

[root@node01 DjangoTest]# python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
March 29, 2016 - 01:40:27
Django version 1.9.1, using settings ‘DjangoTest.settings‘
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Not Found: /
[29/Mar/2016 01:40:48] "GET / HTTP/1.1" 200 1767
Not Found: /favicon.ico
[29/Mar/2016 01:40:48] "GET /favicon.ico HTTP/1.1" 404 1940
Not Found: /favicon.ico
[29/Mar/2016 01:40:48] "GET /favicon.ico HTTP/1.1" 404 1940

 

 

 

在浏览器界面输入:

[root@node01 DjangoTest]# python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
March 29, 2016 - 01:40:27
Django version 1.9.1, using settings ‘DjangoTest.settings‘
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Not Found: /
[29/Mar/2016 01:40:48] "GET / HTTP/1.1" 200 1767
Not Found: /favicon.ico
[29/Mar/2016 01:40:48] "GET /favicon.ico HTTP/1.1" 404 1940
Not Found: /favicon.ico
[29/Mar/2016 01:40:48] "GET /favicon.ico HTTP/1.1" 404 1940

 

 

 

也能看到:

 

技术分享

 

Django下编译项目出错,需要安装sqlite3

原文:http://www.cnblogs.com/simba372/p/5333945.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!