dev.py 1.42 KB
Newer Older
1 2 3 4 5 6 7 8 9
"""
Development settings for patchwork project.

These are also used in unit tests.

Design based on:
    http://www.revsys.com/blog/2014/nov/21/recommended-django-project-layout/
"""

10
from __future__ import absolute_import
11
from .base import *  # noqa
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

#
# Core settings
# https://docs.djangoproject.com/en/1.6/ref/settings/#core-settings
#

# Security

SECRET_KEY = '00000000000000000000000000000000000000000000000000'

# Debugging

DEBUG = True

# Database

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
Arkadiusz Hiler's avatar
Arkadiusz Hiler committed
31
        'HOST': os.getenv('PW_TEST_DB_HOST', 'localhost'),
32
        'PORT': '',
33 34 35
        'USER': os.getenv('PW_TEST_DB_USER', 'patchwork'),
        'PASSWORD': os.getenv('PW_TEST_DB_PASS', 'password'),
        'NAME': os.getenv('PW_TEST_DB_NAME', 'patchwork'),
36 37 38
    },
}

39
if os.getenv('PW_TEST_DB_TYPE', None) == 'postgres':
40 41
    DATABASES['default']['ENGINE'] = 'django.db.backends.postgresql_psycopg2'

42 43 44
DATABASES['default']['TEST'] = {
    'CHARSET': 'utf8',
}
45

46 47 48 49
# Email

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

50 51 52 53 54
#
# Third-party application settings
#

# django-debug-toolbar
55 56 57
INSTALLED_APPS += [
    'debug_toolbar'
]
58

59
DEBUG_TOOLBAR_PATCH_SETTINGS = False
60

61 62 63 64
# This should go first in the middleware classes
MIDDLEWARE_CLASSES = [
    'debug_toolbar.middleware.DebugToolbarMiddleware',
] + MIDDLEWARE_CLASSES
65

66
INTERNAL_IPS = ['127.0.0.1', '::1']
67 68


69 70 71 72 73
#
# Patchwork settings
#

ENABLE_XMLRPC = True