Django in Windows 7 to install and create the project hello word tutorial

  • 2020-04-02 13:50:04
  • OfStack

This article briefly describes the installation and development of the django framework for python, one of the most popular programming languages.

Django in Windows 7 to install and create the project hello word, relatively speaking is very simple, here directly give the command and code, do not understand can consult the relevant information.

1. Installation:
The command is as follows:


pip install Django==1.6.5

2. Create a project


django-admin.py startproject web

Modify urls. Py


url(r'^blog/index/$','blog.views.index'),

3. Creation project:


django-admin.py startapp blog

Modification: / blog/views. Py

Add:


from django.http import HttpResponse
def index(req):
  return HttpResponse("hello world");

4. Start your own server


python manage.py runserver

Visit page:
http://127.0.0.1:8000/blog/index/


Related articles: