Задать вопрос

Тел: +7 965 3737 888

460

Просмотров

1

Ответов

Temporary admin messages (MOTD)

<p>This small app can display messages to users after they login and before they get to the normal landing page. This can be useful for displaying maintenance notices, information on new features, or a one-day-sale on shoes.</p>
<p>To redirect to the MOTD view after login, change:</p>
<p>&lt;input type="hidden" name="next" value="{{ next }}" /&gt;</p>
<p>to:</p>
<p>&lt;input type="hidden" name="next" value="{% url django_motd.views.motd %}?next={{ next }}" /&gt;</p>
<p>in your login.html template.</p>

Вопрос полезен? Да0/Нет0
file_4225.py(2.0Кб)
None

Ответы (1):

Ответjamesgpearce:25.06.2009
Ответ полезен? Да0/Нет0

Useful, but a bit tricky to wireup:

1) mention you need to add it to your urls.py

2) the {% url %} parameter needs to match your own module name

3) the messages.html template needs to be created (or just use that instead of base.html)

4) 'messages' is already used in admin context for something else (the update alerts), so you need to change that to a different name

Works OK in the end, though.