Opened 12 years ago
Last modified 12 years ago
#19438 closed Cleanup/optimization
Install docs - admin static files - clarification — at Initial Version
Reported by: | bb42 | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Getting django installed easyly is one crucial aspect of making it more popular.
Coming from a PHP background I found getting the demo "polls" application to work quite a challenge. One aspect is the static file handling, that is described as part of the Apache-WSGI installation:
https://docs.djangoproject.com/en/1.4/howto/deployment/wsgi/modwsgi/#serving-the-admin-files
"We _strongly_ recommend using the staticfiles app" might not be valid for people who start with Django, so to clarifiy this paragraph I propose the following new text:
###
- As long as you use the development server, you need not care about static files configuration, because these files are served automatically for the admin and any other installed apps.
- If you use a dedicated web server, like Apache, the easiest way to configure the Admin static files handling is to setup an Alias in Apache's httpd.conf (or apache.conf etc.), similar to the Alias directives described above.
An example from a recent debian installation is:
Alias /static/admin /usr/local/lib/python2.6/dist-packages/django/contrib/admin
<Directory /static/admin/>
Order deny,allow
Allow from all
</Directory>
- In a multi-project environment you will often want to integrate not only the admin files but CSS, Javascript or picture files for other apps from various local or remote sources. The profound solution for this is the 'staticfiles app' (link) which collects copies of all needed files in a local directory from where they are read by the webserver.
###