1 | 51,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
|
---|
13 | 62,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
|
---|
34 | 86c73,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
|
---|
42 | 92c83
|
---|
43 | < 2. Run the :djadmin:`collectstatic` management command::
|
---|
44 | ---
|
---|
45 | > 3. Run the :djadmin:`collectstatic` management command::
|
---|
46 | 99c90
|
---|
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
|
---|
50 | 309,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 | <
|
---|