Clean up config

This commit is contained in:
Matthew Ryan Dillon 2016-06-08 11:14:04 -07:00
parent 39a46fe9e9
commit fd5927c31a
4 changed files with 44 additions and 14 deletions

View file

@ -1,8 +1,6 @@
"""
Django settings for CCDB
"""
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
import environ
@ -38,7 +36,7 @@ THIRD_PARTY_APPS = (
# Apps specific for this project go here.
LOCAL_APPS = (
'ccdb.utils',
'ccdb.users', # custom users app
'ccdb.users',
'ccdb.projects',
'ccdb.misc',
'ccdb.locations',
@ -238,4 +236,19 @@ AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
ADMIN_URL = r'^admin/'
GRAPPELLI_ADMIN_TITLE = 'CCDB'
# Your common stuff: Below this line define 3rd party library settings
MANIFEST_URL = env('MANIFEST_URL', default=None)
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': [
'rest_framework.permissions.IsAuthenticated',
],
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.TokenAuthentication',
'rest_framework.authentication.SessionAuthentication',
],
'DEFAULT_VERSIONING_CLASS': 'rest_framework.versioning.NamespaceVersioning',
'DEFAULT_PAGINATION_CLASS': 'hibernators.api.pagination.CustomPageNumberPagination',
'PAGE_SIZE': 100,
}

View file

@ -6,8 +6,17 @@ Local settings
- Add Django Debug Toolbar
'''
import warnings
from .base import * # noqa
with warnings.catch_warnings(record=True) as warning:
environ.Env.read_env('.env')
for w in warning:
print(w.message)
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
@ -45,4 +54,9 @@ DEBUG_TOOLBAR_CONFIG = {
# ------------------------------------------------------------------------------
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
# Your local stuff: Below this line define 3rd party library settings
DJOSER = {
'SITE_NAME': 'CCDB (test)',
'DOMAIN': 'localhost:4200',
'PASSWORD_RESET_CONFIRM_URL': 'password-reset?uid={uid}&token={token}',
}

View file

@ -5,14 +5,13 @@ Production Configurations
- Use mailgun to send emails
'''
from __future__ import absolute_import, unicode_literals
from boto.s3.connection import OrdinaryCallingFormat
from django.utils import six
from .base import * # noqa
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
@ -169,4 +168,11 @@ LOGGING = {
# Custom Admin URL, use {% url 'admin:index' %}
ADMIN_URL = env('DJANGO_ADMIN_URL')
# Your production stuff: Below this line define 3rd party library settings
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = env.tuple('CORS_ORIGIN_WHITELIST', None)
DJOSER = {
'SITE_NAME': 'CCDB',
'DOMAIN': 'https://ccdb.info',
'PASSWORD_RESET_CONFIRM_URL': 'https://ccdb.info/password-reset?uid={uid}&token={token}',
}

View file

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
@ -13,7 +10,7 @@ urlpatterns = [
url(r'^about/$', TemplateView.as_view(template_name='pages/about.html'), name="about"),
# Django Admin, use {% url 'admin:index' %}
url(r'^grappelli/', include('grappelli.urls')), # grappelli URLS
url(r'^grappelli/', include('grappelli.urls')),
url(settings.ADMIN_URL, include(admin.site.urls)),
# User management