Note that there are some explanatory texts on larger screens.

plurals
  1. PODjango static files problem
    primarykey
    data
    text
    <h2>Duplicate of <a href="https://stackoverflow.com/questions/4565935/django-staticfiles-app-help">Django staticfiles app help</a></h2> <p>I'm using Django 1.3 beta and the static files app is confusing. In development mode it is meant to automatically serve files from the <code>STATIC_URL</code> path. </p> <blockquote> <p>From <a href="http://docs.djangoproject.com/en/dev/howto/static-files/" rel="nofollow noreferrer">http://docs.djangoproject.com/en/dev/howto/static-files/</a> </p> <p>If you're using the built-in development server (the runserver management command) and have the DEBUG setting set to True, your staticfiles will automatically be served from STATIC_URL in development.</p> </blockquote> <p>This didn't seem to work, so I tried a url pattern ('/static/') which routes to the static.serve view. This just 404'd. Somehow it conflicts with the STATIC_URL, if I change it to 'assets/' it will serve the files from static just fine. It's only logical to use '/static' for the static url, but this conflicts. </p> <p>Url Patterns:</p> <pre><code>urlpatterns = patterns('', # Serve static files for *development only* (r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), </code></pre> <p>Static files settings:</p> <pre><code>STATIC_ROOT = '/home/dave/static/flux' # URL that handles the static files served from STATIC_ROOT. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/' </code></pre> <p>Ideally I would like Django to use the static url for seving files in development without having to use any urlpatterns.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload