from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic import TemplateView

urlpatterns = [
    path('api-auth/', include('rest_framework.urls')),
    path('rest-auth/', include('rest_auth.urls')),
    path('rest-auth/registration/', include('rest_auth.registration.urls')),
    path('admin/', admin.site.urls),
    path('api/', include('core.api.urls')),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)


if not settings.DEBUG:
    urlpatterns += [re_path(r'^.*',
                            TemplateView.as_view(template_name='index.html'))]

[(11, 'django.urls.path', 'path', False, 'from django.urls import path, include, re_path\n'), (16, 'django.conf.urls.static.static', 'static', False, 'from django.conf.urls.static import static\n'), (8, 'django.urls.include', 'include', False, 'from django.urls import path, include, re_path\n'), (9, 'django.urls.include', 'include', False, 'from django.urls import path, include, re_path\n'), (10, 'django.urls.include', 'include', False, 'from django.urls import path, include, re_path\n'), (12, 'django.urls.include', 'include', False, 'from django.urls import path, include, re_path\n'), (22, 'django.views.generic.TemplateView.as_view', 'TemplateView.as_view', False, 'from django.views.generic import TemplateView\n')]