Split out settings into per-env

This commit is contained in:
2011-05-27 14:27:35 +01:00
parent 89851cfad1
commit 68bb0df818
18 changed files with 63 additions and 101 deletions

View File

@@ -1,6 +0,0 @@
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "%(user)s"
BROKER_PASSWORD = "%(password)s"
BROKER_VHOST = "%(vhost)s"

76
app/settings.py → app/conf/common.py Executable file → Normal file
View File

@@ -4,7 +4,7 @@ from datetime import timedelta
# Django settings for login project. # Django settings for login project.
DEBUG = True DEBUG = False
TEMPLATE_DEBUG = DEBUG TEMPLATE_DEBUG = DEBUG
INTERNAL_IPS = ('127.0.0.1','91.121.180.45') INTERNAL_IPS = ('127.0.0.1','91.121.180.45')
@@ -14,27 +14,10 @@ ADMINS = (
MANAGERS = ADMINS MANAGERS = ADMINS
# Import db settings from dbsettings.py # Zone Settings
from conf.dbsettings import *
# Import the Broker settings
from conf.brokersettings import *
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
SITE_ID = 1 SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True USE_I18N = True
# Defines the Static Media storage as per staticfiles contrib # Defines the Static Media storage as per staticfiles contrib
@@ -43,7 +26,7 @@ STATIC_URL = '/static/'
ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'
# Make this unique, and don't share it with anybody. # Make this unique, and don't share it with anybody.
SECRET_KEY = '8i2+dd-b2tg9g%mq$&i$-8beh4i5^2mm=e-nh^$p47^w=z1igr' SECRET_KEY = ''
# List of callables that know how to import templates from various sources. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
@@ -104,67 +87,14 @@ INSTALLED_APPS = (
'tools', 'tools',
) )
## Server Mail
SERVER_EMAIL = 'trace@auth.pleaseignore.com'
# API OAuth
#OAUTH_AUTH_VIEW = 'api.views.oauth.authorize_oauth'
OAUTH_CALLBACK_VIEW = 'api.views.oauth_callback'
# Disable the service API, used for data imports
DISABLE_SERVICES = False
# Services API generates a new password for the user
GENERATE_SERVICE_PASSWORD = False
AUTHENTICATION_BACKENDS = ( AUTHENTICATION_BACKENDS = (
'sso.backends.SimpleHashModelBackend', 'sso.backends.SimpleHashModelBackend',
) )
AUTH_PROFILE_MODULE = 'sso.SSOUser' AUTH_PROFILE_MODULE = 'sso.SSOUser'
LOGIN_REDIRECT_URL = "/profile" LOGIN_REDIRECT_URL = "/profile"
LOGIN_URL = "/login" LOGIN_URL = "/login"
DEFAULT_FROM_EMAIL = "bot@auth.pleaseignore.com"
ACCOUNT_ACTIVATION_DAYS = 14
# Slice File Location
SLICE = os.path.join(os.path.dirname(os.path.abspath( __file__ )),'Murmur.ice')
### Reddit Settings
# Username to validate accounts from
REDDIT_USER = 'DredditVerification'
# Password for validatio account
REDDIT_PASSWORD = ''
### HR Settings
HR_RECOMMENDATION_DAYS = 45
FULL_API_USER_ID = 415631
FULL_API_CHARACTER_ID = 246102445
## Email Registration
BANNED_EMAIL_DOMAINS = ['att.net']
## Eve Proxy settings
EVE_PROXY_KEEP_LOGS = 30
## Director management settings
IGNORE_CORP_GROUPS = [29]
# try and import local settings
try:
from conf.settingslocal import *
except:
pass
### Celery Schedule ### Celery Schedule
CELERYBEAT_SCHEDULE = { CELERYBEAT_SCHEDULE = {

View File

@@ -1,8 +0,0 @@
DATABASES = {
'default': {
'NAME': 'dreddit_sso.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
}
}

44
app/conf/development.py Normal file
View File

@@ -0,0 +1,44 @@
from common import *
## Database
DATABASES = {
'default': {
'NAME': 'dreddit_sso.db',
'ENGINE': 'django.db.backends.sqlite3',
'USER': '',
'PASSWORD': '',
},
}
## EVE Proxy
EVE_API_URL = "http://apitest.eveonline.com"
EVE_PROXY_KEEP_LOGS = 30
## SSO
DISABLE_SERVICES = False
GENERATE_SERVICE_PASSWORD = False
IGNORE_CORP_GROUPS = [29]
## Server Mail
SERVER_EMAIL = 'trace@auth.pleaseignore.com'
DEFAULT_FROM_EMAIL = "bot@auth.pleaseignore.com"
## Registration
ACCOUNT_ACTIVATION_DAYS = 14
BANNED_EMAIL_DOMAINS = ['att.net']
## Reddit
REDDIT_USER = 'DredditVerification'
REDDIT_PASSWORD = ''
## HR
HR_RECOMMENDATION_DAYS = 45
## API
FULL_API_USER_ID = 415631
FULL_API_CHARACTER_ID = 246102445
## Django
DEBUG = True
SECRET_KEY = '8i2+dd-b2tg9g%mq$&i$-8beh4i5^2mm=e-nh^$p47^w=z1igr'

View File

@@ -5,8 +5,8 @@ import socket
from datetime import datetime, timedelta from datetime import datetime, timedelta
from xml.dom import minidom from xml.dom import minidom
from django.db import models from django.db import models
from django.conf import settings
from eve_proxy.exceptions import * from eve_proxy.exceptions import *
import settings
# You generally never want to change this unless you have a very good reason. # You generally never want to change this unless you have a very good reason.

View File

@@ -12,11 +12,11 @@ except IOError:
from django.core.management import execute_manager from django.core.management import execute_manager
try: try:
import settings # Assumed to be in the same directory. import conf.development # Assumed to be in the same directory.
except ImportError: except ImportError:
import sys import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1) sys.exit(1)
if __name__ == "__main__": if __name__ == "__main__":
execute_manager(settings) execute_manager(conf.development)

View File

@@ -1,4 +1,4 @@
import settings from django.conf import settings
from django.db import connections from django.db import connections
def get_api(api): def get_api(api):

View File

@@ -1,6 +1,6 @@
import xmlrpclib import xmlrpclib
from sso.services import BaseService from sso.services import BaseService
import settings from django.conf import settings
from hashlib import md5 from hashlib import md5
class IPBService(BaseService): class IPBService(BaseService):

View File

@@ -1,6 +1,6 @@
import xmlrpclib import xmlrpclib
from sso.services import BaseService from sso.services import BaseService
import settings from django.conf import settings
class JabberService(BaseService): class JabberService(BaseService):

View File

@@ -3,7 +3,7 @@ import random
import time import time
from django.db import transaction from django.db import transaction
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class MiningBuddyService(BaseDBService): class MiningBuddyService(BaseDBService):
""" """

View File

@@ -2,7 +2,7 @@ import hashlib
import random import random
from django.db import load_backend, transaction, IntegrityError from django.db import load_backend, transaction, IntegrityError
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class PhpBBService(BaseDBService): class PhpBBService(BaseDBService):
""" """

View File

@@ -2,7 +2,7 @@ import hashlib
import random import random
from django.db import transaction, IntegrityError from django.db import transaction, IntegrityError
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class POSTrackerService(BaseDBService): class POSTrackerService(BaseDBService):
""" """

View File

@@ -2,7 +2,7 @@ import hashlib
import random import random
from django.db import load_backend, transaction, IntegrityError from django.db import load_backend, transaction, IntegrityError
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class QMSService(BaseDBService): class QMSService(BaseDBService):
""" """

View File

@@ -1,7 +1,7 @@
import hashlib import hashlib
import random import random
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class SMFService(BaseDBService): class SMFService(BaseDBService):
""" """

View File

@@ -2,7 +2,7 @@ import hashlib
import random import random
from django.db import load_backend, transaction, IntegrityError from django.db import load_backend, transaction, IntegrityError
from sso.services import BaseDBService from sso.services import BaseDBService
import settings from django.conf import settings
class MediawikiService(BaseDBService): class MediawikiService(BaseDBService):
""" """

View File

@@ -12,7 +12,7 @@ execfile(activate_this, dict(__file__=activate_this))
import sys import sys
import logging import logging
from django.core.management import setup_environ from django.core.management import setup_environ
import settings from django.conf import settings
setup_environ(settings) setup_environ(settings)

View File

@@ -13,7 +13,7 @@ execfile(activate_this, dict(__file__=activate_this))
import sys import sys
import logging import logging
from django.core.management import setup_environ from django.core.management import setup_environ
import settings from django.conf import settings
setup_environ(settings) setup_environ(settings)

2
fabfile.py vendored
View File

@@ -137,6 +137,8 @@ def update_repo():
with cd('%(path)s/dreddit-auth/' % env): with cd('%(path)s/dreddit-auth/' % env):
run('git pull') run('git pull')
deploy_static()
def reset_repo(): def reset_repo():
""" """