Skip to content

Instantly share code, notes, and snippets.

@josephmosby
Last active August 29, 2015 14:20
Show Gist options
  • Save josephmosby/00f6bd29dfa038bc39a4 to your computer and use it in GitHub Desktop.
Save josephmosby/00f6bd29dfa038bc39a4 to your computer and use it in GitHub Desktop.
Finding mysterious Django variables in templates

In a Django template file...

{% if last_updated %}Last Updated: {{ last_updated }}{% endif %}
{% endblock %}

Wait, where is last updated set?

$ grep -R "last_updated" .        	// where "." is the Django project directory

stuff
./editorial/admin.py:			last_updated = datetime.datetime.now().strftime('%B %d, %Y %I:%M %p %z')
stuff

Aha!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment