This commit is contained in:
Shupeyko Nikita 2017-04-24 17:50:44 +00:00 committed by GitHub
commit 99c214c954
7 changed files with 29 additions and 1 deletions

View File

@ -9,6 +9,7 @@
"timezone": "UTC",
"use_whitenoise": "y",
"use_celery": "n",
"use_domain_driven_design": "n",
"use_mailhog": "n",
"use_sentry_for_error_reporting": "y",
"use_opbeat": "n",

View File

@ -201,6 +201,15 @@ def remove_elasticbeanstalk():
PROJECT_DIRECTORY, filename
))
def remove_domain_app(project_directory):
"""Removes the domain app if Domain-Driven Design (DDD) isn't going to be used."""
# Determine the local_setting_file_location
domain_app_location = os.path.join(
PROJECT_DIRECTORY,
'{{ cookiecutter.project_slug }}/domain'
)
shutil.rmtree(domain_app_location)
# IN PROGRESS
# def copy_doc_files(project_directory):
# cookiecutters_dir = DEFAULT_CONFIG['cookiecutters_dir']
@ -283,3 +292,7 @@ if '{{ cookiecutter.open_source_license}}' != 'GPLv3':
# 12. Remove Elastic Beanstalk files
if '{{ cookiecutter.use_elasticbeanstalk_experimental }}'.lower() != 'y':
remove_elasticbeanstalk()
# 13. Removes the domain app if Domain-Driven Design (DDD) isn't going to be used.
if '{{ cookiecutter.use_domain_driven_design }}'.lower() == 'n':
remove_domain_app(PROJECT_DIRECTORY)

View File

@ -54,7 +54,8 @@ THIRD_PARTY_APPS = [
# Apps specific for this project go here.
LOCAL_APPS = [
# custom users app
'{{ cookiecutter.project_slug }}.users.apps.UsersConfig',
'{{ cookiecutter.project_slug }}.users.apps.UsersConfig',{% if cookiecutter.use_domain_driven_design == 'y' %}
'{{ cookiecutter.project_slug }}.domain.apps.DomainConfig',{% endif %}
# Your stuff: custom apps go here
]

View File

@ -0,0 +1,13 @@
from django.apps import AppConfig
class DomainConfig(AppConfig):
name = '{{cookiecutter.project_slug}}.domain'
verbose_name = "Domain"
def ready(self):
"""Override this to put in:
Users system checks
Users signal registration
"""
pass