diff options
| author | Tom Christie | 2012-01-28 18:53:55 +0000 | 
|---|---|---|
| committer | Tom Christie | 2012-01-28 18:54:02 +0000 | 
| commit | 765ec0b76ea22c857190ee6a25e9e6615e5b0c5e (patch) | |
| tree | c7f4931a097a71fad8ab4773186038beff1c8f90 /examples | |
| parent | f34ed6d1f3d8c1c4c5059beba944aa386e9a15ab (diff) | |
| download | django-rest-framework-765ec0b76ea22c857190ee6a25e9e6615e5b0c5e.tar.bz2 | |
Use `staticfiles` for serving css.  Fixes #116.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/settings.py | 13 | ||||
| -rw-r--r-- | examples/urls.py | 2 | 
2 files changed, 6 insertions, 9 deletions
diff --git a/examples/settings.py b/examples/settings.py index e12b7f3f..a8846b1b 100644 --- a/examples/settings.py +++ b/examples/settings.py @@ -53,16 +53,10 @@ MEDIA_ROOT = os.path.join(os.getenv('EPIO_DATA_DIRECTORY', '.'), 'media')  # trailing slash if there is a path component (optional in other cases).  # Examples: "http://media.lawrence.com", "http://example.com/media/"  # NOTE: None of the djangorestframework examples serve media content via MEDIA_URL. -MEDIA_URL = '' +MEDIA_URL = '/uploads/' + +STATIC_URL = '/static/' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -# NOTE: djangorestframework does not require the admin app to be installed, -# but it does require the admin media be served.  Django's test server will do -# this for you automatically, but in production you'll want to make sure you -# serve the admin media from somewhere. -ADMIN_MEDIA_PREFIX = '/static/admin'  # Make this unique, and don't share it with anybody.  SECRET_KEY = 't&9mru2_k$t8e2-9uq-wu2a1)9v*us&j3i#lsqkt(lbx*vh1cu' @@ -102,6 +96,7 @@ INSTALLED_APPS = (      'django.contrib.contenttypes',      'django.contrib.sessions',      'django.contrib.sites', +    'django.contrib.staticfiles',      'django.contrib.messages',      'djangorestframework', diff --git a/examples/urls.py b/examples/urls.py index 08d97a14..bd4087fd 100644 --- a/examples/urls.py +++ b/examples/urls.py @@ -1,6 +1,7 @@  from django.conf.urls.defaults import patterns, include, url  from django.conf import settings  from sandbox.views import Sandbox +from django.contrib.staticfiles.urls import staticfiles_urlpatterns  urlpatterns = patterns('',      (r'^$', Sandbox.as_view()), @@ -15,3 +16,4 @@ urlpatterns = patterns('',      (r'^', include('djangorestframework.urls')),  ) +urlpatterns += staticfiles_urlpatterns()  | 
