from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings

from api import views as api_views
from webapp import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.IndexRedirectView.as_view(), name='redirect_to_index'),
    path('articles/', include('webapp.urls')),
    path('accounts/', include('accounts.urls')),
    path('api/articles/', api_views.ArticleListView.as_view()),
    path('api/articles/create', api_views.ArticleCreateView.as_view()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
