Closed snackattas closed 11 months ago
render and redirect return HttpResponses, so it’s not that. (I would never recommend using a chatbot for questions! they only regurgitate scraped and agglomerated text)
Can you say more about your usage of whitenoise «with» these views? whitenoise is meant to serve static files, so I do not understand the setup you are describing.
you are right, the issue was mine, the templates were not being found by render. Then i put in some other code and it worked. all my bad
Python Version
3.10.12
Django Version
latest
Package Version
latest
Description
I went down a huge rabbithole just now, took me a day to figure out.
I was trying to use Django, gunicorn, and whitenoise.
My original views were using django shortcuts
render
andredirect
. I think, whitenoise does not play well with those shortcuts? After lots of googling, and using chatGPT, it dawned on me thatrender
andredirect
use django's low level template engine, and maybe that doesn't play nice with whitenoise?Once i recoded to use
render_to_string
and return a HttpResponse object in my views, things were working. Am I right in these statements I'm making? If so, might be nice to add something to the FAQ about this