Hi chacs66,

If you do you setup right you don't have to worry about it.  Here is
an example.  Suppose you have an app called myapp and in the myapp
folder you have a urls.py that contains this:

urlpatterns += patterns(
    '',
    (r'^static_media/(?P<path>.*)$', 'django.views.static.serve',
    {'document_root':
os.path.join(os.path.dirname(__file__),'static_media')}),
)

So if you are running with the  development server, any urls inside /
myapp/static_media will be handled.

Now if for production you are using Apache with mod_python, just do
this in your Apache settings file:

    # Inside this directory there is a static_media folder
    DocumentRoot /absolute/path/to/myproject/myapp
    SetHandler mod_python
    PythonPath "['/absolute/path/to','/absolute/path/to/myproject'] +
sys.path"
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE myproject.settings
    # TODO - Turn off for production
    PythonDebug On

    # Let Apache serve our application's static media files
    <Location "/static_media/">
        SetHandler None
    </Location>

Apache will intercept the /myapp/static_media/... URLs and mod_python
will never see them, so django.views.static.serve will never be
invoked.

--gordy


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