datamade / how-to

📚 Doing all sorts of things, the DataMade way
MIT License
80 stars 12 forks source link

Fix Debug mode issue in Django Cookiecutter #283

Closed antidipyramid closed 11 months ago

antidipyramid commented 1 year ago

django-compressor

While working on the Workplace D+I app, @derekeder found that that setting DEBUG=False in Django's settings caused a django-compressor error.

SSL

Because we enforce SSL in production apps: https://github.com/datamade/how-to/blob/14668f98fd847d16b90cc7d9e8f2296a24bfa78a/docker/templates/new-django-app/%7B%7Bcookiecutter.app_name%7D%7D/%7B%7Bcookiecutter.module_name%7D%7D/settings.py#L172-L175

we also ran into a problem with Django's test Client. Django always runs tests in a production environment but pytest-django's stock Client doesn't use SSL.

This StackOverflow question details the problem and outlines some solutions.

smcalilly commented 1 year ago

This will be obsolete once we switch to webpack. We'll leave this open for now in case any existing projects run into this.