#pip 安装
F:\python_environment>pip install Django==1.11
#到目录下源码安装
python setup.py install
#检查Django安装成功
F:\python_environment>python -m django --version
1.11
# 或者
import django
#创建项目
F:\python_www>django-admin
F:\python_www>django-admin startproject web
#启动服务
F:\python_www\web>python manage.py
F:\python_www\web>python manage.py runserver
Performing system checks...
#通过浏览器访问http://127.0.0.1:1111/
F:\python_www\web>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
June 19, 2017 - 22:49:06
Django version 1.11, using settings 'myblog.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Error: [WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试。
#更改端口再次 访问就好了
F:\python_www\web>python manage.py runserver 1111
Performing system checks...
Django 的安装及访问
最新推荐文章于 2025-01-22 16:31:31 发布
本文介绍了如何使用pip安装特定版本的Django,并演示了如何通过命令行工具创建新的Django项目及运行本地开发服务器。此外,还展示了如何解决常见的端口访问错误。
976

被折叠的 条评论
为什么被折叠?



