mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-05 04:30:16 +03:00
Merge 234dc62c2a
into 9ea4ace6fb
This commit is contained in:
commit
99c214c954
|
@ -9,6 +9,7 @@
|
||||||
"timezone": "UTC",
|
"timezone": "UTC",
|
||||||
"use_whitenoise": "y",
|
"use_whitenoise": "y",
|
||||||
"use_celery": "n",
|
"use_celery": "n",
|
||||||
|
"use_domain_driven_design": "n",
|
||||||
"use_mailhog": "n",
|
"use_mailhog": "n",
|
||||||
"use_sentry_for_error_reporting": "y",
|
"use_sentry_for_error_reporting": "y",
|
||||||
"use_opbeat": "n",
|
"use_opbeat": "n",
|
||||||
|
|
|
@ -201,6 +201,15 @@ def remove_elasticbeanstalk():
|
||||||
PROJECT_DIRECTORY, filename
|
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
|
# IN PROGRESS
|
||||||
# def copy_doc_files(project_directory):
|
# def copy_doc_files(project_directory):
|
||||||
# cookiecutters_dir = DEFAULT_CONFIG['cookiecutters_dir']
|
# cookiecutters_dir = DEFAULT_CONFIG['cookiecutters_dir']
|
||||||
|
@ -283,3 +292,7 @@ if '{{ cookiecutter.open_source_license}}' != 'GPLv3':
|
||||||
# 12. Remove Elastic Beanstalk files
|
# 12. Remove Elastic Beanstalk files
|
||||||
if '{{ cookiecutter.use_elasticbeanstalk_experimental }}'.lower() != 'y':
|
if '{{ cookiecutter.use_elasticbeanstalk_experimental }}'.lower() != 'y':
|
||||||
remove_elasticbeanstalk()
|
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)
|
||||||
|
|
|
@ -54,7 +54,8 @@ THIRD_PARTY_APPS = [
|
||||||
# Apps specific for this project go here.
|
# Apps specific for this project go here.
|
||||||
LOCAL_APPS = [
|
LOCAL_APPS = [
|
||||||
# custom users app
|
# 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
|
# Your stuff: custom apps go here
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue
Block a user