1 安装python
直接运行python-2.7.6.msi
2 安装django
解压Django-1.3.1.tar.gz,进入Django目录,运行python setup.py install
运行完毕后设置环境变量增加环境Path:C:\Python27;C:\Python27\Lib; C:\Python27\Lib\site-packages\django
3 安装setuptools
运行mysql\setuptools-0.6c11.win32-py2.7.exe
4 安装mysql数据库
运行mysql\mysql-5.5.28-win32.msi
pymssql下载
https://pypi.python.org/pypi/pymssql/2.0.0
5 安装mysql图形化界面管理工具
运行mysql\NavicatMySQLFront\navicat8_mysql_cs.exe
MySQL-python下载
http://www.codegood.com/downloads
http://baike.baidu.com/view/21087.htm?fr=ala0_1
6 安装python支持mysql的数据库api模块
运行mysql\MySQL-python-1.2.3.win32-py2.7.exe
import MySQLdb不报错
7 安装python支持mssql的数据库api模块
运行mssql\pymssql-2.0.0.win32-py2.7.exe
import pymssql不报错
8 安装SQLAlchemy
建议先安装setuptools,安装完成后在命令行输入如下命令:
# easy_install SQLAlchemy
第二种安装方式,则需要首先下载SQLAlchemy发布版本,将其解压后在命令行输入:
解压缩sqlalchemy\SQLAlchemy-0.8.2.tar.gz,进入SQLAlchemy-0.8.2目录
# python setup.py install
安装Database API
SQLAlchemy设计用于和DB-API协作处理数据库,目前支持的数据库包括Supported Databases。
检查已安装的SQLAlchemy版本
>>> import sqlalchemy
>>> sqlalchemy.__version__
9 djangorestframework-0.3.2
cd djangorestframework-0.3.2
运行python setup.py install
10 django-mssql安装
https://pypi.python.org/pypi/django-mssql
错误:No module named pythoncom pywin32-218.win32-py2.7.exe安装
http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.7.exe/download
mimetypes.py i:n enum_types, line 249,'ascii' codec can't decode byte 0xd7 in position
去掉下面几行:
'''
try:
ctype = ctype.encode(default_encoding) # omit in 3.x!
except UnicodeEncodeError:
pass
'''
python C:\Python27\scripts\django-admin.py startproject myblog
python manage.py runserver
python manage.py startapp blog
python manage.py syncdb
python manage.py validate
环境变量增加:
C:\Python27;C:\Python27\Scripts;D:\MySQL\bin;C:\Python27\Lib\site-packages\django;C:\Python27\scripts\django-admin.py;
参考资料:
中文
http://docs.oneele.com/django/topics
Django 中的用户认证
http://docs.oneele.com/django/topics/auth.html#id21
英文
https://docs.djangoproject.com/en/1.6/
http://www.cnblogs.com/hillfree/default.html?page=1
下载
https://pypi.python.org/pypi/pymssql/2.0.0
Django REST framework
http://www.django-rest-framework.org/
http://www.django-rest-framework.org/tutorial/1-serialization.html
Django实战系列
http://blog.csdn.net/thinkinside/article/category/1068327