Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
fixing dev/prod settings split
  • Loading branch information
dtraviglia committed Apr 26, 2016
1 parent f0035ec commit f7b8a3b19f271621bcfee807dc5ca00715edd5c4
Showing 10 changed files with 16 additions and 11 deletions.
@@ -3,7 +3,7 @@
from django.core import mail
from django.conf import settings
from tasks import user_authorized
from xdata.settings import LOGIN_URL
from base import LOGIN_URL

from django.contrib.auth.decorators import login_required

@@ -3,7 +3,7 @@
from django.contrib.auth.decorators import login_required
from tasks import user_authorized
from django.contrib.auth.decorators import login_required
from xdata.settings import LOGIN_URL
from base import LOGIN_URL


@login_required(login_url=LOGIN_URL)
@@ -2,7 +2,7 @@
from op_tasks.models import UserProfile, Product, Dataset, OpTask, TaskListItem, Experiment
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from xdata.settings import LOGIN_URL
from base import LOGIN_URL

def user_authorized(request):
user = request.user
@@ -3,7 +3,8 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xdata.settings")
sys.path.append('./xdata/settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dev")

from django.core.management import execute_from_command_line

@@ -4,7 +4,7 @@ echo $0 $1 $2
startDir=`pwd`
lockfile=${startDir}/op_tasks/SM_LOCK
rootDIR='/home/ubuntu'
venvPath=$rootDIR/sites/testing/venv
venvPath=$rootDIR/sites/testing/virtualenv
smPath=${rootDIR}/smbitBucket/SurveyMongo
scotchPath="${rootDIR}/SCOtCH"
matDIR="${rootDIR}/smbitBucket/SurveyMongo/reports"
@@ -11,7 +11,7 @@
from django.utils import timezone
from django.db import IntegrityError
from elasticsearch import Elasticsearch
from xdata.settings import ALE_URL
from base import ALE_URL
from axes.decorators import watch_login
from surveyMongoUpdate import sm_request_update, SM_QUESTION_NAME, SM_EXPERIMENT_NAME
import achievements
@@ -12,7 +12,7 @@

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os, sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
sys.path.insert(0, os.path.join(BASE_DIR, "op_tasks"))

# Quick-start development settings - unsuitable for production
@@ -30,7 +30,7 @@

ALLOWED_HOSTS = ['*']

SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
SITE_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))

SITE_ID = 1

@@ -10,7 +10,7 @@

import os

from .base import *
from base import *

INSTALLED_APPS += (
'django_extensions',
@@ -10,7 +10,7 @@

import os

from .base import *
from base import *

INSTALLED_APPS += (
'django_extensions',
@@ -11,7 +11,11 @@
sys.path.append('/var/www/op_task/xdata')
sys.path.append('/var/www/op_task')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xdata.production")
sys.path.append('./xdata/settings')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "production")

for path in sys.path:
print path

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

0 comments on commit f7b8a3b

Please sign in to comment.