"""instagram URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from rest_framework import routers

from django.conf import settings
from django.conf.urls.static import static

from instagram import views


from rest_api import views as rest_api_views

router = routers.DefaultRouter()
router.register(r'profile', rest_api_views.ProfileViewSet, basename='profile')
router.register(r'publication', rest_api_views.PublicationViewSet, basename='publication')
router.register(r'subscription', rest_api_views.SubscriptionViewSet, basename='subscription')
router.register(r'comment', rest_api_views.CommentViewSet, basename='comment')
# router.register(r'like', rest_api_views.LikeViewSet, basename='like')
router.register(r'tag', rest_api_views.TagViewSet, basename='tag')

urlpatterns = [
    path('admin/', admin.site.urls, name="admin"),
    path('rest_api/', include('rest_api.urls'), name="rest_api"),
    # path('', views.index, name="index"),
    path('api/', include(router.urls)),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework'))
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static('photo/', document_root='photo/')
 
