Rework Static_Root & StaticFile structure #623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes fix the
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path
as seen in #622 and #605.Static files in the
static
directory are moved towebvirtcloud/static
and framework component files (i.e.rest_framework/*
anddrf-yasg/*
) are deleted as they will be copied / linked bycollectstatic
.Also, instead of copying static files into the static directory, I think using symbolic links (--link) will be better as it uses less disk space and the
--clear
removes orphan static files which may no longer be part of a framework component or the WVC static directory.Note: When updating WVC, the below code in
webvirtcloud/settings.py
must be replaced with
The
webvirtcloud/settings.py.template
is up-to-date with the changes so a new installation will work out-of-the-box.I commented and posted additionnal explanations for these changes at #605 (comment)