mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
ep.io fixes
This commit is contained in:
parent
904f197474
commit
b8bfebc837
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
@ -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).
|
||||
|
|
Loading…
Reference in New Issue
Block a user