mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-18 19:04:51 +03:00
edit post andpre hooks
This commit is contained in:
parent
93de826856
commit
b40d25eff1
|
@ -381,10 +381,16 @@ def main():
|
|||
if "{{ cookiecutter.use_docker }}".lower() == "y":
|
||||
remove_node_dockerfile()
|
||||
|
||||
if "{{ cookiecutter.cloud_provider}}".lower() == "none":
|
||||
if (
|
||||
"{{ cookiecutter.cloud_provider}}".lower() == "none"
|
||||
) and (
|
||||
"{{ cookiecutter.use_nginx_for_serve_media_files}}".lower() == "n"
|
||||
):
|
||||
print(
|
||||
WARNING + "You chose not to use a cloud provider, "
|
||||
"media files won't be served in production." + TERMINATOR
|
||||
"media files won't be served in production. "
|
||||
"Choose 'use_nginx_for_serve_media_files'=='y' "
|
||||
"if you want serve media files with local docker nginx instance." + TERMINATOR
|
||||
)
|
||||
remove_storages_module()
|
||||
|
||||
|
|
|
@ -31,6 +31,12 @@ assert (
|
|||
), "Don't include backslashes in author name."
|
||||
|
||||
if "{{ cookiecutter.use_docker }}".lower() == "n":
|
||||
if "{{ cookiecutter.use_nginx_for_serve_media_files }}" == "y":
|
||||
print(
|
||||
"You should either use docker or select a Cloud Provider to serve media files"
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
python_major_version = sys.version_info[0]
|
||||
if python_major_version == 2:
|
||||
print(
|
||||
|
@ -69,6 +75,15 @@ if (
|
|||
)
|
||||
sys.exit(1)
|
||||
|
||||
if (
|
||||
"{{ cookiecutter.cloud_provider }}" != "None"
|
||||
and "{{ cookiecutter.use_nginx_for_serve_media_files }}".lower() == "y"
|
||||
):
|
||||
print(
|
||||
"You should either use AWS, GCP or local docker nginx instance for serve media files."
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
if (
|
||||
"{{ cookiecutter.cloud_provider }}" == "GCP"
|
||||
and "{{ cookiecutter.mail_service }}" == "Amazon SES"
|
||||
|
|
Loading…
Reference in New Issue
Block a user