zoukankan      html  css  js  c++  java
  • Django[pronounced dʒ] installation on windows

    1.Install python,

    download python windows installer from http://www.python.org/download/ and do installation(add evironment variable); when this operation complete, there is no 'Script' folder under %Python% directory.

    2.Google search 'ez_setup', find ez_setup.py, copy it and save as ez_setup.py on a certain directory on local computer.

    3.Run ez_setup.py in cmd, this will copy setuptools to local %Python%Lib, and 'Script' folder will be created under 'Python' dir.

    4.Run: python ez_setup.py -U setuptools

      this will search easy_install** files online(process dependencies for setuptools);

    5.Run: easy_install pip(python package manager)

      this will search for pip** files online(process dependencies for pip);

    6.Run: pip install django

      this will download Django and unpackage it(if installed already, it will prompt user do upgrade);

    PS:the content below is from cnblog.com http://www.cnblogs.com/BeginMan/archive/2013/03/21/2973613.html author: BeginMan

    Django初体验(Django内置web [development] server)

    如果使用setup.py工具进行安装Django,则django-admin.py已经加入到了系统路径中,由于我们经常使用,所以建议添加到系统搜索路径中,如果是Windows平台则更改PATH环境变量即可(这一点在安装Python和Django的教程中都有)

    1.项目流程

    (1).打开DOS,可以手动建立一个文件夹或者输入dos命令(mkdir)

    (2).输入django-admin.py startproject mysite 则在当前目录创建一个mysite项目,里面包含的有:  [startproject 是一个参数]

    __init__.py:让Python把该目录当成一个开发包(即一组模块)所需的文件

    manage.py:一种命令行工具,以多种方式与django项目互动

    settings.py:该Django项目的配置工具

    urls.py:该Django项目的URL声明

    (3).启动Django内置的web服务器 在当前目录下输入manage.py runserver 命令即可启动 (4).浏览器中查看 输入127.0.0.1:8000即可看到 界面"It Worked"

    2.更改主机或端口 默认的是8000端口,并只能监听本机连接,如果更改可如下:

    还可以更改服务器监听的IP地址,可以让django监听所有的网络接口,因此其他电脑就能连接到。

  • 相关阅读:
    CRUD工程师——嵌入式Web容器
    CRUD工程师——SpringBoot启动原理
    CRUD工程师——日志
    CRUD工程师——慢SQL
    CRUD工程师——索引
    前端专业术语: shim 和 Polyfill,了解下
    H5之postMessage 。实现跨域
    摘抄详细的VUE生命周期
    如何在不使用三大地图的KEY和相关组件的情况下,直接传参数到相关的H5地图
    Mac下通过brew安装指定版本的nodejs
  • 原文地址:https://www.cnblogs.com/paul-cheung/p/3203987.html
Copyright © 2011-2022 走看看