mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-03 11:40:23 +03:00
Merge be5d237569
into 06e484c7fb
This commit is contained in:
commit
7f0aaaeac6
|
@ -32,5 +32,7 @@ django-autoslug==1.7.2
|
||||||
# Useful things
|
# Useful things
|
||||||
django-avatar==2.0
|
django-avatar==2.0
|
||||||
|
|
||||||
|
# Time zones support
|
||||||
|
pytz==2014.7
|
||||||
|
|
||||||
# Your custom requirements go here
|
# Your custom requirements go here
|
||||||
|
|
|
@ -1,5 +1,21 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
import os
|
||||||
|
|
||||||
from .local import Local # noqa
|
from .local import Local # noqa
|
||||||
from .production import Production # 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
|
||||||
|
|
|
@ -112,7 +112,7 @@ class Common(Configuration):
|
||||||
|
|
||||||
# DATABASE CONFIGURATION
|
# DATABASE CONFIGURATION
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
# 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
|
# END DATABASE CONFIGURATION
|
||||||
|
|
||||||
# CACHING
|
# CACHING
|
||||||
|
|
Loading…
Reference in New Issue
Block a user