Install and setup
Installing is pretty easy:
pip install django-decorated-routesOnce you install is open your settings.py file and register the app:
INSTALLED_APPS = [
# ...
'decorated_router',
]Next, you'll need to open up you urls.py file and add the next things:
Import the auto register function. That function will look for classes that uses the decorator and then do some magic (which already been discussed in the previous section):
from decorated_router.api.api import auto_registerNext, at the bottom of the file add use the command we imported:
auto_register(urlpatterns)
That's it! Let's register some routes
Last updated
Was this helpful?