I've worked on putting Django on a Red Hat machine, and I've noticed
that the Ubuntu version of Apache is a bit different. But, in any
case, In my /etc/apache2 httpd.conf I have:

<IfModule dir_module>
        DirectoryIndex index.html index.php
</IfModule>

<Location "/mysite/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE mysite.settings
        PythonDebug On
        PythonInterpreter mysite
        PythonPath "['/home/webmastr/public_html/django']+sys.path"
</Location>

And that's it. Excluding the /media, it should still show something,
I'd believe, or am I wrong?

On Apr 6, 9:52 am, Michael <[EMAIL PROTECTED]> wrote:
> Hey gang;
>
> Wow a lotof people are all having the same problem. Somehow the conversation
> I had with the original poster got taken off the list. Here is the next
> message I sent:
>
> chmod would change the permissions, but hede a little caution here; opening
> up your home directory allows everyone to get inside there. This might not
> be an issue with your server if you don't have anyone on it who you might
> not be able to trust, but it isn't a bad idea to get in the right habits
> here.
>
> What I would recommend if you are a web developer, is to add yourself to the
> group www-data. So in a shell punch in usermod -a -G www-data webmastr (I am
> assuming webmastr is your linux login name here). This will let you just
> give permissions to people in your group instead of everyone. Then go back
> to /home/webmastr/ and type chmod 750 -r public_html . This will give your
> full read-write-executable access to the files (7), your group including
> www-data read-execute permissions (5) and everyone else no permissions (0).
>
> Hopefully that will get your django install to work. If you want to learn
> more about linux permissions look 
> here:http://www.freeos.com/articles/3127/ordo a search for ubuntu
> permissions. There are tons of resourses. Let me
> know how that works,
>
> Then it became clear that he didn't own that file and I told him to look
> into 'chown' to own the file.
>
> There are four parts to an django site you need to remember exist when
> setting it up. You need a media root, where files are served directly by
> apache. I always use /media/ as an example. Then you need a project folder
> that is where you put all of you python files. The important file here is
> settings.py because it tells mod_python (the apache module for python) what
> to load and that is how django starts up. The third part is a templates
> directory, which is where all the django templates go. The last part is the
> SQL we won't get into that here. The media and the templates folders need to
> be defined by you inside of settings.py. Apache (generally www-data) should
> be given permission to read and execute these files.
>
> You should make sure django is in your python path. This is simple open up a
> python shell and type 'import django'. make sure your project is in a python
> path. This is done with the PythonPath in the config file. Other than that
> read up on how apache configuration works and the django and mod_python docs
> work. I promise they all work on Ubuntu without problems.
>
> Here is an example VirtualHost that I have included from my main apache.conf
> file:http://dpaste.com/43421/
>
> I hope that helps you all:
>
> Michael
>
> On Sun, Apr 6, 2008 at 8:03 AM, <[EMAIL PROTECTED]> wrote:
>
> > Exact same issue here. Tried everything listed. Any other ideas or
> > possibly a sample config for httpd.conf on ubuntu.
>
> > Thanks in advance for your help
>
> > -----Original Message-----
> > From: Will Boyce <[EMAIL PROTECTED]>
> > Sent: Sunday, April 6, 2008 3:23am
> > To: Django users <django-users@googlegroups.com>
> > Subject: Re: Configure Mod_Python fo Django on Apache server on Ubuntu
>
> > Assuming your django project (mysite) is in /home/webmaster/
> > public_html/django/ then you'll want a trailing "/" in your
> > PythonPath.
>
> > Hope this helps.
>
> > On Apr 5, 9:53 pm, HangingClowns <[EMAIL PROTECTED]> wrote:
> > > I should have the latest versions available for Apache and mod_python
> > > cause I just put those onto my server about 2 weeks ago. I'm having
> > > trouble understanding how to edit the Apache config file for Django. I
> > > currently use the code snippet below for my settings in Apache. And
> > > this is what the error looks like:
>
> > >http://67.207.140.149/mysite/
>
> > > Can someone help me out?
>
> > > I have started a project in the /home/webmastr/public_html/django
> > > called mysite, cause I'm following the tutorial on Djangoproject.org.
> > > I did not find their instructions for configuring modpython to be very
> > > helpful for me. So, back to subject, within that django folder, is a
> > > folder called "mysite" with all of the beginning project python .py
> > > files.
>
> > >  <Location "/mysite/">
> > >         SetHandler python-program
> > >         PythonHandler django.core.handlers.modpython
> > >         SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> > >         PythonDebug On
> > >         PythonPath "['/home/webmastr/public_html/django'] + sys.path"
> > > </Location>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to