<reponame>kemalayhan/kinda-stackoverflow
from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth import views as auth_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path(
        '', TemplateView.as_view(template_name="homepage.html"), name="homepage"
    ),
    path('users/', include('users.urls')),
    path('questions/', include('questions.urls')),
    path('tags/', include('tags.urls')),
    path('login/', auth_views.LoginView.as_view(), name="login"),
    path('logout/', auth_views.LogoutView.as_view(), name="logout"),
]


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