Commit f530eb7d by Gregory Martin Committed by GitHub

Merge pull request #2 from edx/debug

Delivery Worker Debug/Deploy
parents 3141cbbe 39cb599a
......@@ -8,7 +8,7 @@ install: pip install pep8
# build tests
script:
- python common/tests/test_build.py
- python video_common/tests/test_build.py
- pep8
- cd control/tests nosetests
......@@ -16,7 +16,7 @@ project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_path not in sys.path:
sys.path.append(project_path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'common.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'video_common.settings'
django.setup()
......
......@@ -118,4 +118,4 @@ def user_login(request):
if __name__ == "__main__":
course_view()
pass
"""
edx-video-pipeline's Django Secrets
NEVER SHARE ANYTHING IN HERE, like, EVER
--assume unchanged in git--
"""
import os
DJANGO_SECRET_KEY = ""
DJANGO_DB_USER = ""
DJANGO_DB_PASS = ""
DJANGO_ADMIN = ('', '')
SANDBOX_TOKEN = None
if SANDBOX_TOKEN is not None and SANDBOX_TOKEN in os.path.dirname(__file__):
DEBUG = True
DBHOST = ''
pipeline_dbname = ""
else:
DEBUG = False
DBHOST = ''
pipeline_dbname = ""
......@@ -20,8 +20,8 @@ except:
from veda_deliver import VedaDelivery
auth_yaml = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'veda_auth.yaml'
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
'instance_config.yaml'
)
with open(auth_yaml, 'r') as stream:
try:
......
......@@ -14,7 +14,7 @@ project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_path not in sys.path:
sys.path.append(project_path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'common.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'video_common.settings'
django.setup()
......
......@@ -3,7 +3,7 @@ import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "common.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "video_common.settings")
from django.core.management import execute_from_command_line
......
"""
Video Pipeline Django Secrets Shim
This acts as a django-secret shimmer until we can finish pushing all changes to terraform/prod
"""
import os
import yaml
read_yaml = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
'instance_config.yaml'
)
with open(read_yaml, 'r') as stream:
try:
return_dict = yaml.load(stream)
except yaml.YAMLError as exc:
return_dict = None
DJANGO_SECRET_KEY = return_dict['django_secret_key']
DJANGO_ADMIN = ('', '')
DEBUG = True
DATABASES = return_dict['DATABASES']
......@@ -102,10 +102,10 @@ X_FRAME_OPTIONS = 'DENY'
SECURE_SSL_REDIRECT = False
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
ROOT_URLCONF = 'common.urls'
ROOT_URLCONF = 'video_common.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'common.wsgi.application'
WSGI_APPLICATION = 'video_common.wsgi.application'
REST_FRAMEWORK = {
......
......@@ -5,13 +5,14 @@ sys.path.append(os.path.abspath(__file__))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.conf import settings
from rest_framework.routers import DefaultRouter
from rest_framework import routers
# from rest_framework.routers import DefaultRouter
from django.conf.urls import patterns, include, url
from django.contrib import admin
from VEDA_OS01 import views
router = DefaultRouter()
router = routers.DefaultRouter()
admin.autodiscover()
router.register(r'courses', views.CourseViewSet)
......
......@@ -5,5 +5,5 @@ from django.core.wsgi import get_wsgi_application
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.environ.setdefault("PYTHON_EGG_CACHE", BASE_DIR + "/egg_cache")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "common.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "video_common.settings")
application = get_wsgi_application()
......@@ -20,7 +20,7 @@ project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_path not in sys.path:
sys.path.append(project_path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'common.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'video_common.settings'
django.setup()
......
......@@ -21,7 +21,7 @@ from django.utils.timezone import utc
project_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_path not in sys.path:
sys.path.append(project_path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'common.settings'
os.environ['DJANGO_SETTINGS_MODULE'] = 'video_common.settings'
django.setup()
from VEDA_OS01.models import Video, Encode, URL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment