diff --git a/Dockerfile b/Dockerfile index ed49c85..f6e5191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,10 +19,9 @@ ADD . /code/ RUN apt-get update && apt-get install -y sox lame vim \ libboost-program-options-dev libsox-fmt-mp3 postgresql-client rsync openssh-client -RUN pip uninstall azure RUN pip install -r requirements.txt RUN adduser --disabled-password --gecos '' djworker RUN chown djworker /files -R RUN chown djworker /srv/logs -R -RUN export PATH=$PATH:/mnt/bin/ \ No newline at end of file +RUN export PATH=$PATH:/mnt/bin/ diff --git a/api/views.py b/api/views.py index ca58883..fae35c7 100755 --- a/api/views.py +++ b/api/views.py @@ -217,7 +217,7 @@ class PartialMixUploadView(views.APIView): ( tasks.create_waveform_task.s(input_file, uid) | tasks.upload_to_cdn_task.subtask(('mp3', uid, 'mixes'), immutable=True) | - tasks.upload_to_cdn_task.subtask(('png', uid, 'waveforms'), immutable=True) | + tasks.upload_to_cdn_task.subtask (('png', uid, 'waveforms'), immutable=True) | tasks.notify_subscriber.subtask((session_id, uid), immutable=True) ).delay() logger.debug("Waveform task started") diff --git a/dss/celeryconf.py b/dss/celeryconf.py index 8499c10..5a1a57a 100644 --- a/dss/celeryconf.py +++ b/dss/celeryconf.py @@ -1,5 +1,3 @@ - - import os import logging diff --git a/dss/localsettings.py b/dss/localsettings.py index e14e7b0..798cb03 100644 --- a/dss/localsettings.py +++ b/dss/localsettings.py @@ -1,5 +1,8 @@ import os +<<<<<<< HEAD from dss import devsettings +======= +>>>>>>> master DEBUG = True DSS_TEMP_PATH = os.environ.get('DSS_TEMP_PATH', '/tmp/') @@ -24,7 +27,11 @@ REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost') BROKER_URL = os.environ.get('BROKER_URL', 'amqp://guest:guest@localhost:5672//') CELERY_ACCEPT_CONTENT = ['pickle', 'msgpack', 'json'] +<<<<<<< HEAD SECRET_KEY = os.environ.get('SECRET_KEY', devsettings.SECRET_KEY) +======= +SECRET_KEY = os.environ.get('SECRET_KEY', 'AAA') +>>>>>>> master LIVE_ENABLED = os.environ.get('LIVE_ENABLED', False) ICE_HOST = os.environ.get('ICE_HOST', 'localhost') diff --git a/dss/settings.py b/dss/settings.py index fd0f69a..132a2cb 100755 --- a/dss/settings.py +++ b/dss/settings.py @@ -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 @@ -206,3 +207,31 @@ 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) + + +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 """ \ No newline at end of file diff --git a/spa/management/commands/get_avatars.py b/spa/management/commands/get_avatars.py index 32d71de..e8cdf30 100755 --- a/spa/management/commands/get_avatars.py +++ b/spa/management/commands/get_avatars.py @@ -1,7 +1,7 @@ +from azure.storage.blob import BlobService import urllib.request, urllib.error, urllib.parse from allauth.socialaccount.models import SocialAccount -from azure.storage import BlobService from django.core.files.base import File from django.core.files.temp import NamedTemporaryFile from django.core.management.base import NoArgsCommand diff --git a/spa/models/mix.py b/spa/models/mix.py index 743dc3c..bde24ac 100755 --- a/spa/models/mix.py +++ b/spa/models/mix.py @@ -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,14 +153,13 @@ 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 \ - if hasattr(localsettings, - 'WAVEFORM_URL') else "%swaveforms" % settings.MEDIA_URL + waveform_root = settings.WAVEFORM_URL \ + if hasattr(settings, 'WAVEFORM_URL') else "%swaveforms" % settings.MEDIA_URL ret = "%s/%s%s.%s" % (waveform_root, self.uid, waveform_type, "png") return url.urlclean(ret)