Installing Django
From TextUsers
Contents |
Prerequisites
First, download Jared Kuolt's django-install.py and save it to your home directory on your server. The django-install.py script makes installing Django and other necessary bits easy. If you encounter any problems, post in the Django section of the TextDrive Forum.
Second, make sure you have a port from TextDrive. You must request one instead of arbitrarily assigning one yourself. Request a port from TextDrive's request page.
You must shell into your server to proceed with the following steps.
Install Django
Run the script and it will ask you what you want to do.
$ python django-install.py To install Django, press 1. To install Lighttpd, press 2. To install a new Django project, press 3.
Type 1 and hit enter. It should install Django and the prerequisite Flup without any other questions.
Install Lighttpd
Run the script again, but this time enter 2. It will ask for your port. The script installs the proper configuration but does not enable the script to be run on server boot. You must do this yourself by following the directions on this page after the "Restarting Lighttpd when the server reboots" section.
Install a Project
The django-install.py script also helps you install your project, but before running the script again, upload your project into the "~/django_projects/" directory. When you run it again and press 3, it asks you for the Django project name and the domain it is under. For example, my answers could be "myproject" and "mysite.com". "myproject" is my base django project directory under my "~/django_projects".
After it gathers this information, the script builds the Virtual Host file for Lighttpd, enables the virtual host file in the main Lighttpd configuration, and creates an init script to easily start/stop/restart your Django project.
The init script is placed in the project directory. For example:
~/django_projects/myproject/init.sh
You may then stop, start, and restart your project with that script:
~/django_projects/myproject/init.sh start ~/django_projects/myproject/init.sh stop ~/django_projects/myproject/init.sh restart
You may now add the first line above your crontab via webmin to start the project automatically. You're all set! Have fun!
