1: Enter the target directory to create a project
D:\>django-admin.py startproject qiweijie
After the project is created, go to the project folder to view the directory.
D:\>>2014/03/16 11:09 2612014/03/16 11:09 <DIR>
D: \ qiweijie> dir qiweijie
5,547 settings. py
579 urls. py
1,166 wsgi. py
0 _ init _. py
2: Create an app
D:\qiweijie>python manage.py startapp qwj
D:\qiweijie>dir
261 manage. py
<DIR> qiweijie
<DIR> qwj
D: \ qiweijie> dir qwj
60 models. py
399 tests. py
2014/03/16 11: 10 27 views. py
0 _ init _. py
At this time, you can see this page.
D:\qiweijie>python manage.py runserver
3: configure the database in settings. py
4: Set the url,
url(r,include()),
4.2: Add the following content to the app's views. py file:
django.shortcuts render_to_response(,)
4.3: Create a New templatesfolder in the appfile, and create a new home.html file in the templatesfolder. Remember the TEMPLATE_DIRS file in settings. py.
Add the absolute path of the templates folder
Run it again. You can see that the welcome page is like this. Remember to first