sentier-dev / dds_registration

Django app for event registration and billing
MIT License
0 stars 1 forks source link

Bug: Confusing development settings #66

Closed cmutel closed 6 months ago

cmutel commented 7 months ago

@lilliputten Why do we need DEV, LOCAL, and DEBUG? Can't we just use one of these?

lilliputten commented 7 months ago

DEBUG is for django internal debugging features like showing full tracebacks in the browser. LOCAL is to enable (or notify about it) the local dev server (to use 'http' url prefix instead of 'https' when we can't get it from the request object, or to enable assets preprocessing using django filters). DEV is for our (my, probably) own debugging options. Sometimes they could be used separately.

lilliputten commented 7 months ago

I see your changes in PR #67 and for me: (1) those things were supposed to work differently, (2) it became a bit more complex than was before.

cmutel commented 7 months ago

We never allow DEBUG or LOCAL on production, so these can be the same. We are either doing development or not. I guess DEV is different?

cmutel commented 7 months ago

USE_DJANGO_PREPROCESSORS = DEV - Do we actually need DEV then? Can't we test for USE_DJANGO_PREPROCESSORS?

lilliputten commented 7 months ago

DEV should be turned off in production too (normally). But sometimes (in complex cases) it'd be useful to switch some of them in the 'on' state. But, 'course, it's not essential: probably we won't face such cases at all (I hope that).

lilliputten commented 7 months ago

USE_DJANGO_PREPROCESSORS = DEV - Do we actually need DEV then? Can't we test for USE_DJANGO_PREPROCESSORS?

It is useful to keep this parameter independent from DEV and/or DEBUG (they have different purposes): you probably don't want to switch on preprocessor mode on when you trying to trace a bug in the code.

cmutel commented 7 months ago

It is useful to keep this parameter independent from DEV and/or DEBUG

But it wasn't independent in the codebase? It was aliased directly to LOCAL. There were exactly the same thing. And if you run into a bug, it's the same time to change the settings.py file as it is you .env file (or whatever).

lilliputten commented 6 months ago

Is that finished?