Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Alright, so i've been struggling with installing and configuring Django for months now. I have reinstalled Ubuntu Server countless times because of my fails. I keep messing up some way every time.

This time i thought i'd do it for real, no fails, just plain simple and no messups. I want to understand everything i do.

I have now installed Ubuntu Server 10.04.4. During the installation i chose to install LAMP server as well, so i have that working. Apache is working, i checked by typing in http://localhost in the browser.

So, all there is left to do is install Django. Correct? I already have Apache, MySQL (and PHP, but that's irrelevant) installed through the LAMP package. I also believe python comes by default in Ubuntu Server, right?

Could anyone help me with this last step? I've tried following countless tutorials, but many of them are outdated and gives me errors, and others don't explain it well enough.

I would very much appreciate a simple 5 minute guide on how to install and configure Django.


I followed the guide on djangoproject.com and downloaded it. I then unpacked it, started the terminal, navigated in to the folder and ran "sudo python setup.py install". That installed it, no errors. But how do i configure it to work with Apache now?


After three more tries i found this tutorial which worked for me: http://simonsstuffandthings.blogspot.se/2011/02/how-to-install-django-on-ubuntu-using.html

share|improve this question

closed as off-topic by Braiam, jasonwryan, garethTheRed, Anthon, Gnouc Aug 22 at 8:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Braiam, jasonwryan, garethTheRed, Anthon, Gnouc
If this question can be reworded to fit the rules in the help center, please edit the question.

Have you tried fastcgi or wsgi? Instructions here: docs.djangoproject.com/en/dev/howto/deployment/fastcgi –  Kevin Apr 24 '12 at 19:22
I don't even know what that is. Is it necessary? –  Nicklas Apr 24 '12 at 19:36

2 Answers 2

If you don't mind ignoring all that LAMP stuff you already set up, you could try Gunicorn+nginx (here's a short intro to get you started). A lot of the Django-powered startups are using it because the configuration is very straightforward compared to something like Apache with mod_wsgi (which is probably your second-best option).

share|improve this answer
Unfortunately i have to use Apache. It's a school project, and we need to use Apache. I managed to make it work a few times before, but i always messed up later making me have to reinstall everything. Is it really that hard? I have Django installed now, i just need to configure it with Apache. –  Nicklas Apr 24 '12 at 19:38
@Nicklas You're going to want mod_wsgi, then. Try this guide. It was the de facto default for a really long time, so (assuming that guide is still current; my Django is a bit rusty) it shouldn't be too bad. The architecture behind the nginx+gunicorn solution is just more unix-y; the mod_wsgi stuff probably makes perfect sense if you already understand Apache's way of doing things (I never did, but that's probably because I never used it heavily, whereas I use *nix all day, every day). –  Hank Gay Apr 24 '12 at 20:56
I'll take a look at it. Thanks! :) –  Nicklas Apr 25 '12 at 9:39

http://carlosgabaldon.com/2010/05/12/django-lamp/ is a lamp tutorial step by step. After you're done open or (whatever that is you setup)

share|improve this answer
The problem is it's 2 years old. Is the tutorial still up to date? I'll give it a shot though, thanks! –  Nicklas Apr 25 '12 at 9:39
Nevermind that, it actually says it was posted in May 2012, but in the URL it says 2010. Weird, but i'm gonna read it now. Hopefully it works! –  Nicklas Apr 25 '12 at 12:18
I have no idea what's going in now, really. I didn't get any errors during installation, and i followed it EXACTLY. Everything seems to be as it should, except it's not working. If i type in or localhost in the webbrowser it gives me a mod_python import error. If i type in it shows the standard (?) apache message "It works! This is the default web page for this server...". Any ideas? –  Nicklas Apr 25 '12 at 13:20
@Nicklas mod_python is deprecated; use mod_wsgi instead. If you go to the Django mailing list or IRC channel and ask for help with mod_python, they're probably going to tell you the same thing. Seriously, pretend you've never heard of mod_python, and it will make your life simpler. –  Hank Gay Apr 25 '12 at 15:09
Alright, i'm probably better off using mod_wsgi instead then. I wasn't sure about the age of the tutorial but apparently it was 2 years old. The problem is, i've never used Linux before. I've tried toying with it a few times, and i've tried configuring this server about 10 times now (fresh installs after each fail), but that's it. So do you think you could guide me, or possibly find an up to date tutorial for it? I have really been searching for months now, and none of the ones i've found have been up to date, or they haven't worked. I'm on a deadline as well, so i really need this. –  Nicklas Apr 25 '12 at 15:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.