On Jul 6, 12:29 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> Hmmm, I'm not sure the documentation is actually accurate. When you
> use manage.py to run up development server for Django, it will
> automatically add the parent directory of where the manage.py file is
> located into sys.path for you. Thus, there isn't strictly a need to
> add it to PYTHONPATH to get it to work in the first place.
>
> So, the answer is that YES, for mod_python you must use the PythonPath
> directive to specify the parent directory of where manage.py is
> located in order for your settings file to be found correctly.
>
> Graham

Graham - I was suspicious of that. I remember reading that manage.py
took care of setting all the environment variables for the development
server and interactive shell. But it didn't seem possible for
mod_python to have any idea where our projects are implicitly. Should
we file a doc bug?

On Jul 6, 12:20 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> MEDIA_ROOT is used for uploads (like FileField and ImageField.
> MEDIA_URL should be the service URL matching MEDIA_ROOT; it is also
> used in things like Model.get_FIELD_url where FIELD is the name of an
> ImageField on your model.
>
> Probably, you want your doc root to be some prefix of MEDIA_ROOT (or
> MEDIA_ROOT itself).
> MEDIA_URL would be the portion of the MEDIA_ROOT not included in your
> apache doc root (or '/' if the same).
>
> ADMIN_MEDIA_PREFIX is the URL portion under MEDIA_URL that is
> symlinked to django/contrib/admin/media.  (You don't need to worry
> about this unless you're using the Admin app.)

Jeremy - Thanks for the in-a-nutshell overview. I am in fact using the
admin app, so that was my first hurdle to clear before getting fancy.
I currently have the admin interface working. In my virtual host file
I added:

 DocumentRoot "/var/www/mysite"
 <Location "/media">
  SetHandler None
 </Location>
 <LocationMatch "\.(jpg|gif|png)$">
  SetHandler None
 </LocationMatch>

In my settings.py, I now have:
MEDIA_ROOT = '/var/www/mysite.com/media/'
MEDIA_URL = 'http://mysite.com/media/'
ADMIN_MEDIA_PREFIX = '/media/'

Does this look about right? /var/www/mysite is empty other than the
'media' subdirectory. I suppose I could have apache alias requests to /
media/ to whatever folder. I'll get fancy after some sleep ;). Once I
get things settled, I'll try to contribute lessons learned to the
wiki.

Anyway, want to say thanks again to everyone for chiming in, this is
one of the friendliest and most helpful user groups I've had the
pleasure of participating in. I was born in a small midwestern city
not far from Lawrence, KS, so I'm exited to get involved with a web
framework of similar origins ;)

Cheers


--~--~---------~--~----~------------~-------~--~----~
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