Пример #1
0
"""pythonSWAPI 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 django.urls import path

from graphene_django.views import GraphQLView
from django.views.decorators.csrf import csrf_exempt
from graphql_playground.views import GraphQLPlaygroundView
#from pythonSWAPI.schema import schema

urlpatterns = [
    path('admin/', admin.site.urls),
    #path('graphql/', GraphQLView.as_view(graphiql=True,schema=schema)),
    path('api/', csrf_exempt(GraphQLView.as_view(graphiql=False))),
    path('graphql/', csrf_exempt(GraphQLPlaygroundView.as_view(endpoint="http://127.0.0.1:8000/api/"))),
]
Пример #2
0
"""skynet 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 django.urls import path
from graphene_django.views import GraphQLView
from graphql_playground.views import GraphQLPlaygroundView 
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
  path('admin/', admin.site.urls),
  path("graphql", csrf_exempt(GraphQLView.as_view(graphiql=True))),
  path('playground/', GraphQLPlaygroundView.as_view(endpoint="http://localhost:8000/graphql")),
]
Пример #3
0
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 django.urls import path
from graphene_django.views import GraphQLView
from django.views.decorators.csrf import csrf_exempt
from graphql_playground.views import GraphQLPlaygroundView
from django.conf.urls import url


urlpatterns = [
    path("admin/", admin.site.urls),
    url("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=True))),
    path(
        "playground/",
        GraphQLPlaygroundView.as_view(endpoint="http://localhost:8000/graphql/"),
    ),
]
Пример #4
0
import graphene
from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from graphql_playground.views import GraphQLPlaygroundView
from django.views.decorators.csrf import csrf_exempt
from deck_pocket.graphql_schema.global_schema import Query
from deck_pocket.graphql_mutations.global_mutations import Mutation
from deck_pocket.auth_ql.oauth_graphql import PrivateGraphQLView, GraphQLCustomCoreBackend
from deck_pocket.graphql_subscriptions.subscriptions import Subscription

schema = graphene.Schema(query=Query,
                         mutation=Mutation,
                         subscription=Subscription)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('oauth2/', include('oauth2_provider.urls',
                            namespace='oauth2_provider')),
    path('graphql',
         csrf_exempt(
             PrivateGraphQLView.as_view(graphiql=True,
                                        schema=schema,
                                        backend=GraphQLCustomCoreBackend())),
         name='graphql'),
    path(
        'playground/',
        GraphQLPlaygroundView.as_view(
            endpoint="https://deck-pocket-backend.herokuapp.com/graphql")),
]
"""example URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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

from graphql_playground.views import GraphQLPlaygroundView

urlpatterns = [
    path('admin/', admin.site.urls),
    path(
        'playground/',
        GraphQLPlaygroundView.as_view(
            endpoint="http://api.githunt.com/graphql")),
]
Пример #6
0
    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 graphene_django.views import GraphQLView
from generator.views import index, user_new
from django.conf.urls import url
from porter.schema import schema
from django.views.decorators.csrf import csrf_exempt
from graphql_playground.views import GraphQLPlaygroundView

urlpatterns = [
    path('pages/', include('frontend.urls')),
    path('admin/', admin.site.urls),
    path('', include('generator.urls')),
    path('add/', user_new),
    path('accounts/', include('django.contrib.auth.urls')),
    path('graphql/',
         csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema))),
    path(
        'playground/',
        GraphQLPlaygroundView.as_view(
            endpoint="http://127.0.0.1:8000/graphql"))
]
Пример #7
0
from graphene_file_upload.django import FileUploadGraphQLView
from graphql_jwt.decorators import jwt_cookie
from graphql_playground.views import GraphQLPlaygroundView

from BackStrawBerryPy.schema import schema
from apps.Personas import views

urls_reportes = [
    path('api/v1/reporte-nomina', views.get_reporte_nomina),
    path('api/v1/reporte-notas', views.get_reporte_notas),
    path('api/v1/reporte-matricula', views.get_reporte_matricula),
    path('api/v1/reporte-general-total-alumnos',
         views.get_reporte_general_total_alumnos),
]

urlpatterns = [
    path('admin/', admin.site.urls),
    # path('api/v1/', include(urls_api)),
    path('webpush/', include('webpush.urls')),
    path(
        'graphql',
        csrf_exempt(
            jwt_cookie(
                FileUploadGraphQLView.as_view(graphiql=True, schema=schema)))),
    path(
        'playground',
        csrf_exempt(
            jwt_cookie(GraphQLPlaygroundView.as_view(endpoint='graphql')))),
]
urlpatterns = urlpatterns + urls_reportes
Пример #8
0
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 django.urls import path, include
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from graphql_playground.views import GraphQLPlaygroundView
from graphql_jwt.decorators import jwt_cookie

from .schema import schema

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('login.urls')),
    path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True, schema=schema)), name='graphql_endpoint'),
    path('playground/', GraphQLPlaygroundView.as_view(endpoint="/graphql/")),
    # path('graphqll/', jwt_cookie(GraphQLView.as_view())),
]
Пример #9
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.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.views.decorators.csrf import csrf_exempt
from django.urls import path
from graphql_playground.views import GraphQLPlaygroundView
from graphene_file_upload.django import FileUploadGraphQLView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('graphql/',
         csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True))),
    path(
        'playground/',
        csrf_exempt(
            GraphQLPlaygroundView.as_view(
                endpoint="http://localhost:8000/graphql/",
                subscription_endpoint="ws://localhost:8000/subscriptions/")))
]
Пример #10
0
"""bedav 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.conf import settings
from django.contrib import admin
from django.urls import path, re_path, include
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from graphql_playground.views import GraphQLPlaygroundView

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'graphql[/]?', csrf_exempt(GraphQLView.as_view(graphiql=False))),
    re_path(r'playground[/]?',
            csrf_exempt(GraphQLPlaygroundView.as_view(endpoint="/graphql")))
]
Пример #11
0
    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
from django.conf.urls import url, include

from graphene_django.views import GraphQLView

from django.views.decorators.csrf import csrf_exempt

from .schema import schema
from graphql_playground.views import GraphQLPlaygroundView

urlpatterns = [
    url(r'^api/$', csrf_exempt(GraphQLView.as_view(graphiql=False))),
    url(
        r'^graphql/$',
        csrf_exempt(
            GraphQLPlaygroundView.as_view(
                endpoint="http://127.0.0.1:8000/api/"))),
    url(r'^graphql_jwt', GraphQLView.as_view(graphiql=True, schema=schema)),
    #url(r'^graphql$', GraphQLView.as_view(graphiql=True, schema=schema)),
    url(r'admin/', admin.site.urls),
]
from server.settings import BASE_DIR


class GraphQLCustomCoreBackend(GraphQLCoreBackend):
    def __init__(self, executor=None):
        # type: (Optional[Any]) -> None
        super().__init__(executor)
        self.execute_params['allow_subscriptions'] = True


config = RawConfigParser()
config.read(os.path.join(settings.BASE_DIR, 'config.ini'))

urlpatterns = [
    path('admin/', admin.site.urls),
    path("graphql/",
         csrf_exempt(
             jwt_cookie(
                 FileUploadGraphQLView.as_view(
                     graphiql=True, backend=GraphQLCustomCoreBackend()))),
         name='graphql'),
    path(
        '',
        csrf_exempt(
            jwt_cookie(
                GraphQLPlaygroundView.as_view(
                    endpoint=config.get('server', 'SERVER_URL') +
                    "/graphql/"))))
    # path('accounts/', include('allauth.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #13
0
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from graphene_file_upload.django import FileUploadGraphQLView
from graphql_jwt.decorators import jwt_cookie
from graphql_playground.views import GraphQLPlaygroundView

urlpatterns = [
    path("admin/", admin.site.urls),
    path("graphql",
         csrf_exempt(jwt_cookie(
             FileUploadGraphQLView.as_view(graphiql=True)))),
    path("",
         GraphQLPlaygroundView.as_view(endpoint=settings.GRAPHQL_ENDPOINT)),
]

if settings.DEBUG:
    urlpatterns.append(
        static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)[0])
    urlpatterns.append(
        static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)[0])
    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
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView
from graphql import GraphQLCoreBackend
from graphql_playground.views import GraphQLPlaygroundView


class GraphQLCustomCoreBackend(GraphQLCoreBackend):
    def __init__(self, executor=None):
        # type: (Optional[Any]) -> None
        super().__init__(executor)
        self.execute_params['allow_subscriptions'] = True


urlpatterns = [
    path('admin/', admin.site.urls),
    path('graphql-playground/', csrf_exempt(GraphQLPlaygroundView.as_view())),
    path(
        'temp-sub/',
        csrf_exempt(
            GraphQLView.as_view(graphiql=True,
                                backend=GraphQLCustomCoreBackend()))),
]