1. Install djanjo
1. Download source code
Https://www.djangoproject.com/download/
The djanjo version downloaded in this article is 1.5.1. The download link is as follows:
Https://www.djangoproject.com/m/releases/1.5/Django-1.5.1.tar.gz
2. Installation
Go to the source code directory and execute the following command:
Python setup. py install
3. Verify djanjo
>>>Import Django>>>Print (Django. _ path __)['C: \ python27 \ Lib \ Site-packages \ Django']>>>Print (Django. get_version ())1.5.1
Ii. Use djanjo to generate a simple web page
1. Add Environment Variables
Add the PATH variable to the directory c: \ python27 \ scripts where the file django-admin.py is located.
2. Create a djanjo Project
Django-Admin. py startproject testsite1 # create the diango project testsite1cd testsite1manage. py runserver8090# Provide services on port 8090
3. Running Effect
Access can be made through 127.0.0.1, but not through the local lan ip address.
3. Use nginx for proxy
1. Download nginx
Web: http://nginx.org/en/download.html
The nginx version used in this article link: http://nginx.org/download/nginx-1.4.1.zip
2. Configure nginx
Enter the conf folder, open the nginx. conf file, and add (or modify to) the following content:
Server {Listen80;#Pay attention to port occupation issuesLocation/{Proxy_pass HTTP://127.0.0.1:8090;}}
3. Running Effect
You can see that the virtual machine can access the website through the IP address.