Comments (4)
This has been resolved in f706a63.
It was due to Django 4.1+ caching templates by default even with DEBUG = True
set.
Thanks @jefftriplett for pointing me to the changelog at https://docs.djangoproject.com/en/dev/releases/4.1/#templates when I tweeted this out https://twitter.com/nickjanetakis/status/1626938661500604417.
At least now I know I'm not crazy because these templates did reload in the past.
If anyone has a better implementation than what I did in that commit please open a PR.
from docker-django-example.
Hey @nickjj 👋
I'm assuming you've already played with the compose options
tty
and
std-in
For attaching stdin (similar to when forcing a tty on ssh connections)
Sorry I've not dug deep but wanted to throw those out there incase you've not turned that stone
from docker-django-example.
Hi @chrisjsimpson,
Thanks, tty: true
is set and stdin_open: true
has no effect (it's not in my compose file but I did try it just now).
At some point in the past all of this worked in this app. My Flask, Rails, Node and Phoenix examples all work with HTML template, code and asset changes using the same Docker settings across the board too.
One step I should take is to start checking out older versions of this code and identify the last known good state. I'll probably start by looking for commits that change the versions of gunicorn and django.
from docker-django-example.
So this is fun, I was able to determine why it was so inconsistent and how it sort of worked before the patch.
Before this patch if you edited any HTML template it would not get updated. However if you edited a Python file such as the settings file after editing the HTML then the HTML would update. While testing things initially I reduced variables by hard coding DEBUG = True
but that action caused a Python file update, the code itself wasn't important. That's how I arrived at inconsistent behavior. In the end this likely means Django will reload cached templates if Python files are updated.
from docker-django-example.
Related Issues (20)
- New project name psql role doesn't exist HOT 5
- ERROR: Service 'css' failed to build : COPY failed: forbidden path outside the build context: HOT 4
- Celery worker crashes HOT 2
- adding separate frontend spa (react/vue/etc) HOT 5
- Service 'worker' failed to build : Build failed HOT 2
- tailwindcss --watch is not detecting changes HOT 8
- Update README.md about need to "chown 1000 ./public*" HOT 5
- Double public and public_collected directories HOT 6
- freeze no longer used. HOT 1
- unbound variable HOT 13
- Running as root? HOT 3
- HTML templates reloading issue (TailwindCSS) HOT 31
- IPDB debugging HOT 4
- docker compose build : Unable to locate package build-essential HOT 3
- update docker compose sub commands HOT 4
- Getting Server Error (500) on debug=false on env file HOT 3
- Updating dependencies during development HOT 2
- Any interest in adding Sentry and/or Mailhog services? HOT 4
- [Error: EACCES: permission denied, mkdir '/app/public/css'] HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-django-example.