Skip to content

Commit

Permalink
fix: drf missing static assets
Browse files Browse the repository at this point in the history
Fix missing django rest framework  static assets references resulting in errors while running the `collectstatic` management command.
  • Loading branch information
kennedykori committed Aug 14, 2022
1 parent ca13de8 commit b1ea51c
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 1 deletion.
11 changes: 11 additions & 0 deletions assets/static/css/bootstrap-bootswatch-themes/darkly-theme.min.css

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions assets/static/css/bootstrap-bootswatch-themes/flatly-theme.min.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions assets/static/css/bootstrap-bootswatch-themes/slate-theme.min.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions assets/static/css/bootstrap-bootswatch-themes/yeti-theme.min.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions assets/templates/rest_framework/api.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--Customize DRF Browsable API -->
{% extends "rest_framework/base.html" %}
{% load static i18n compress %}

{% block bootstrap_theme %}
{% compress css %}
<link rel="stylesheet" href="{% static 'css/bootstrap-bootswatch-themes/yeti-theme.min.css' %}" type="text/css">
{% endcompress %}
{% endblock %}
2 changes: 2 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@
]
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"

WHITENOISE_MANIFEST_STRICT = False


###############################################################################
# AUTH AND PASSWORDS
Expand Down
2 changes: 1 addition & 1 deletion config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

DEFAULT_FILE_STORAGE = "utils.storages.MediaRootGoogleCloudStorage"
MEDIA_URL = "https://storage.googleapis.com/%s/media/" % GS_BUCKET_NAME
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"


###############################################################################
Expand Down

0 comments on commit b1ea51c

Please sign in to comment.