Written by Adrian Holovaty on June 3, 2013

We've intentionally never put anything in Django that identifies the framework. There are no custom X-Generated-By headers, no hard-coded "Powered by Django" default templates -- no reliable way for a user of a site to know whether that site uses Django behind the scenes.

Back in the day, Django's session cookie was called "hotclub" by default (a reference to the name of Django Reinhardt's band, the Quintette du Hot Club de France), and checking for a presence of that cookie was a reasonable way of seeing whether a site used Django. But we changed the default on that back in 2005 because "hotclub" had been misinterpreted by some people as having some sort of porn-site meaning. :-)

I've always considered this anonymity a sign of a good framework -- Django stays out of the way and doesn't insert cruft -- but in some cases, I really want to know whether a site uses Django! In those cases, my usual plan is to go to /admin/ and see whether I get the classic Django admin login screen.

This isn't a perfect technique, because there's no guarantee that the site (a) uses the Django admin or (b) hooks it to /admin/ as opposed to some other URL. But it's pretty decent.

And that brings me to revealing an easter egg I've put in various sites over the years: the /admin/ redirect. I'm proud of the framework and want people to know that my sites use it, but I haven't used the Django admin on a site since working for washingtonpost.com back in 2007! So I implement /admin/ in my sites -- but only as a redirect...to the Django admin documentation. :-)

Hit holovaty.com/admin or soundslice.com/admin to see what I mean.

If you're looking for a way to send a wink to your fellow Django developers, here's how you can do it in your own urls.py:

from django.views.generic import RedirectView from django.conf.urls import patterns, url ADMIN_URL = 'https://docs.djangoproject.com/en/dev/ref/contrib/admin/' urlpatterns = patterns('', # ... ('^admin/$', RedirectView.as_view(url=ADMIN_URL)), )

If you do actually use the Django admin, just hook it to a separate URL. This gives you a tiny little benefit of security-by-obscurity.

Happy easter egging!