Skip to content

Commit

Permalink
Fix a number of issues with Azure storage (#5476)
Browse files Browse the repository at this point in the history
  • Loading branch information
browniebroke authored Oct 21, 2024
1 parent 1b83a47 commit 6f5f1b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def remove_docker_files():
os.remove(os.path.join(".idea", "runConfigurations", file_name))


def remove_nginx_docker_files():
shutil.rmtree(os.path.join("compose", "production", "nginx"))


def remove_utility_files():
shutil.rmtree("utility")

Expand Down Expand Up @@ -457,6 +461,8 @@ def main():

if "{{ cookiecutter.use_docker }}".lower() == "y":
remove_utility_files()
if "{{ cookiecutter.cloud_provider }}".lower() != "none":
remove_nginx_docker_files()
else:
remove_docker_files()

Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.project_slug}}/config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"BACKEND": "storages.backends.azure_storage.AzureStorage",
"OPTIONS": {
"location": "media",
"file_overwrite": False,
"overwrite_files": False,
},
},
{%- if cookiecutter.use_whitenoise == 'y' %}
Expand Down Expand Up @@ -323,7 +323,7 @@
"js": ["compressor.filters.jsmin.JSMinFilter"],
}
{% endif %}
{%- if cookiecutter.use_whitenoise == 'n' -%}
{%- if cookiecutter.use_whitenoise == 'n' and cookiecutter.cloud_provider in ('AWS', 'GCP') -%}
# Collectfasta
# ------------------------------------------------------------------------------
# https://github.com/jasongi/collectfasta#installation
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/requirements/production.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

gunicorn==23.0.0 # https://github.com/benoitc/gunicorn
psycopg[c]==3.2.3 # https://github.com/psycopg/psycopg
{%- if cookiecutter.use_whitenoise == 'n' %}
{%- if cookiecutter.use_whitenoise == 'n'and cookiecutter.cloud_provider in ('AWS', 'GCP') %}
Collectfasta==3.2.0 # https://github.com/jasongi/collectfasta
{%- endif %}
{%- if cookiecutter.use_sentry == "y" %}
Expand Down

0 comments on commit 6f5f1b8

Please sign in to comment.