I. Installation of Djanjo
1, download the source code
https://www.djangoproject.com/download/
This article downloads the Djanjo version 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
Enter the source directory to execute the following command:
Copy Code code as follows:
3. Verify Djanjo
Copy Code code as follows:
>>> Import Django
>>> Print (django.__path__)
[' C:\\python27\\lib\\site-packages\\django ']
>>> print (Django.get_version ())
1.5.1
Second, the use of Djanjo to generate a simple web page
1. Add Environment variables
Add the file django-admin.py directory "C:\Python27\Scripts" to the PATH variable.
2. Create Djanjo Project
Copy Code code as follows:
django-admin.py startproject testSite1 # Create Diango Project TestSite1
CD testSite1
manage.py Runserver 8090 # provides services on 8090 ports
This can be accessed through 127.0.0.1, but not through local LAN IP.
Third, the use of Nginx agent
1, download Nginx
URL: http://nginx.org/en/download.html
This article uses the Nginx version link: http://nginx.org/download/nginx-1.4.1.zip
2. Configure Nginx
Enter the Conf folder, open the Nginx.conf file, add (or modify to) the following:
Copy Code code as follows:
server {
Listen 80; # Note Port occupancy issues
Location/{
Proxy_pass http://127.0.0.1:8090;
}
}
3. Operation effect
As you can see from the diagram, the virtual machine can access the Web site normally through the IP address.