Link rest api on website

This commit is contained in:
Mario Hüttel 2021-08-07 19:50:16 +02:00
parent 3a68972c03
commit c065720ded
2 changed files with 2 additions and 1 deletions

View File

@ -23,6 +23,6 @@ from parts import views as parts_views
urlpatterns = [ urlpatterns = [
url(r'^admin/login/', parts_views.login_view), url(r'^admin/login/', parts_views.login_view),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('api/v1/', include('api.urls')), path('api/v1/', include('api.urls'), name='api-root'),
path('', include('parts.urls')), path('', include('parts.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -36,6 +36,7 @@
<a href="#" class="nav-link dropdown-toggle text-primary" id="navbar-user-dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ base.navbar.username }}</a> <a href="#" class="nav-link dropdown-toggle text-primary" id="navbar-user-dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ base.navbar.username }}</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbar-user-dropdown"> <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbar-user-dropdown">
<li><a class="dropdown-item" href="{% url 'logout' %}">Logout</a></li> <li><a class="dropdown-item" href="{% url 'logout' %}">Logout</a></li>
<li><a class="dropdown-item" href="{% url 'api-root' %}">REST API</a></li>
{% if base.navbar.show_admin %} {% if base.navbar.show_admin %}
<li><a class="dropdown-item text-success" href="{% url 'admin:index' %}">Administration</a></li> <li><a class="dropdown-item text-success" href="{% url 'admin:index' %}">Administration</a></li>
{% endif %} {% endif %}