"""smm_backend URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 rest_framework import permissions
from django.urls import path
from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers
from rest_framework_swagger.views import get_swagger_view
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
from .views import TokenViewSet
from smm_backend.views import PostViewSet, PostsList, PurchaseList, UserPostViewSet


schema_view = get_swagger_view(title="Documentation")

# Serializers define the API representation.
class UserSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


# ViewSets define the view behavior.
class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


# Routers provide a way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register('users', UserViewSet)
router.register('token', TokenViewSet)
router.register('post', PostViewSet)
router.register('user-post', UserPostViewSet)


# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    path('api_doc/', schema_view),
    #url(r'^posts/', PostsList.as_view()),
    url(r'^posts/(?P<user_id>.+)/$', PostsList.as_view()),
    url(r'^token/(?P<user_id>[0-9]+)/$', PurchaseList.as_view()),
    path('list_user/', include(router.urls)),
    url(r'^accounts/', include('allauth.urls')),
    path('admin/', admin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('auth/', include('djoser.urls')),
    path('auth/', include('djoser.urls.jwt')),
]

05e71ba1aade12857d0fa7f277008b0ce3f3a9c3
<mask token>


class UserSerializer(serializers.HyperlinkedModelSerializer):


    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


<mask token>

<mask token>


class UserSerializer(serializers.HyperlinkedModelSerializer):


    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


<mask token>
router.register('users', UserViewSet)
router.register('token', TokenViewSet)
router.register('post', PostViewSet)
router.register('user-post', UserPostViewSet)
<mask token>

<mask token>
schema_view = get_swagger_view(title='Documentation')


class UserSerializer(serializers.HyperlinkedModelSerializer):


    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


router = routers.DefaultRouter()
router.register('users', UserViewSet)
router.register('token', TokenViewSet)
router.register('post', PostViewSet)
router.register('user-post', UserPostViewSet)
urlpatterns = [path('api_doc/', schema_view), url(
    '^posts/(?P<user_id>.+)/$', PostsList.as_view()), url(
    '^token/(?P<user_id>[0-9]+)/$', PurchaseList.as_view()), path(
    'list_user/', include(router.urls)), url('^accounts/', include(
    'allauth.urls')), path('admin/', admin.site.urls), url('^api-auth/',
    include('rest_framework.urls', namespace='rest_framework')), path(
    'auth/', include('djoser.urls')), path('auth/', include('djoser.urls.jwt'))
    ]

<mask token>
from django.contrib import admin
from rest_framework import permissions
from django.urls import path
from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers
from rest_framework_swagger.views import get_swagger_view
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
from .views import TokenViewSet
from smm_backend.views import PostViewSet, PostsList, PurchaseList, UserPostViewSet
schema_view = get_swagger_view(title='Documentation')


class UserSerializer(serializers.HyperlinkedModelSerializer):


    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


router = routers.DefaultRouter()
router.register('users', UserViewSet)
router.register('token', TokenViewSet)
router.register('post', PostViewSet)
router.register('user-post', UserPostViewSet)
urlpatterns = [path('api_doc/', schema_view), url(
    '^posts/(?P<user_id>.+)/$', PostsList.as_view()), url(
    '^token/(?P<user_id>[0-9]+)/$', PurchaseList.as_view()), path(
    'list_user/', include(router.urls)), url('^accounts/', include(
    'allauth.urls')), path('admin/', admin.site.urls), url('^api-auth/',
    include('rest_framework.urls', namespace='rest_framework')), path(
    'auth/', include('djoser.urls')), path('auth/', include('djoser.urls.jwt'))
    ]

"""smm_backend URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 rest_framework import permissions
from django.urls import path
from django.conf.urls import url, include
from django.contrib.auth.models import User
from rest_framework import serializers, viewsets, routers
from rest_framework_swagger.views import get_swagger_view
from rest_framework_swagger.renderers import OpenAPIRenderer, SwaggerUIRenderer
from .views import TokenViewSet
from smm_backend.views import PostViewSet, PostsList, PurchaseList, UserPostViewSet


schema_view = get_swagger_view(title="Documentation")

# Serializers define the API representation.
class UserSerializer(serializers.HyperlinkedModelSerializer):
    class Meta:
        model = User
        fields = ['username', 'email', 'first_name', 'last_name']


# ViewSets define the view behavior.
class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


# Routers provide a way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register('users', UserViewSet)
router.register('token', TokenViewSet)
router.register('post', PostViewSet)
router.register('user-post', UserPostViewSet)


# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
    path('api_doc/', schema_view),
    #url(r'^posts/', PostsList.as_view()),
    url(r'^posts/(?P<user_id>.+)/$', PostsList.as_view()),
    url(r'^token/(?P<user_id>[0-9]+)/$', PurchaseList.as_view()),
    path('list_user/', include(router.urls)),
    url(r'^accounts/', include('allauth.urls')),
    path('admin/', admin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    path('auth/', include('djoser.urls')),
    path('auth/', include('djoser.urls.jwt')),
]
