aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAlen Mujezinovic2012-02-09 11:13:42 +0000
committerAlen Mujezinovic2012-02-09 11:13:42 +0000
commitadd5f32e8a9ba530591c23b8123f36468595fd88 (patch)
tree7d4794e487614c9928d5f31420dfb423350cbff6 /examples
parentdd680d7a0ae997f2e562db383f23b56624e7ea98 (diff)
parentc5691cca0e5b61b6cf866f5b8085f950e4637f5a (diff)
downloaddjango-rest-framework-add5f32e8a9ba530591c23b8123f36468595fd88.tar.bz2
Merge remote branch 'tomchristie/master'
Diffstat (limited to 'examples')
-rw-r--r--examples/requirements-epio.txt2
-rw-r--r--examples/settings.py24
-rw-r--r--examples/urls.py9
3 files changed, 17 insertions, 18 deletions
diff --git a/examples/requirements-epio.txt b/examples/requirements-epio.txt
index 76ab5bd2..b4962676 100644
--- a/examples/requirements-epio.txt
+++ b/examples/requirements-epio.txt
@@ -1,3 +1,3 @@
Pygments==1.4
Markdown==2.0.3
-djangorestframework
+git+git://github.com/tomchristie/django-rest-framework.git
diff --git a/examples/settings.py b/examples/settings.py
index e12b7f3f..5ff9fd0f 100644
--- a/examples/settings.py
+++ b/examples/settings.py
@@ -1,4 +1,5 @@
# Settings for djangorestframework examples project
+import django
import os
DEBUG = True
@@ -53,16 +54,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'
@@ -90,18 +85,17 @@ TEMPLATE_DIRS = (
# Don't forget to use absolute paths, not relative paths.
)
-# for loading initial data
-##SERIALIZATION_MODULES = {
- # 'yml': "django.core.serializers.pyyaml"
-
-#}
-
+if django.VERSION < (1, 3):
+ staticfiles = 'staticfiles'
+else:
+ staticfiles = 'django.contrib.staticfiles'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
+ staticfiles,
'django.contrib.messages',
'djangorestframework',
diff --git a/examples/urls.py b/examples/urls.py
index 08d97a14..33297b55 100644
--- a/examples/urls.py
+++ b/examples/urls.py
@@ -1,6 +1,10 @@
-from django.conf.urls.defaults import patterns, include, url
-from django.conf import settings
+from django.conf.urls.defaults import patterns, include
from sandbox.views import Sandbox
+try:
+ from django.contrib.staticfiles.urls import staticfiles_urlpatterns
+except ImportError: # Django <= 1.2
+ from staticfiles.urls import staticfiles_urlpatterns
+
urlpatterns = patterns('',
(r'^$', Sandbox.as_view()),
@@ -15,3 +19,4 @@ urlpatterns = patterns('',
(r'^', include('djangorestframework.urls')),
)
+urlpatterns += staticfiles_urlpatterns()