mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-22 09:18:13 +00:00
Moved secrets to env file
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
import os
|
||||
import logging
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import mimetypes
|
||||
from datetime import timedelta
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.conf import global_settings
|
||||
from dss import storagesettings
|
||||
|
||||
from utils import here
|
||||
|
||||
@@ -211,3 +212,32 @@ JWT_AUTH = {
|
||||
'JWT_ALLOW_REFRESH': True,
|
||||
'JWT_REFRESH_EXPIRATION_DELTA': timedelta(days=30),
|
||||
}
|
||||
|
||||
""" static settings """
|
||||
CDN_URL = storagesettings.AZURE_ITEM_BASE_URL
|
||||
MIXIMAGE_URL = '{0}miximages/'.format(CDN_URL)
|
||||
WAVEFORM_URL = '{0}waveforms/'.format(CDN_URL)
|
||||
STREAM_URL = '{0}mixes/'.format(CDN_URL)
|
||||
AUDIO_URL = '{0}mixes/'.format(CDN_URL)
|
||||
|
||||
MEDIA_URL = 'http://home.bitchmints.com/DSSMedia/' # '{0}media/'.format(CDN_URL)
|
||||
|
||||
NOTIFICATIONS_FROM_ADDRESS = "admin@deepsouthsounds.com"
|
||||
|
||||
CORS_ORIGIN_ALLOW_ALL = True
|
||||
CORS_ALLOW_CREDENTIALS = True
|
||||
CORS_ALLOW_HEADERS = (
|
||||
'x-requested-with',
|
||||
'content-type',
|
||||
'cache-control',
|
||||
'accept',
|
||||
'origin',
|
||||
'authorization',
|
||||
|
||||
'upload-hash',
|
||||
'session-id',
|
||||
'auth-backend',
|
||||
'x-csrftoken'
|
||||
)
|
||||
|
||||
""" End static settings """
|
||||
@@ -103,7 +103,7 @@ class Mix(BaseModel):
|
||||
|
||||
self.clean_image('mix_image', Mix)
|
||||
# Check for the unlikely event that the waveform has been generated
|
||||
if cdn.file_exists('{0}{1}.png'.format(localsettings.WAVEFORM_URL, self.uid)):
|
||||
if cdn.file_exists('{0}{1}.png'.format(settings.WAVEFORM_URL, self.uid)):
|
||||
self.waveform_generated = True
|
||||
try:
|
||||
self.duration = mp3_length(self.get_absolute_path())
|
||||
@@ -153,12 +153,12 @@ class Mix(BaseModel):
|
||||
|
||||
def get_waveform_url(self, waveform_type=""):
|
||||
# TODO: Design better flow for this sort of thing
|
||||
if not self.waveform_generated and cdn.file_exists('{0}{1}.png'.format(localsettings.WAVEFORM_URL, self.uid)):
|
||||
if not self.waveform_generated and cdn.file_exists('{0}{1}.png'.format(settings.WAVEFORM_URL, self.uid)):
|
||||
self.waveform_generated = True
|
||||
self.save()
|
||||
|
||||
if self.waveform_generated:
|
||||
waveform_root = localsettings.WAVEFORM_URL \
|
||||
waveform_root = settings.WAVEFORM_URL \
|
||||
if hasattr(localsettings,
|
||||
'WAVEFORM_URL') else "%swaveforms" % settings.MEDIA_URL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user