<gh_stars>100-1000
from .settings_common import *

import os

DEBUG = True

#
# HOSTS
#
HOST = 'perma.test:8000'
PLAYBACK_HOST = 'perma-archives.test:8092'
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['perma.test', 'api.perma.test']

# logging
LOGGING_DIR = os.path.join(SERVICES_DIR, 'logs')
LOGGING['handlers']['file']['filename'] = os.path.join(LOGGING_DIR, 'django.log')

# user-generated files
MEDIA_ROOT = os.path.join(SERVICES_DIR, 'django/generated_assets/')

# static files
STATIC_ROOT = os.path.join(SERVICES_DIR, 'django/static_assets/')

# print email to console
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'secret'

# Google Analytics
GOOGLE_ANALYTICS_KEY = '<KEY>'
GOOGLE_ANALYTICS_DOMAIN = 'example.com'

CELERY_RESULT_BACKEND = None

### optional dev packages ###

# django-debug-toolbar
if os.environ.get('DEBUG_TOOLBAR'):
    import debug_toolbar  # noqa
    INSTALLED_APPS += (
        'debug_toolbar',
    )
    DEBUG_TOOLBAR_CONFIG = {
        'SHOW_TOOLBAR_CALLBACK': 'perma.utils.show_debug_toolbar'  # we have to override this check because the default depends on IP address, which doesn't work inside Vagrant
    }
    MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE

# django_extensions
try:
    import django_extensions  # noqa
    INSTALLED_APPS += (
        # Switch to this when we upgrade to Django 1.7.x:
        #'debug_toolbar.apps.DebugToolbarConfig',
        'django_extensions',
    )
except ImportError:
    pass


# Our Sorl thumbnail stuff. In prod we use Redis, we'll just use
# the local uncached DB here in dev.
THUMBNAIL_KVSTORE = 'sorl.thumbnail.kvstores.cached_db_kvstore.KVStore'


#
# Perma Payments
#
PURCHASE_URL = 'http://localhost/purchase/'
PURCHASE_HISTORY_URL = 'http://perma-payments/purchase-history/'
ACKNOWLEDGE_PURCHASE_URL = 'http://perma-payments/acknowledge-purchase/'
SUBSCRIBE_URL = 'http://localhost/subscribe/'
CANCEL_URL = 'http://localhost/cancel-request/'
SUBSCRIPTION_STATUS_URL = 'http://perma-payments/subscription/'
UPDATE_URL = 'http://localhost/update/'
CHANGE_URL = 'http://localhost/change/'

# Perma.cc encryption keys for communicating with Perma-Payments
# generated using perma_payments.security.generate_public_private_keys
# SECURITY WARNING: keep the production secret key secret!
# These keys are just for local development, and are safe to commit to the repo
PERMA_PAYMENTS_ENCRYPTION_KEYS = {
    'id': 1,
    'perma_secret_key': "<KEY>
    'perma_public_key': <KEY>
    'perma_payments_public_key': "<KEY>
}


# Upload scanning
SCAN_UPLOADS = True
SCAN_URL = 'http://filecheck:8888/scan/'


from .settings_common import *

import os

DEBUG = True

#
# HOSTS
#
HOST = 'perma.test:8000'
PLAYBACK_HOST = 'perma-archives.test:8092'
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['perma.test', 'api.perma.test']

# logging
LOGGING_DIR = os.path.join(SERVICES_DIR, 'logs')
LOGGING['handlers']['file']['filename'] = os.path.join(LOGGING_DIR, 'django.log')

# user-generated files
MEDIA_ROOT = os.path.join(SERVICES_DIR, 'django/generated_assets/')

# static files
STATIC_ROOT = os.path.join(SERVICES_DIR, 'django/static_assets/')

# print email to console
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'secret'

# Google Analytics
GOOGLE_ANALYTICS_KEY = '<KEY>'
GOOGLE_ANALYTICS_DOMAIN = 'example.com'

CELERY_RESULT_BACKEND = None

### optional dev packages ###

# django-debug-toolbar
if os.environ.get('DEBUG_TOOLBAR'):
    import debug_toolbar  # noqa
    INSTALLED_APPS += (
        'debug_toolbar',
    )
    DEBUG_TOOLBAR_CONFIG = {
        'SHOW_TOOLBAR_CALLBACK': 'perma.utils.show_debug_toolbar'  # we have to override this check because the default depends on IP address, which doesn't work inside Vagrant
    }
    MIDDLEWARE = ('debug_toolbar.middleware.DebugToolbarMiddleware',) + MIDDLEWARE

# django_extensions
try:
    import django_extensions  # noqa
    INSTALLED_APPS += (
        # Switch to this when we upgrade to Django 1.7.x:
        #'debug_toolbar.apps.DebugToolbarConfig',
        'django_extensions',
    )
except ImportError:
    pass


# Our Sorl thumbnail stuff. In prod we use Redis, we'll just use
# the local uncached DB here in dev.
THUMBNAIL_KVSTORE = 'sorl.thumbnail.kvstores.cached_db_kvstore.KVStore'


#
# Perma Payments
#
PURCHASE_URL = 'http://localhost/purchase/'
PURCHASE_HISTORY_URL = 'http://perma-payments/purchase-history/'
ACKNOWLEDGE_PURCHASE_URL = 'http://perma-payments/acknowledge-purchase/'
SUBSCRIBE_URL = 'http://localhost/subscribe/'
CANCEL_URL = 'http://localhost/cancel-request/'
SUBSCRIPTION_STATUS_URL = 'http://perma-payments/subscription/'
UPDATE_URL = 'http://localhost/update/'
CHANGE_URL = 'http://localhost/change/'

# Perma.cc encryption keys for communicating with Perma-Payments
# generated using perma_payments.security.generate_public_private_keys
# SECURITY WARNING: keep the production secret key secret!
# These keys are just for local development, and are safe to commit to the repo
PERMA_PAYMENTS_ENCRYPTION_KEYS = {
    'id': 1,
    'perma_secret_key': "<KEY>
    'perma_public_key': <KEY>
    'perma_payments_public_key': "<KEY>
}


# Upload scanning
SCAN_UPLOADS = True
SCAN_URL = 'http://filecheck:8888/scan/'
# # HOSTS # # Hosts/domain names that are valid for this site; required if DEBUG is False # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts # logging # user-generated files # static files # print email to console # Make this unique, and don't share it with anybody. # Google Analytics ### optional dev packages ### # django-debug-toolbar # noqa # we have to override this check because the default depends on IP address, which doesn't work inside Vagrant # django_extensions # noqa # Switch to this when we upgrade to Django 1.7.x: #'debug_toolbar.apps.DebugToolbarConfig', # Our Sorl thumbnail stuff. In prod we use Redis, we'll just use # the local uncached DB here in dev. # # Perma Payments # # Perma.cc encryption keys for communicating with Perma-Payments # generated using perma_payments.security.generate_public_private_keys # SECURITY WARNING: keep the production secret key secret! # These keys are just for local development, and are safe to commit to the repo # Upload scanning