Opened 12 years ago

Closed 12 years ago

#19071 closed Uncategorized (needsinfo)

Static files description

Reported by: kris@… 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

So,I know I should smarter. Given.

But I would really/heartily/fully recommend that the django doc maintainers put something like this: (from the Mezzanine FAQ) in addition to the intro paragraphs of https://docs.djangoproject.com/en/dev/howto/static-files/

I find this very succinctly explains the difference between dev and production WRT static files.

"Why aren’t my JavaScript and CSS files showing up?

Mezzanine makes exclusive use of Django’s staticfiles app, for managing static files such as JavaScript, CSS, and images.

When the DEBUG setting is set to True, as it would be during development, the URL defined by the setting STATIC_URL (usually /static/), will host any files found in the static directory of any application listed in the INSTALLED_APPS setting.

When DEBUG is set to False, as it would be for your deployed production site, you must run the collectstatic command on your live site, which will copy all of the files from the static directory in each application, to the location defined by the STATIC_ROOT setting. You then need to configure an alias in your web server’s config (Apache, NGINX, etc) that maps the URL defined by STATIC_URL to serve files from this directory.

Long story short, Django doesn’t serve static content when deployed in production, leaving this up to the public facing web server, which is absolutely the best tool for this job. Consult Django’s staticfiles guide for more information."

pretty please with sugar on top? :-) (love the framework, really I do, use everyday allday just now (and for the last 11 months))

Change History (1)

comment:1 by Preston Holmes, 12 years ago

Resolution: needsinfo
Status: newclosed

Specific improvements to the documentation are always welcome.

There are currently two sections in the docs that address this in addition to the intro that summarizes the two steps under usage at the beginning. These cover everything that the FAQ item does.

In addition there is a big warning box about how the dev server for static files will only work if DEBUG = True

What elements of the FAQ text do you think would improve the current docs? If you can provide specific suggestions, or identify a specific shortcoming - please reopen with those details.

Note: See TracTickets for help on using tickets.
Back to Top