Just installed Ubuntu, want to try Django, here is the procedure
1. Irrelevant, install SSH
sudo apt-get update
sudo apt-get install Openssh-server
/etc/init.d/ssh start
2. Then you can access it via X_shell, install Django
sudo apt-get install python-django-y
3. See the Django version
Python
Import Django
Django.get_version ()
Output 1.8.1
4, check the next file, CTRL + C can not exit, check the terminal into the Python command to use Ctrl+d exit
5, create a site, it is called HelloWorld Bar
mkdir MySite
CD MySite
Django-admin Startproject HelloWorld
6, into the site to view the next file
sudo apt install tree
Then you can use the tree without LS.
Tree when the file is displayed in the form of trees
7. Start the site
Python manage.py runserver an error,
Hint to first Python manage.py migrate
Well, first Python manage.py migrate.
And then Python manage.py runserver
8, OK, prompt to access the http://127.0.0.1:8000
CTRL + C to exit
9, open the browser to access the upper address, the page shows, "It worked!"
10, the virtual machine access is no problem, back to the host machine with IP access
To modify the startup mode:
Python manage.py runserver 0.0.0.0:8000
Access appears 500, prompting "need to add U ' virtual machine IP ' to Allowed_host"
Baidu, modify the project setting.py, the allowd_hosts =[] changed to allowd_hosts =[' * '
Re-visit, "It worked!"
Ubuntu Deployment Django