Skip to content

Commit b034f1e

Browse files
committed
[docs] Updated setup instructions
1 parent 57e3e17 commit b034f1e

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

README.rst

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ Follow the following structure while creating `csv` file to import data.
452452
<ip-address>,<optional-description>
453453
<ip-address>,<optional-description>
454454
455-
Setup (Integrate into other Apps)
456-
*********************************
455+
Setup (integrate in an existing Django project)
456+
***********************************************
457457

458-
Add ``openwisp_ipam`` to ``INSTALLED_APPS``:
458+
The ``settings.py`` of your project should contain the following:
459459

460460
.. code-block:: python
461461
@@ -467,19 +467,32 @@ Add ``openwisp_ipam`` to ``INSTALLED_APPS``:
467467
'django.contrib.admin',
468468
# rest framework
469469
'rest_framework',
470+
'drf_yasg',
470471
]
471472
473+
AUTH_USER_MODEL = 'openwisp_users.User'
474+
472475
Add the URLs to your main ``urls.py``:
473476

474477
.. code-block:: python
475478
479+
from django.conf.urls import url
480+
from django.contrib import admin
481+
from django.urls import include, path
482+
from openwisp_users.api.urls import get_api_urls as get_users_api_urls
483+
476484
urlpatterns = [
477-
# ... other urls in your project ...
478-
url(r'^admin/', admin.site.urls),
479-
# openwisp-ipam urls
480-
url(r'^', include('openwisp_ipam.urls')),
485+
# admin URLs
486+
path('admin/', admin.site.urls),
487+
# IPAM API
488+
path('', include('openwisp_ipam.urls')),
489+
# OpenAPI docs
490+
path('api/v1/', include('openwisp_utils.api.urls')),
491+
# Bearer Authentication API URL
492+
url(r'^api/v1/', include((get_users_api_urls(), 'users'), namespace='users')),
481493
]
482494
495+
483496
Then run:
484497

485498
.. code-block:: shell

0 commit comments

Comments
 (0)