On Sun, Dec 9, 2012 at 8:44 AM, Andreas Pritschet < [email protected]> wrote:
> Hi there, > for a little project of mine I wanted to use the Message middleware, > but the documentation appears to lack some crucial information. > > The message framework is working very well on the admin site. On the > admin site also the messages generated in non-admin views are shown. > So good so far. > > But following the documentation and the base.html template of the > admin site the messages are not rendered to non-admin views. > > Are your own views rendered using a RequestContext for rendering? If not, they will not have the messages context variable referenced in the admin base.html template automatically set. (All of the admin views render using RequestContext.) The messages doc here: https://docs.djangoproject.com/en/1.4/ref/contrib/messages/#displaying-messages which shows a sample template block for rendering messages notes that you'll need to either render with a RequestContext or somehow ensure that the messages variable is available in the template context. Karen -- http://tracey.org/kmt/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

