aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2011-12-30 15:33:08 +0000
committerTom Christie2011-12-30 15:33:14 +0000
commitb8bfebc83719a7c286fee413bb44fffedac1a8d0 (patch)
tree2365a92b80c3682ccf4daa1126ca8383aa2166ba
parent904f197474ad3561d3d273961a70ab19d8175aaf (diff)
downloaddjango-rest-framework-b8bfebc83719a7c286fee413bb44fffedac1a8d0.tar.bz2
ep.io fixes
-rw-r--r--examples/epio.ini3
-rw-r--r--examples/objectstore/views.py3
-rw-r--r--examples/settings.py3
3 files changed, 7 insertions, 2 deletions
diff --git a/examples/epio.ini b/examples/epio.ini
index 00a90bce..4e61a42d 100644
--- a/examples/epio.ini
+++ b/examples/epio.ini
@@ -42,11 +42,12 @@ postgres = true
# to the real file 'configs/epio.py':
# config.py = configs/epio.py
+media/ = %(data_directory)s/
# #### If you're using Django, you'll want to uncomment some or all of these lines ####
# [django]
# # Path to your project root, relative to this directory.
-# base = .
+# base = .
#
# [static]
# Serve the admin media
diff --git a/examples/objectstore/views.py b/examples/objectstore/views.py
index 2a222529..8f997d7e 100644
--- a/examples/objectstore/views.py
+++ b/examples/objectstore/views.py
@@ -13,6 +13,9 @@ import operator
OBJECT_STORE_DIR = os.path.join(settings.MEDIA_ROOT, 'objectstore')
MAX_FILES = 10
+if not os.path.exists(OBJECT_STORE_DIR):
+ os.makedirs(OBJECT_STORE_DIR)
+
def remove_oldest_files(dir, max_files):
"""
diff --git a/examples/settings.py b/examples/settings.py
index 4438bb84..e12b7f3f 100644
--- a/examples/settings.py
+++ b/examples/settings.py
@@ -1,4 +1,5 @@
# Settings for djangorestframework examples project
+import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@@ -46,7 +47,7 @@ USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
# NOTE: Some of the djangorestframework examples use MEDIA_ROOT to store content.
-MEDIA_ROOT = 'media/'
+MEDIA_ROOT = os.path.join(os.getenv('EPIO_DATA_DIRECTORY', '.'), 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).