1. Install Django
Django's: https://www.djangoproject.com/download/
Unzip to enter this directory, execute python setup.py install
2. Testing
#python
#import python
No error occurred, proof of successful installation
3. Create a Django Project
#django-admin.py Startproject web_01
4. Modify settings.py
Modify Time_zon to Asia/shanghai
Modify Language_code to ZH-CN
in the Installed_apps under Add ' blog ',
Installed_apps = (
' Django.contrib.auth ',
' Django.contrib.contenttypes ',
' Django.contrib.sessions ',
' Django.contrib.sites ',
' Django.contrib.messages ',
' Django.contrib.staticfiles ',
' blog ',
)
5. Modify urls.py
in the urlpatterns Add URL (r ' ^blog/index/$ ', ' Blog.views.index '),
From django.conf.urls.defaults import patterns, include, url
Urlpatterns = Patterns ("',
url (r ' ^blog/index/$ ', ' Blog.views.index '),
)
6. Create an App
#django-admin.py Startapp Blog
Note: blog for in settings.py Installed_apps The items that are added inside must be consistent
7. Define the index method in views.py
From django.http import HttpResponse
def index (req):
Return HttpResponse ("
8. Open the Django-brought development server
#python manage.py Runserver
9. Testing
http://localhost:8000/blog/index/
This article is from the "wipe The Mortal Wound" blog, please be sure to keep this source http://weihuanjie.blog.51cto.com/3709233/1622413
Django Learning-----Django Development process