Server IP : 85.214.239.14 / Your IP : 3.149.25.26 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/task/3/cwd/srv/modoboa/env/lib/python3.5/site-packages/rest_framework/ |
Upload File : |
from django.conf.urls import include, url from rest_framework.renderers import ( CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer ) from rest_framework.schemas import SchemaGenerator, get_schema_view from rest_framework.settings import api_settings def get_docs_view( title=None, description=None, schema_url=None, urlconf=None, public=True, patterns=None, generator_class=SchemaGenerator, authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES, renderer_classes=None): if renderer_classes is None: renderer_classes = [DocumentationRenderer, CoreJSONRenderer] return get_schema_view( title=title, url=schema_url, urlconf=urlconf, description=description, renderer_classes=renderer_classes, public=public, patterns=patterns, generator_class=generator_class, authentication_classes=authentication_classes, permission_classes=permission_classes, ) def get_schemajs_view( title=None, description=None, schema_url=None, urlconf=None, public=True, patterns=None, generator_class=SchemaGenerator, authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES): renderer_classes = [SchemaJSRenderer] return get_schema_view( title=title, url=schema_url, urlconf=urlconf, description=description, renderer_classes=renderer_classes, public=public, patterns=patterns, generator_class=generator_class, authentication_classes=authentication_classes, permission_classes=permission_classes, ) def include_docs_urls( title=None, description=None, schema_url=None, urlconf=None, public=True, patterns=None, generator_class=SchemaGenerator, authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES, renderer_classes=None): docs_view = get_docs_view( title=title, description=description, schema_url=schema_url, urlconf=urlconf, public=public, patterns=patterns, generator_class=generator_class, authentication_classes=authentication_classes, renderer_classes=renderer_classes, permission_classes=permission_classes, ) schema_js_view = get_schemajs_view( title=title, description=description, schema_url=schema_url, urlconf=urlconf, public=public, patterns=patterns, generator_class=generator_class, authentication_classes=authentication_classes, permission_classes=permission_classes, ) urls = [ url(r'^$', docs_view, name='docs-index'), url(r'^schema.js$', schema_js_view, name='schema-js') ] return include((urls, 'api-docs'), namespace='api-docs')