On Tuesday, February 22, 2011 11:04:52 pm King wrote: > In the Note under this section > http://docs.djangoproject.com/en/dev/howto/static-files/#s-using-django-con > trib-staticfiles , it mentions that "In previous versions of Django, it was > common to place static assets in MEDIA_ROOT along with user-uploaded > files, and serve them both at MEDIA_URL. " and that "staticfiles does not > deal with user-uploaded files at all." > > Does this mean that you use STATIC_ROOT for all your static files > (CSS, JS, images), and MEDIA_ROOT just for user-uploaded files? > > It's confusing because in the Django code I've looked at, I've only > seen people use the MEDIA_ROOT, and it's often used to store the CSS, > JS and Images (the same files that the documentation seems to be > suggesting that STATIC_ROOT should be used for).
Static files appear to be for apps as part of large projects. from the docs[1]: For small projects, this isn’t a big deal, because you can just keep the static files somewhere your web server can find it. However, in bigger projects – especially those comprised of multiple apps – dealing with the multiple sets of static files provided by each application starts to get tricky. also from settings.py # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" STATIC_ROOT = '' STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. ) # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) Essentially, I think this is a "You'll know when you need it." type setting. Mike [1] http://docs.djangoproject.com/en/dev/howto/static-files/ -- When some people discover the truth, they just can't understand why everybody isn't eager to hear it. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.