#15765: Serving static files in development doesn't work with staticfiles 
activated
-------------------------------------+-------------------------------------
               Reporter:  Semmel     |        Owner:  nobody
                   Type:             |       Status:  closed
  Uncategorized                      |    Component:  contrib.staticfiles
              Milestone:             |     Severity:  Normal
                Version:  1.3        |     Keywords:
             Resolution:             |    Has patch:  0
  worksforme                         |  Needs tests:  0
           Triage Stage:             |
  Unreviewed                         |
    Needs documentation:  0          |
Patch needs improvement:  0          |
-------------------------------------+-------------------------------------

Comment (by jezdez):

 Replying to [comment:2 Semmel]:
 > I've added a little test project to demonstrate the behavior. Just run
 it and point your browser to http://localhost:8000/static/myfolder/. Of
 course I could use `staticfiles_urlpatterns` for serving files in
 development. For this example I used `static` and added `show_indexes` as
 an easy way to see that the folder really is there
 (http://localhost:8000/static/ works as expected) but navigating to
 anything else just doesn't work.

 As I said, if you use staticfiles, the STATIC_ROOT directory won't be
 served directly but will use the staticfiles finders instead to find the
 files linked via STATIC_URL. Feel free to not use staticfiles but the
 django.core.views.static view if you just want to serve files located in
 the STATIC_ROOT directory.

 > Is there any resource for a standard staticfiles layout? I tried to peek
 at djangoproject.com but was surprised to see that it doesn't even use
 staticfiles.

 Yes, as described in the docs, by default staticfiles will look at the
 static/ directories of each app and all the directories listed in
 STATICFILES_DIRS -- similarly to how templates are structured. If you have
 "common files" that don't fit any of your apps, put them in a separate
 directory and add that directory to the STATICFILES_DIRS setting.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15765#comment:3>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to