Ticket #15983: static-files.diff

File static-files.diff, 2.5 KB (added by Daniele Procida, 14 years ago)
Line 
151,59c51
2< 2. Set the :setting:`STATIC_URL` setting to the URL you want to use
3< for pointing to your static files, e.g.::
4<
5< STATIC_URL = '/static/'
6<
7< In projects freshly created with the :djadmin:`startproject`
8< management command this will be preset to ``'/static/'``.
9<
10< 3. Make sure that ``django.contrib.staticfiles`` is in your
11---
12> 2. Make sure that ``django.contrib.staticfiles`` is in your
1362,73c54,60
14< If you are using the :ref:`runserver<staticfiles-runserver>` for local
15< development, it will automatically find and serve your static files at the
16< :setting:`STATIC_URL` you specified in step 2.
17<
18< If you are using some other server for local development, you'll need to add
19< :ref:`staticfiles_urlpatterns<staticfiles-development>` to your URLconf.
20<
21< Assuming the default preset, a file in an app's ``static/`` subdirectory will be
22< served up at '/static/'. Therefore, the file ``my_app/static/my_app/css/my_app.css``
23< will be served up at '/static/my_app/css/my_app.css'.
24<
25< 4. You'll probably need to refer to these files in your templates. The
26---
27> For :ref:`local development<staticfiles-development>`, if you are using
28> :ref:`runserver<staticfiles-runserver>` or adding
29> :ref:`staticfiles_urlpatterns<staticfiles-development>` to your URLconf,
30> you're done! Your static files will automatically be served at the
31> default :setting:`STATIC_URL` of ``/static/``.
32>
33> 3. You'll probably need to refer to these files in your templates. The
3486c73,77
35< 1. Set the :setting:`STATIC_ROOT` setting to point to where you'd like your
36---
37> 1. Set the :setting:`STATIC_URL` setting to the public URL for your static
38> files (in some cases, the default value of ``/static/`` may still be
39> fine).
40>
41> 2. Set the :setting:`STATIC_ROOT` setting to point to where you'd like your
4292c83
43< 2. Run the :djadmin:`collectstatic` management command::
44---
45> 3. Run the :djadmin:`collectstatic` management command::
4699c90
47< 3. Deploy those files by configuring your webserver of choice to serve the
48---
49> 4. Deploy those files by configuring your webserver of choice to serve the
50309,314d299
51< .. note::
52<
53< The helper function will only be operational in debug mode and if
54< the given prefix is local (e.g. ``/static/``) and not a URL (e.g.
55< ``http://static.example.com/``).
56<
Back to Top