from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('api.router')),
    url(r'^.*$', RedirectView.as_view(pattern_name='api-root', permanent=True), name='index')
]

from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('api.router')),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^.*$', RedirectView.as_view(pattern_name='api-root', permanent=True), name='index')
]

Add simple login form in the API.
Add simple login form in the API.

This is usefull for developers to explore the Browlable api directly
on the browser.

  from django.conf.urls import url, include
  from django.contrib import admin
  from django.views.generic import RedirectView
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^', include('api.router')),
+     url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
      url(r'^.*$', RedirectView.as_view(pattern_name='api-root', permanent=True), name='index')
  ]
  
Add simple login form in the API.
## Code Before:
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('api.router')),
    url(r'^.*$', RedirectView.as_view(pattern_name='api-root', permanent=True), name='index')
]

## Instruction:
Add simple login form in the API.
## Code After:
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import RedirectView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('api.router')),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    url(r'^.*$', RedirectView.as_view(pattern_name='api-root', permanent=True), name='index')
]
