Esempio n. 1
0
"""drf_api 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 core.views import PostView, PostCreateView
from rest_framework.authtoken.views import obtain_auth_token

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', PostView.as_view(), name='test'),
    path('api-auth/', include('rest_framework.urls')),
    path('api/token/', obtain_auth_token, name='obtain_token'),
    path('rest-auth/', include('rest_auth.urls')),
    path('create/', PostCreateView.as_view(), name='create'),
]
Esempio n. 2
0
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 core.views import TestView, PostView, PostCreateView, PostListCreateView
from rest_framework.authtoken.views import obtain_auth_token


urlpatterns = [
    path('admin/', admin.site.urls),
    path('dj-rest-auth/', include('dj_rest_auth.urls')),
    path('', TestView.as_view(), name='test'),
    path('post/', PostView.as_view(), name='post'),
    path('create', PostCreateView.as_view(), name='create'),
    path('list-create', PostListCreateView.as_view(), name='listcreate'),
    path('api-auth', include('rest_framework.urls')),
    path('api/token', obtain_auth_token, name='obtain-token')
]
Esempio n. 3
0
"""api_dev 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.authtoken.views import obtain_auth_token
from core.views import PostView

urlpatterns = [
    path('api-auth/', include('rest_framework.urls')),
    path('rest-auth/', include('rest_auth.urls')),
    path('admin/', admin.site.urls),
    path('', PostView.as_view(), name="test"),
    path('api/token/', obtain_auth_token, name="obtain-token")
]
Esempio n. 4
0
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from auth.views import LandingView
from core.views import AboutView, HomeView, PostView

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),

	#


    #CAS
    url(r'^accounts/login/$', 'cas.views.login', name='login'),
    url(r'^accounts/logout/$', 'cas.views.logout', name='logout'),

    #OTHER LOGIN
    # url(r'^alt_login/$','auth.views.alt_login', name='alt_login'),

    #APP
    url(r'^$', LandingView.as_view(), name='login'),
    url(r'^home/?$', login_required(HomeView.as_view()), name='home'),
    url(r'^about/?$', AboutView.as_view(), name='about'),
    #post urls
    url(r'^posts/new/?$', login_required(PostView.as_view()), name='post_view'),
    url(r'^posts/(?P<post_id>\d+)/?$', login_required(PostView.as_view()), name='post_view')
)
Esempio n. 5
0
from django.contrib import admin
from django.urls import path, include
from django.urls import path
from rest_framework.authtoken.views import obtain_auth_token
from core.views import PostView, PostCreateView, TestView, PostListCreateView, loginPage, registerPage, home, Postregister
from django.conf.urls import url
from Tools.scripts import serve
from drf_api import settings

urlpatterns = [
    path('rest-auth/', include('rest_auth.urls')),
    path('api-auth/', include('rest_framework.urls')),
    path('admin/', admin.site.urls),
    path('postview/', PostView.as_view(), name='test'),
    path('postreg/', Postregister.as_view(), name='reg'),
    path('create/', PostCreateView.as_view(), name='create'),
    path('test/', TestView.as_view(), name='create'),
    path('list-create/', PostCreateView.as_view(), name='list-create'),
    path('hemanth/', PostListCreateView.as_view(), name='list'),
    path('api/token/', obtain_auth_token, name='obtain-token'),
    path('login/', loginPage, name='login'),
    path('', registerPage),
    path('home/', home),
    url(r'^media/(?P<path>.*)$', serve,
        {'document_root': settings.MEDIA_ROOT}),
    url(r'^static/(?P<path>.*)$', serve,
        {'document_root': settings.STATIC_ROOT}),
]