It would be preferable if the dictionary pair were 'site': current_site instead. (This is how django-registration works.) In my current project, 'site_name' overrides a variable defined in a custom context processor, which serves the same function. We prefer to not use contrib.sites to pass the site name and domain to templates, since this requires slightly more set up and maintenance. (E.g., making sure 'example.com' gets replaced whenever the database gets wiped.)

Passing 'site': current_site instead of 'site_name': current_site.name would make contrib.auth behavior more consistent with the django-registration module as well.

Change History (9)

You can't remove the current values that are passed through, since that would break every single template that is using the existing code. There is an argument for passing in the extra object, however.