#16373: Django admin templates trigger a DeprecationWarning -------------------------------------+------------------------------------- Reporter: slinkp | Owner: nobody Type: | Status: closed Cleanup/optimization | Version: 1.3 Component: contrib.admin | Resolution: invalid Severity: Normal | Triage Stage: Keywords: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 1 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by carljm):
* status: reopened => closed * resolution: => invalid Comment: Replying to [comment:3 anonymous]: > The documentation on the aforementioned documentation page states: > > "If you don’t want to use messages, you can remove the MessageMiddleware line from MIDDLEWARE_CLASSES, the messages context processor from TEMPLATE_CONTEXT_PROCESSORS and 'django.contrib.messages' from your INSTALLED_APPS." > > However, if MessageMiddleware is removed from the settings file then you get "/usr/local/lib/python2.6/dist- packages/django/contrib/auth/models.py:393: DeprecationWarning: The user messaging API is deprecated. Please update your code to use the new messages framework. category=DeprecationWarning)" message. The documentation needs to be amended to only say: > > "If you don’t want to use messages, you can remove the messages context processor from TEMPLATE_CONTEXT_PROCESSORS and 'django.contrib.messages' from your INSTALLED_APPS." This amendment would only be correct if one assumes that `contrib.admin` is a required part of Django. It is not, therefore the current sentence listing all three pieces of `contrib.messages` as remove-able is correct. The [https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overview admin docs] already make clear its dependency on `contrib.messages` and the messages middleware. If there are other related bits of documentation that could be improved here (for instance, mentioning the admin dependency in this part of the messages docs, which I could see as useful), please open that as a separate ticket for clarity. -- Ticket URL: <https://code.djangoproject.com/ticket/16373#comment:4> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.