-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix "make run" without debug mode #458
Conversation
When running "make run" in non-debug mode, collectstatic needs to be run, otherwise we will see errors like this one: ValueError: Missing staticfiles manifest entry for "vue.global.prod.js"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 41 in a2b6412
DEBUG = env.bool("DEBUG", default=False) |
Just a confirmation, but if we assume a django only developer that wrote DEBUG=1
into their ./.env
file then this would not have any effect, only if a user runs export DEBUG=1
(or similar) into their shell. Is this something we're worried about confusing the user with ? I'm not aware of there being a simple way to have make
pick up a .env
file for this edge case.
Lines 163 to 170 in a2b6412
try: | |
# If whitenoise is not available, we will remove it from our middleware | |
import whitenoise.middleware # NOQA | |
except ImportError: | |
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage" | |
MIDDLEWARE.remove("whitenoise.middleware.WhiteNoiseMiddleware") | |
else: | |
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage" |
Alternatively is there some setting we could be using here that would avoid the need for collectstatic when running with dev ?
If you have If you don't have So, if you want to run the production server using
There must have been some misunderstanding here. If there was a misunderstanding caused by the lack of detail (or a poorly written) commit message, let me know and I will try to improve it. |
@@ -114,6 +114,9 @@ migrate: $(APP_BIN) | |||
.PHONY: run | |||
## Django: Run development server | |||
run: migrate | |||
ifneq ($(DEBUG),1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I misread ifneq
as if
😅
No description provided.