Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Django on an apache server

I am new to web development. So be gentle. AND thanks in advance. I am developing on windows env. and deploying on a linux server w/ Python 2.6.2 installed. Running apache2.2 as Virtual Host, and I am using mod_wsgi. I plan to serve media files from the same Virtual Host.

I have a django site and I am now ready to deploy. I am stuck, and every site I go to seems to be outdated/incomplete/overmyhead.

https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/

http://www.djangobook.com/en/2.0/chapter12/

...only 2 links as for the newbness

The top link seems to be what I need yet I am still confused on these things:

  1. What does the file structure look like on the server
    • I cannot change/edit server files myself, I rely on the dba for that
    • I have django.wsgi, and django.wsgi~, where do those go?
    • Where do I put my project in relation to those wsgi files?

  2. The httpd.conf file is something that the server has on it? or do I create another?

  3. Do I need to put django in any way shape or form on the server? If so where? And what about the packages like registration, defaults?

Again sorry for the newbness, I have been banging my head for 2 weeks on this. Any help/links will be greatly appreciated unless they link me to the django-docs. I have read those...A LOT! thanks

like image 723
Nathan McAfee Avatar asked Oct 24 '11 16:10

Nathan McAfee


2 Answers

Also go read:

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

and watch:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

The latter includes Django examples and talks a bit about locations, permissions etc.

The first of these is even linked to in the document in the Django documentation.

like image 138
Graham Dumpleton Avatar answered Sep 30 '22 16:09

Graham Dumpleton


  1. It doesn't matter where the files go. They just have to be readable/executable by the user that the web server is running under. I don't know what you mean by django.wsgi~, that sounds like a backup file created by your editor - you don't need that.

  2. Yes the httpd.conf is the configuration file for Apache. Some distributions (eg Debian and Ubuntu) split this up into separate files for each site that the server runs. If your administrator is the only one who can edit files, he will know about this already.

  3. Yes, you need Django, and any third-party packages.

like image 23
Daniel Roseman Avatar answered Sep 30 '22 16:09

Daniel Roseman