Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

Commit

Permalink
[docs] Added documentation for "get_controller_urls"
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Feb 14, 2017
1 parent 172a92a commit 1daa855
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ to try to reuse the controller views:

.. code-block:: python
# views.py of your app
# your_config_app.controller.views
from ..models import Config # this is your custom model
from django_netjsonconfig.controller.generics import (
BaseChecksumView,
Expand Down Expand Up @@ -553,6 +553,20 @@ to try to reuse the controller views:
report_status = ReportStatusView.as_view()
register = RegisterView.as_view()
Controller URLs
~~~~~~~~~~~~~~~

If you are not making drastic changes to the controller views, you can avoid duplicating the URL
logic by using the ``get_controller_urls`` function. Put this in your controller ``urls.py``:

.. code-block:: python
# your_config_app.controller.urls
from django_netjsonconfig.utils import get_controller_urls
from . import views
urlpatterns = get_controller_urls(views)
Extending AppConfig
~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 1daa855

Please sign in to comment.