403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/horilla/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/horilla/rest_conf.py
"""
rest_conf.py
"""

from datetime import timedelta

from horilla import settings
from horilla.settings import INSTALLED_APPS

# Injecting installed apps to settings

REST_APPS = ["rest_framework", "rest_framework_simplejwt", "drf_yasg", "horilla_api"]

INSTALLED_APPS.extend(REST_APPS)

REST_FRAMEWORK_SETTINGS = {
    "DEFAULT_FILTER_BACKENDS": ["django_filters.rest_framework.DjangoFilterBackend"],
    "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.PageNumberPagination",
    "DEFAULT_AUTHENTICATION_CLASSES": (
        "rest_framework_simplejwt.authentication.JWTAuthentication",
    ),
    "PAGE_SIZE": 20,
}

SIMPLE_JWT = {
    "ACCESS_TOKEN_LIFETIME": timedelta(days=30),
}
SWAGGER_SETTINGS = {
    "SECURITY_DEFINITIONS": {
        "Bearer": {
            "type": "apiKey",
            "name": "Authorization",
            "in": "header",
            "description": "Enter your Bearer token here",
        },
        "Basic": {
            "type": "basic",
            "description": "Basic authentication. Enter your username and password.",
        },
    },
    "SECURITY": [{"Bearer": []}, {"Basic": []}],
}
# Inject the REST framework settings into the Django project settings
setattr(settings, "REST_FRAMEWORK", REST_FRAMEWORK_SETTINGS)
setattr(settings, "SIMPLE_JWT", SIMPLE_JWT)
setattr(settings, "SWAGGER_SETTINGS", SWAGGER_SETTINGS)

Youez - 2016 - github.com/yon3zu
LinuXploit