一:pip install Django

      安装完以后,运行python manager.py runserver 0.0.0.0:8000报错
 
1):没有安装Mysql-python,安装Mysql-python的时候报错没有注册,把下面的代码保存为register.py文件,然后执行python register.py,就可以了
#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html import sys from _winreg import * # tweak as necessary
version = sys.version[:3]
installpath = sys.prefix regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
) def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print "*** Unable to register!"
return
print "--- Python", version, "is now registered!"
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print "=== Python", version, "is already registered!"
return
CloseKey(reg)
print "*** Unable to register!"
print "*** You probably have another Python installation!" if __name__ == "__main__":
RegisterPy()

 
2)字符集不对:

 
解决办法:在D:\Python27\Lib\mimetypes.py 的import下添加如下代码
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
 
 
3):安装了Mysql-python但是还是报错,这是因为安装的版本错了,要安装32位的,MySQL-python-1.2.5.win32-py2.7.exe  这里的32位不是指你的操作系统32位,而是Python的

 
4):然后运行的时候还报错:

 
 解决办法,找到D:\Python27\lib\functools.py 这个文件,把第56行的convert这一段替换成下面这一段
convert = {
'__lt__': [('__gt__', lambda self, other: not (self < other or self == other)),
('__le__', lambda self, other: self < other or self == other),
('__ge__', lambda self, other: not self < other)],
'__le__': [('__ge__', lambda self, other: not self <= other or self == other),
('__lt__', lambda self, other: self <= other and not self == other),
('__gt__', lambda self, other: not self <= other)],
'__gt__': [('__lt__', lambda self, other: not (self > other or self == other)),
('__ge__', lambda self, other: self > other or self == other),
('__le__', lambda self, other: not self > other)],
'__ge__ ': [('__le__', lambda self, other: (not self >= other) or self == other),
('__gt__', lambda self, other: self >= other and not self == other),
('__lt__', lambda self, other: not self >= other)]
}
然后成功啦

 
 
 

windos下安装django的更多相关文章

  1. 在centos下安装django

    这里有一个不错的Django的学习资料.先收藏一下,以备后用.谢谢 http://www.ziqiangxuetang.com/django/django-install.html 在centos下安 ...

  2. Windows下安装Django【转】

      Windows下安装Django及WEB服务启动 如果使用的是 Linux 或 Mac OS X ,系统可能已经预装了 Python .在命令提示符下 (或 OS X 的终端中) 输入python ...

  3. Linux下安装Django

    Django是基于Python开发的免费的开源网站框架,也是python web开发中重量级的web框架,可以用于快速搭建高性能并且优雅的网站! 下面以Fedora为例安装Django,最新Fedor ...

  4. Windows下安装Django及WEB服务启动

           如果使用的是 Linux 或 Mac OS X ,系统可能已经预装了 Python .在命令提示符下 (或 OS X 的终端中) 输入python ,如果出现python编辑环境,说明 ...

  5. win10下安装Django

    Django的核心(1.4+)可以运行在从2.5到2.7之间的任何Python版本. 我的电脑是操作系统是window10 ,内存是4G. 1.下载django 官网地址:https://www.dj ...

  6. 在windows下安装Django

    2013-07-24 21:23:30| 1.安装Python 我安装的是Python(x,y)-2.7.5.0,安装目录在C盘.安装成功后如下图所示.   2.安装Django 从https://w ...

  7. python3下安装Django

    1.下载python3 https://www.Python.org/ 我下载的是Python3.5.1 选的 Windows x86-64 executable installer 2. 打开cmd ...

  8. Ubuntu下安装Django

    正式开始Django学习历程.要用Django第一步就是要配置好环境啊.   我的配置: OS:              Ubuntu 12.10 Server:         Apache 2. ...

  9. Linux环境下安装Django和Python

        1  下载前准备操作:安装相关的依赖库(工具包) yum install gcc patch libffi-devel python-devel  zlib-devel bzip2-devel ...

随机推荐

  1. Android 虹软2.0人脸识别,注册失败问题 分析synchronized的作用

    人脸识别需要init初始化(FaceServer中),离开时需要unInit销毁:当一个含有人脸识别的界面A跳向另一个含有人脸识别的界面B时,由于初始化和销毁都是对FaceServer类加锁(sync ...

  2. 20175317 《Java程序设计》第二周学习总结

    20175317 <Java程序设计>第二周学习总结 教材学习内容总结 第二周我学习了教材三四章的内容,了解了Java与C语言的相似与不同之处. 其中第二章学到了标识符与关键字.基本数据类 ...

  3. 第一次作业——WorkCount

    项目地址:https://gitee.com/yangfj/wordcount_project 1.软件需求分析: 撰写PSP表格: PSP2.1 PSP阶段 预估耗时 (分钟) 实际耗时 (分钟) ...

  4. Opencv-Android安装使用

    这是本人第一篇博客,写博客并不是说本人的技术能力有多强,或者说炫耀自己取得的进展.在当今这个数据信息大爆炸的年代,每个人肯定会接受很多新鲜事物,但不是所有东西你都能记得一清二楚,写博客一方面是为了巩固 ...

  5. 若依项目分模块集成uflo2

    关于若依分模块创建项目可参考:https://www.cnblogs.com/conswin/p/9766186.html 了解uflo2,uflo2是一套由BSTEK自主研发的基于Java的工作流引 ...

  6. css绘制内扣圆角

    纯静态的一种效果绘制,避免使用图标浪费内存.效果如下 废话不多说,代码如下: <!DOCTYPE html> <html lang="en"> <he ...

  7. Yii框架实现restful 接口调用,增删改查

    创建模块modules; 在main.php中配置文件:(1) (2)控制器层: namespace frontend\modules\v1\controllers;use frontend\modu ...

  8. python----操作文本文件

    一.文本文件基本操作 1.1 打开文本文件,得到文件句柄并赋值给一个变量 f = open('test', 'r', encoding='utf-8') # 默认打开模式为r 文件路径:相对路径.绝对 ...

  9. vsto-Word相关操作

    //添加页码到页脚 Document doc = Globals.ThisAddIn.Application.ActiveDocument; HeaderFooter hprimary= doc.Se ...

  10. JJTree Tutorial for Advanced Java Parsing

    The Problem JJTree is a part of JavaCC is a parser/scanner generator for Java. JJTree is a preproces ...