Django 环境搭建

来源:互联网 发布:移动终端禁止接入网络 编辑:程序博客网 时间:2024/05/20 14:41

  1.python环境下载、安装(C:/Python26)

 

  2.Django 环境下载、安装(C:/Django-1.0.2-final/build/scripts-2.6;)

 

  3.环境变量设置(C:/Django-1.0.2-final/build/scripts-2.6;C:/Python26;)方便运行django-admin.py指令,建立

 

     Django工程

 

  4.开发环境设置:eclipse+pydev,在eclipse装pydev,在eclipse中sofeware update中新建remote site 下载路

 

    径为http://pydev.sf.net/updates/

 

  5.使用django-admin.py startproject test命令新建工程,test工程建立完成后,进入test工程目录,运行 

 

     manage.py runserver 启动内置服务器

 

  6.新建Helloworld demo:

 

      新建:helloworld.py:

 

              from django.http import HttpResponse

               def index(request):
                     return HttpResponse("hello Django.")

       

 

      修改:urls.py

 

              添加:(r'^$', 'newtest.helloworld.index'),

 

 

    7.访问http://127.0.0.1:8000/页面

 

                 

              

 

  

原创粉丝点击