Skip to content

Commit

Permalink
fix auto_code, fix collection zip package filename, update sandbox/se…
Browse files Browse the repository at this point in the history
…ttings
  • Loading branch information
yomguy committed Dec 18, 2014
1 parent df450c6 commit a8a86ed
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
45 changes: 38 additions & 7 deletions example/sandbox/settings.py
Expand Up @@ -4,11 +4,14 @@
import os, sys
from django.core.urlresolvers import reverse_lazy, reverse

sys.dont_write_bytecode = True

BASE_DIR = os.path.dirname(os.path.dirname(__file__))

DEBUG = True
TEMPLATE_DEBUG = DEBUG
# ALLOWED_HOSTS = ('localhost',)
sys.dont_write_bytecode = True

ALLOWED_HOSTS = ['*']

ADMINS = (
('Guillaume Pellerin', 'yomguy@parisson.com'),
Expand Down Expand Up @@ -58,10 +61,10 @@

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')

if not os.path.exists(MEDIA_ROOT):
os.mkdir(MEDIA_ROOT)
os.mkdir(MEDIA_ROOT)

# 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).
Expand Down Expand Up @@ -164,10 +167,13 @@
TELEMETA_ORGANIZATION = 'Parisson'
TELEMETA_SUBJECTS = ('test', 'telemeta', 'sandbox')
TELEMETA_DESCRIPTION = "Telemeta TEST sandbox"
TELEMETA_LOGO = STATIC_URL + 'telemeta/images/logo_telemeta_2.png'

TELEMETA_GMAP_KEY = 'ABQIAAAArg7eSfnfTkBRma8glnGrlxRVbMrhnNNvToCbZQtWdaMbZTA_3RRGObu5PDoiBImgalVnnLU2yN4RMA'
TELEMETA_CACHE_DIR = MEDIA_ROOT + 'cache/'
TELEMETA_EXPORT_CACHE_DIR = MEDIA_ROOT + 'export/'
TELEMETA_DATA_CACHE_DIR = TELEMETA_CACHE_DIR + "data/"

TELEMETA_CACHE_DIR = os.path.join(MEDIA_ROOT, 'cache')
TELEMETA_EXPORT_CACHE_DIR = os.path.join(MEDIA_ROOT, 'export')
TELEMETA_DATA_CACHE_DIR = os.path.join(TELEMETA_CACHE_DIR, 'data')

TELEMETA_DOWNLOAD_ENABLED = True
TELEMETA_STREAMING_FORMATS = ('mp3', 'ogg')
Expand Down Expand Up @@ -220,3 +226,28 @@
SUIT_CONFIG = {
'ADMIN_NAME': 'Telemeta Admin'
}


# LOG_DIR = os.path.join(BASE_DIR, 'log')

# if not os.path.exists(LOG_DIR):
# os.mkdir(LOG_DIR)

# LOGGING = {
# 'version': 1,
# 'disable_existing_loggers': False,
# 'handlers': {
# 'file': {
# 'level': 'DEBUG',
# 'class': 'logging.FileHandler',
# 'filename': os.path.join(LOG_DIR, 'debug.log')
# },
# },
# 'loggers': {
# 'django.request': {
# 'handlers': ['file'],
# 'level': 'DEBUG',
# 'propagate': True,
# },
# },
# }
2 changes: 1 addition & 1 deletion telemeta/views/collection.py
Expand Up @@ -221,7 +221,7 @@ def get(self, request, *args, **kwargs):
response = HttpResponse(z, content_type='application/zip')

response['Content-Disposition'] = "attachment; filename=%s.%s" % \
(item.code, 'zip')
(collection.code, 'zip')
return response

@method_decorator(login_required)
Expand Down
2 changes: 1 addition & 1 deletion telemeta/views/item.py
Expand Up @@ -769,7 +769,7 @@ def get_initial(self):
collection = collections[0]
item.collection = collection
items = MediaItem.objects.filter(collection=collection)
item.code = auto_code(items, collection.code)
item.code = auto_code(collection)
return model_to_dict(item)

def get_success_url(self):
Expand Down

0 comments on commit a8a86ed

Please sign in to comment.