-
Notifications
You must be signed in to change notification settings - Fork 191
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
Undefined template variables make page look different than default Django login page #62
Comments
@dmpayton ping? |
@Sveder Pong. :) Thanks for the report. I'm in the middle of updating this app for modern Django, and I'll take a look at this soon. |
There's a couple of ways you might do it:
or use
Hard-coding the values is the safest because it'd avoid using/leaking any customisations to the current adminsite instance, but would leave you at the mercy of discrepancies between Django versions where those might change. In which case, you might want to instead use (I noticed this independently after you reminded me this app exists, in combination with a package of my own for errors on missing variables) |
This sounds like a reasonable way to go. |
Any ideas when this will get done? Are we all waiting for a PR or what? It's been months since there has been any discussion on this. Seems like it'll never get done at this rate. |
Does this still need fixed? I might try my hand at it and the fix works, submit a PR. |
Hey all, I've been under a work deadline and haven't had a chance to revisit this, and likely won't for another week or so. I'd happily accept a PR that fixes this per #62 (comment). Any takers? |
@dmpayton @9mido I created a PR with the idea of @kezabelle. |
@GitRon is a hero! Thank you! |
@9mido would you leave me a note when the new version is at pypi? |
…late-var' into develop
Hi, I have forked this project, included a few PRs (including @GitRon's fix for this), and released a package to PyPI. You might have better luck with my fork. |
A fix for this has been pushed to develop – it uses |
We've recently started logging missing template variables (similar to: https://docs.djangoproject.com/en/3.0/ref/templates/api/#how-invalid-variables-are-handled). In this process we noticed that the honeypot login page is complaining about three undefined variables:
Looking at the page visually, it also looked different than the actual Django login page - the title was missing from the honeypot page. After looking at django-admin-honeypot code and tinkering, I think the discrepancy is in views.py - specifically, if I add site_title to the context returned by
get_context_data
, it solves the issue.My guess is that Django templates became more and more customizable, the context wasn't updated and so now there is this discrepancy. I wanted to make sure that my understanding of this is correct before submitting a PR.
@dmpayton what do you think? Does it make sense?
(and of course, thanks for the great library!)
The text was updated successfully, but these errors were encountered: