Home | Implementing CNN style votes in Django, Episode I »
Installing Django on Gentoo The Hard Way
By Paul Kenjora | April 2, 2007
For those of you who have not used VMWare please do. It will change the way you do development. On one PC I have several distinct development environments all linked flawlesly together via source control. I can load up a VM (Gentoo) play around with a configuration, then burn the whole system if I dont like it. The best part is that Gentoo has so much rich documentation and is so well desinged and configured that I rarely have trouble getting anything I want. But I stray from the topic back to Django…
So Django was something I was very reluctant to try at first, but I figured Python is so rich and powerfull that even if Django sucks I get some benefits. As it turns out Django sucks only if you try to fight it. The guys who Designed it are those really smart types who didn’t need to study for tests and figured no one needs to read documentation. So they created a pretty good framework (once you backwards engineer it) and some pretty horrible documentation. Luckily they were smart enough to allow users to “blog” their instructions.
Finally to bring it all together and set up Django on Gentoo:
- Download the tar from the official page: http://www.djangoproject.com/download/
- tar xzvf Django-0.95.tar.gz
- cd Django-0.95
- sudo python setup.py install
The sudo command will probably not work so here is what you do:
- Create the path: /usr/django/lib/python
- Create the file: /etc/env.d/99django
- Add: PYTHONPATH=”/usr/django/lib/python”
- Run: env-update
- Run: source /etc/profile
- python setup.py install –home=/usr/django
To summarize what happened above is pretty quick. The “sudo” utility automatically sets a few things up for you if its missing you need to do them manually. First you created all the directories Django will need for Python. Then you added to Gentoo’s environamental configuration files, the setup is based on files that are read at startup to assemble all env variables. In steps 4 and 5 you updated the environment files used by the system and then all current processes. Finally in the last step you did the install manually with “sudo” hence you had to specify the install path.
And then lots of lines will scroll by and your installation will be complete, you can move on to the Django tutorial.
To test and make sure everything went ok try the following:
- Type: python [enter]
- You should see something like “>>>”.
- Type: import django [enter]
- If no errors come up life is good.
- Django Deserializer Bug On Foreign Key When None
- Joost Meets Django
- Installing Django And MySQL On MacBook Air Or OS X
- Django Generic Relations Made Easier
- Digg Re-Written In Django With A Twist
- Installing Django with PostgreSQL on Ubuntu (Antonio Cangiano)
- Popularizing Django — Or Reusable apps considered harmful. (USwaretech)
- An Interview with Jacob Kaplan-Moss – Creator of Django (USwaretech)
-
paul
-
Alan Trick
-
knnylggns
More from Aware Labs
Aware Labs Recommends
Topics: Environment Setup | Comments