您的位置:首页 > 运维架构 > Linux

django restfull centos6.5 x86_64 python2.7

2015-11-19 11:46 381 查看
mkdir tutorial
cd tutorial

virtualenv env
source env/bin/activate

pip2.7 install django
pip2.7 install djangorestframework
pip2.7 install ipython
yum install ncurses-devel
pip2.7 install Readline

yum install sqlite-devel
#重新编译Python
#django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3
cd Python2.7.8
#不用./configure
make
make install

django-admin.py startproject tutorial  .
cd tutorial
django-admin.py startapp quickstart
cd ..
cd .

#第一次,请同步到数据库 
python2.7 manage.py migrate

#建立超级用户
python2.7    manage.py    createsuperus
#建立用户admin 密码:admin

摘自: http://www.django-rest-framework.org/tutorial/quickstart/#serializers
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  django restfull cent