So I'm modding Django Admin, like heavy.
It's fun. I really love the platform. You can bust out a dashboard, like lightning fast.
Anyways, enough chit-chat.
Let's say you're editing the change_form.html
template. (you know, the one that lets you change an instance of a model), and you want to know what context variables get passed to that template.
If you're like me, you head over to Django's Github repo and grab the contents of the default change_form.html
.
Then, you want to know what context gets passed down to the template. Here's what you do:
- Find a variable in the template. I just spotted
is_popup
. - Use Github's search bar to find instances of
is_popup
in the Django repo: - Notice that the first result has the word
context
kicking around.. probably a good bet. - Click through to the result, and you'll see the full context for the view getting built
βοΈ that's it for now, hope this tip will help you!
I can be found on Twitter @connorbode or at matix.io, where I write code.
Come say hi π!
Top comments (0)