This commit is contained in:
Bernd Meyer 2014-10-03 20:46:16 +00:00
commit 7f0aaaeac6
3 changed files with 19 additions and 1 deletions

View File

@ -32,5 +32,7 @@ django-autoslug==1.7.2
# Useful things
django-avatar==2.0
# Time zones support
pytz==2014.7
# Your custom requirements go here

View File

@ -1,5 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from .local import Local # noqa
from .production import Production # noqa
try:
from django.conf import settings
from django.core.checks import register, Error
@register(settings)
def dj_database_url_check(app_configs=None, **kwargs):
errors = []
password = settings.DATABASES['default'].get('PASSWORD')
config = os.environ['DJANGO_CONFIGURATION'].lower()
if password == 'blank' and config == 'production':
errors.append(Error('Change the database password for production.'))
return errors
except ImportError:
pass

View File

@ -112,7 +112,7 @@ class Common(Configuration):
# DATABASE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = values.DatabaseURLValue('postgres://localhost/{{cookiecutter.repo_name}}')
DATABASES = values.DatabaseURLValue('postgres://localhost/django:blank@{{cookiecutter.repo_name}}')
# END DATABASE CONFIGURATION
# CACHING