Code

Opened 5 years ago

Closed 5 years ago

#11229 closed (fixed)

The mod_wsgi documentation about hosting of static files wrongly refers to mod_python documentation.

Reported by: grahamd Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In the page:

http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/

it says:

"""See the Apache/mod_python documentation for directions on serving static media"""

Reference to the mod_python documentation should not be done as how it is done for mod_python is different. When using mod_wsgi you do not need to use the hacks that have to be done when using mod_python because mod_wsgi interacts properly with other Apache directives such as the Alias directive such that it works with no hacks required. In other words, the 'Location/SetHandler None' hack used in mod_python isn't required.

As per example in:

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

and further described in:

http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#Hosting_Of_Static_Files

all you need to do is use an Alias directive to map URL to location of static media files and then allow Apache to serve those media files. For example:

Alias /robots.txt /usr/local/wsgi/static/robots.txt
Alias /favicon.ico /usr/local/wsgi/static/favicon.ico

AliasMatch /([^/]*\.css) /usr/local/wsgi/static/styles/$1

Alias /media/ /usr/local/wsgi/static/media/

<Directory /usr/local/wsgi/static>
Order deny,allow
Allow from all
</Directory>

WSGIScriptAlias / /usr/local/wsgi/scripts/django.wsgi

<Directory /usr/local/wsgi/scripts>
Order allow,deny
Allow from all
</Directory>

You SHOULD NOT BE USING:

<Location "/media">
    SetHandler None
</Location>

<LocationMatch "\.(jpg|gif|png)$">
    SetHandler None
</LocationMatch>

as given in the mod_python documentation and as currently referred to.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by SmileyChris

  • Component changed from Uncategorized to Documentation
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(In [11249]) Fixed #11229 -- Updated the mod_wsgi deployment documentation to avoid references to mod_python and techniques that are not recommended or required for mod_wsgi. Thanks to Graham Dumpleton for the suggestion and guidance.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.