cool hit counter Build your first Django application_Intefrankly

Build your first Django application

First you need to make sure you have python installed on your machine:. Python development_python installation

Related learning materials for python.

Secondly, you also need to make sure you have Django installed on it: the Hands-on installation of Django under Windows 7

The next step is to get to the Build your first Django application

It is very simple to do, i.e. enter the code in windows terminal.

1 startproject mysite

i.e. I am on my computer's E:Python33python_workspace directory under which to create the project's

You make the catalogs.

Run the command.

1 startproject mysite
 3 # means create an application named after mysite

Moving on to.E:Python33python_workspacemysite table of contents

note Be sure to enter the mysite directory here, otherwise, it will fail to drop !!!!

Running code.

1  python runserver 8080
 3 # means start the service on port: 8080,if you don't set the port, the default is: 8000

As shown below.

With the service started, then we can now access it through our browser

Type in the address bar of your browser: http://localhost:8080

By now, your first django application is considered a success!!!

Problems encountered and solutions

1.importError:No module named django.core

Analysis and solution: this is the problem encountered when running the command: startproject mysite, and it is certain that the

django is already successfully installed on your own machine and can be accessed via.

1 python -c "import django;print(django.get_version())"

to verify; second, has been added to the environment variables at

 1 #Add to path environment variable #django's installation directory
2 E:Python33Libsite-packagesdjangoin                 

I did both of the above steps, but I still got an error, then I found out the cause of the problem: I have too many versions of python installed on my computer: python2.7.5,python32,python33

Finally uninstalled python 2.7.5, python32, leaving only python33,and ran it again, success!!!

2.python:can't open file ''

This one is similar to the cause above, the solution, also a version conflict, uninstall the others and leave only python33, success!!!

E | B |

1、Ether swipe to pay blockchain in a Jordanian refugee camp
2、Issue 914 Resource Finder
3、The first thing you need to do is to get a good idea of what youre doing
4、Ebbinghaus Smart Education constructing an education information ecology and building a new future for education
5、Download the latest version of JDEObjectBrowser 13093

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送