Skip to content

Commit

Permalink
Update apphooks.rst (#6255)
Browse files Browse the repository at this point in the history
* Update apphooks.rst

You need to add *Application instance name* by hand to a page when you add an ``app_name`` #hopeitsavessomeoneelsethetrouble

* Changed as per czpython's suggestions

While still trying to convey that we're fixing the same problem than the previous paragraphs refers to (and that *Application instance name* only appears after setting ``app_name`` )
  • Loading branch information
Chematronix authored and czpython committed Jun 14, 2018
1 parent 899a3d8 commit 0507212
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/how_to/apphooks.rst
Expand Up @@ -82,6 +82,8 @@ then your ``MyApphook`` class should include::
If you fail to this, then any templates in the application that invoke URLs using the form ``{% url 'myapp:index' %}``
or views that call (for example) ``reverse('myapp:index')`` will throw a ``NoReverseMatch`` error.

If you had already assigned a page to your aplication prior to setting the ``app_name`` attribute, you'll also need to edit its *Advanced settings* and specify your ``app_name`` in the *Application instance name* field that now appears, to avoid the ``NoReverseMatch`` error (the instance name is filled automatically in new pages).

*Unless* the class that defines the apphook specifies an ``app_name``, it can be attached only to one page at a time.
Attempting to apply it a second time will cause an error. See :ref:`multi_apphook` for more on having multiple apphook
instances.
Expand Down

0 comments on commit 0507212

Please sign in to comment.