Opened 11 years ago

Last modified 11 years ago

#19438 closed Cleanup/optimization

Install docs - admin static files - clarification — at Version 2

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 (last modified by Jannis Leidel)

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:

  1. 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.
  1. 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>
  1. 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.

Change History (2)

comment:1 by bb42, 11 years ago

  • Some filter does not like roman numbers => should be I. - II. - III. -

comment:2 by Jannis Leidel, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top