Uname:Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64

403WebShell
403Webshell
Server IP : 82.148.16.210  /  Your IP : 216.73.216.19
Web Server : nginx/1.29.5
System : Linux mail.sarafai.ru 6.1.0-43-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.162-1 (2026-02-08) x86_64
User : root ( 0)
PHP Version : 7.4.33
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 : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/529/cwd/project/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/529/cwd/project/urls.py
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, login_not_required
from django.urls import path, include, re_path
from django.utils.translation import gettext_lazy as _
from django.views.static import serve
from django.contrib.auth import views as auth_views
from django.urls import path
from django.conf.urls import include
from django.conf import settings
from django.views.generic import RedirectView, TemplateView

from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView, SpectacularRedocView
from rest_framework import routers

from rest_framework import permissions
# from drf_yasg.views import get_schema_view
# from drf_yasg import openapi

from project.admin import admin_site
from apps.homepage.decorators import check_recaptcha
# from apps.pages.feed import RssNewsFeed, AtomNewsFeed
from apps.pages.feed import RssProductsFeed, AtomProductsFeed
from apps.homepage.views import (
    HomepageView,
    # HomepageImageAPIView,
    HomepageImageList,
    HomepageImageDetail,
)
from apps.core import views
from apps.shop.views import CollectionListView, CollectionDetailView
from apps.feedback.views import FeedbackFormView
from apps.dashboard.views import (
    DashboardView,
    ProfileView,
    SignUpView
)
from apps.payment.views import (
    APIProcessingView,
    APIProcessingAPIView,
    PaymentMethodAPIView,
)
from apps.delivery.views import (
    DeliveryMethodView,
    DeliveryMethodList,
    DeliveryMethodDetail
)
from apps.account.views import ExpiredSessionAPIView, ExpiredSessionView
from apps.orders.views import OrdersClientDataAPIView, ValidatePhoneAPIView
from apps.return_app.views import ReturnFormView

from apps.shop.viewsets import ProductViewSet
from apps.api.rapidoc import SpectacularRapiDocView
from apps.homepage.viewsets import HomepageImageViewSet

handler400 = 'apps.core.views.bad_request'
handler403 = 'apps.core.views.permission_denied'
handler404 = 'apps.core.views.page_not_found'
handler410 = 'apps.core.views.gone'
# handler500 = 'apps.core.views.server_error'

# schema_view = get_schema_view(
#     openapi.Info(
#         title="Snippets API",
#         default_version='v1',
#         description="SARAFAI API",
#         terms_of_service="https://www.google.com/policies/terms/",
#         contact=openapi.Contact(email="891rpm@gmail.com"),
#         license=openapi.License(name="BSD License"),
#     ),
#     public=True,
#     patterns=[
#         path('api/delivery/', include('apps.delivery.urls')),
#         path('api/auth/', include('rest_framework.urls')),
#         path('api/session/expired/', ExpiredSessionAPIView.as_view(), name='expired_session_api_view'),
#         # path('api/payment/processing/', APIProcessingView.as_view(), name='api_payment_processing'),
#         path('api/payment/processing/', APIProcessingAPIView.as_view(), name='api_payment_processing_api_view'),
#     ],
#     permission_classes=[permissions.AllowAny],
#     # permission_classes=[permissions.IsAdminUser],
# )


# Sentry
# def trigger_error(request):
#     division_by_zero = 1 / 0


# # REST routers
router = routers.DefaultRouter()
router.register(r'homepage_image', HomepageImageViewSet)
# router.register(r'products', ProductViewSet)
# router.register(r'users', UserViewSet)
# router.register(r'groups', GroupViewSet)
# # router.register(r'processing', ProccessingAPIView)

admin.site.site_header = _('сарафай')
admin.site.site_title = _('сарафай')
admin.site.index_title = _('Управление сайтом sarafai')

urlpatterns = [
    path('admin_sarafai/', admin.site.urls),

    # # Sandbox
    # path('sandbox/',
    #      include(('apps.core.sandbox.urls', 'apps.core'), namespace='sandbox'),
    #      name='sandbox'),

    path('dashboard_sarafai/',
         staff_member_required(
             DashboardView.as_view(
                 template_name='dashboard/dashboard.html'),
             login_url='login'),
         name='dashboard_view'),

    # path('i18n/', include('django.conf.urls.i18n')),

    path('robots.txt',
         RedirectView.as_view(
             url=settings.STATIC_URL + 'robots.txt',
             permanent=True),
         name='view_robots'),

    path('favicon.ico',
         RedirectView.as_view(
             url=settings.STATIC_URL + 'favicons/favicon.ico',
             permanent=True),
         name='view_favicon'),

    # # Sentry
    # path('sentry-debug/', trigger_error),
]

# API
urlpatterns += [

    # # Swagger
    # re_path(r'^swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    # path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    # path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),

    # drf-spectacular
    path('api/v1/', SpectacularAPIView.as_view(), name='schema'),
    # Optional UI:
    path('api/v1/swagger/', SpectacularSwaggerView.as_view(url_name='schema'), name='swagger-ui'),
    path('api/v1/redoc/', SpectacularRedocView.as_view(url_name='schema'), name='redoc'),
    path('api/v1/rapidoc/', SpectacularRapiDocView.as_view(url_name='schema'), name='rapidoc_view'),

    # path('api/v1/', include(router.urls)),

    # path('api/', include(('apps.api.urls', 'apps.api'), namespace='api'), name='api'),
    # path('api/delivery/',
    #      include(('apps.delivery.urls', 'apps.delivery'), namespace='delivery_api'),
    #      name='delivery_api'),

    # path('api/v1/homepage_image_old/',
    #      HomepageImageAPIView.as_view(),
    #      name='homepage_image_api_v1'),

    path('api/v1/homepage_image/',
         HomepageImageList.as_view(),
         name='homepage_image_list_api_v1'),
    path('api/v1/homepage_image/<int:pk>/',
         HomepageImageDetail.as_view(),
         name='homepage_image_detail_api_v1'),

    path('api/v1/delivery/',
         include(('apps.delivery.urls', 'apps.delivery'), namespace='delivery_api_v1'),
         name='delivery_api_v1'),

    path('api/v1/delivery_method/',
         DeliveryMethodList.as_view(),
         name='delivery_method_list_api_v1'),
    path('api/v1/delivery_method/',
         DeliveryMethodDetail.as_view(),
         name='delivery_method_detail_api_v1'),

    path('api/v1/payment_method/',
         PaymentMethodAPIView.as_view(),
         name='payment_method_api_v1'),

    # path('api/auth/', include('rest_framework.urls')),
    path('api/v1/auth/', include('rest_framework.urls', namespace='drf_v1'), name='drf_v1'),

    # path('api/orders/client_data/',
    #      OrdersClientDataAPIView.as_view(),
    #      name='orders_client_data_api'),
    path('api/v1/orders/client_data/',
         OrdersClientDataAPIView.as_view(),
         name='orders_client_data_api_v1'),

    # path('api/orders/validate_phone/',
    #      ValidatePhoneAPIView.as_view(),
    #      name='orders_validate_phone_api'),
    path('api/v1/orders/validate_phone/',
         ValidatePhoneAPIView.as_view(),
         name='orders_validate_phone_api_v1'),

    # path('api/session/expired/',
    #      ExpiredSessionAPIView.as_view(),
    #      name='expired_session_api_view'),
    path('api/v1/session/expired/',
         ExpiredSessionAPIView.as_view(),
         name='expired_session_api_view_v1'),

    # Payments API
    # -- Return JSON object
    # path('api/payment/processing/',
    #      APIProcessingView.as_view(),
    #      name='api_payment_processing'),
    path('api/v1/payment/processing/',
         APIProcessingView.as_view(),
         name='api_payment_processing_v1'),

    # path('api/payment/processing/success/',
    #      ProcessingSuccessView.as_view(), name='payment_processing_success'),
    #
    # path('api/payment/processing/fail/',
    #      ProcessingFailView.as_view(), name='payment_processing_fail'),

    # path('api/payment/create/',
    #      PaymentView.as_view(), name='tinkoff_payment'),

    # API V1 - Old API
    path('api/v1/old/',
         include(('apps.api.urls', 'apps.api'), namespace='api_v1'),
         name='api_v1'),

    # API V2
    path('api/v1/new/',
         include(('apps.api.urls', 'apps.api'), namespace='api_v2'),
         name='api_v2'),

    # path('api/v2/',
    #      OrdersClientDataAPIView.as_view(),
    #      name='orders_client_data_api'),

]

# if 'rosetta' in settings.INSTALLED_APPS:
#     urlpatterns += [
#         path('rosetta/',
#              # staff_member_required(
#                  # include('rosetta.urls')
#                  # login_url='login')
#              # ),
#              include('rosetta.urls')
#              )
#     ]

if True:

    # urlpatterns += i18n_patterns(  # i18n - Disabled
    urlpatterns += [

        # Error messages test
        # path('error500', ServerErrorView.as_view(), name='error500_view'),
        path('error-500/', views.server_error, name='error_500_test_view'),
        path('error-410/', views.gone, name='error_410_test_view'),
        path('error-404/', views.page_not_found, name='error_404_test_view'),
        path('error-403/', views.permission_denied, name='error_403_test_view'),
        path('error-400/', views.bad_request, name='error_400_test_view'),

        # Feeds
        # path('rss/', RssNewsFeed()),
        # path('atom/', AtomNewsFeed()),
        path('rss/', RssProductsFeed()),
        path('atom/', AtomProductsFeed()),

        # Sitemaps
        # path('sitemap.xml', include('packages.static_sitemaps.urls')),
        path('', include('static_sitemaps.urls')),

        #    re_path(r'^admin/', admin.site.urls),
        #    re_path(r'^cart/', include('cart.urls', namespace='cart')),
        #    re_path(r'^order/', include('orders.urls', namespace='orders')),
        #    re_path(r'^payment/', include('payment.urls', namespace='payment')),
        #    re_path(r'^cupons/', include('cupons.urls', namespace='cupon')),
        #    re_path(r'^paypal/', include('paypal.standard.ipn.urls')),
        #    re_path(r'^', include('shop.urls', namespace='shop'))

        # path('', check_recaptcha(HomepageView.as_view()), name='homepage_view'),

        # User profile
        # path('profile/', include('apps.dashboard.urls')),

        path('',
             include('django.contrib.auth.urls'),
             name='home'),

        # path('profile/',
        #      login_required(ProfileView.as_view(), login_url='login'),
        #      name='profile_view'),

        # 2024-10-04 Commented
        # path('profile/',
        #      include(
        #          ('apps.dashboard.urls', 'apps.dashboard'),
        #          namespace='profile'),
        #      name='profile'),

        path('my/',
             include(
                 ('apps.my.urls', 'apps.my'),
                 namespace='my'),
             name='my'),

        path('register/',
             login_not_required(SignUpView.as_view()),
             name='signup_view'),

        # Shop links
        # re_path(r'^shop/', include(('apps.shop.urls', 'cart'), namespace='shop')),
        # path('', include('apps.shop.urls')),

        path('catalog/',
             include(('apps.shop.urls', 'apps.shop'), namespace='shop'),
             name='shop'),

        # re_path(r'^cart/', include(('apps.cart.urls', 'cart'), namespace='cart')),
        # path('cart', include('apps.cart.urls')),

        path('cart/',
             include(('apps.cart.urls', 'apps.cart'), namespace='cart'),
             name='cart'),

        # re_path(r'^order/', include(('apps.orders.urls', 'orders'), namespace='orders')),
        # path('orders/', include('apps.orders.urls')),

        path('order/',
             include(('apps.orders.urls', 'apps.orders'), namespace='orders'),
             name='orders'),

        # path('feedback/',
        #      include(('apps.feedback.urls', 'apps.feedback'), namespace='feedback'),
        #      name='feedback'),

        path('payment/',
             include(('apps.payment.urls', 'apps.payment'), namespace='payment'),
             name='payment'),

        path('coupons/',
             include(('apps.cupons.urls', 'apps.cupons'), namespace='cupon'),
             name='cupon'),

        # path('paypal/', include('paypal.standard.ipn.urls')),

        # path('collections/',
        #      CollectionListView.as_view(template_name='shop/collection_list.html'),
        #      name='collection_list_view'),

        # path('events/',
        #      EventListView.as_view(template_name='shop/event_list.html'),
        #      name='event_list_view'),
        #
        # path('events/<slug:slug>/',
        #      EventDetailView.as_view(template_name='shop/event_detail.html'),
        #      name='collection_detail_view'),

        path('collections/',
             CollectionListView.as_view(template_name='collection/collection_list.html'),
             name='event_list_view'),

        path('collections/<slug:slug>/',
             CollectionDetailView.as_view(template_name='collection/collection_detail.html'),
             name='collection_detail_view'),

        # path('<str:link>/', PageView.as_view(), name='pages_view'),

        # Disabled at 2024.08.31
        # path('about/',
        #      TemplateView.as_view(
        #          template_name='pages/custom/about.html'),
        #      name='page_view_about'),

        # path('contacts/',
        #      TemplateView.as_view(template_name='pages/custom/contacts.html'), name='page_view_contacts'),
        # path('contacts/', FeedbackCreateView.as_view(), name='page_view_contacts'),
        # path('contacts/sent/', FeedbackDoneView.as_view(), name='feedback_sent_view'),

        # FEEDBACK
        path('contacts/',
             FeedbackFormView.as_view(),
             name='feedback_form_view'),

        path('return/',
             ReturnFormView.as_view(),
             name='return_form_view'),


        # CUSTOM PAGES

        # path('tracking/',
        #      TemplateView.as_view(template_name='pages/custom/tracking.html'),
        #      name='page_view_tracking'),

        # path('payment/',
        #      TemplateView.as_view(
        #          template_name='pages/custom/payment.html'),
        #      name='page_view_payment'),

        # path('returns/',
        #      TemplateView.as_view(template_name='pages/custom/returns.html'),
        #      name='page_view_returns'),

        path('terms-of-sale/',
             TemplateView.as_view(
                 template_name='pages_custom/terms-of-sale.html'
             ),
             name='page_view_termsofsale'),

        path('privacy-policy/',
             TemplateView.as_view(
                 template_name='pages_custom/privacy-policy.html'
             ),
             name='page_view_privacypolicy'),

        # path('delivery/',
        #      DeliveryMethodView.as_view(),
        #      name='page_view_delivery'),
        path('delivery/',
             TemplateView.as_view(
                 template_name='pages_custom/delivery.html'
             ),
             name='page_view_delivery'),


        # ACCOUNT
        path('account/',
             include(
                 ('apps.account.urls', 'apps.account'),
                 namespace='account'),
             name='account'),

        # path('logout/',
        #      login_required(
        #          auth_views.LogoutView.as_view(
        #              next_page=settings.LOGOUT_REDIRECT_URL),
        #          login_url='login'),
        #      name='logout'),

        # path("logout/", auth_views.LogoutView.as_view(), name="logout"),


        # # PAGES
        # path('<slug:slug>/',
        #      PageDetailView.as_view(),
        #      name='page_detail_view'),

        path('',
             HomepageView.as_view(
                 template_name='homepage/homepage.html'),
             name='homepage_view'),

        path('home/',
             HomepageView.as_view(
                 template_name='homepage/homepage_old.html'),
             name='homepage_old_view'),

        # # Recaptcha decorator used
        # path('', check_recaptcha(HomepageView.as_view()), name='homepage_view'),

    ]

# if settings.DEBUG:
urlpatterns += [
    re_path(r'^media/(?P<path>.*)$',
            serve,
            {'document_root': settings.MEDIA_ROOT}),
    re_path(r'^static/(?P<path>.*)$',
            serve,
            {'document_root': settings.STATIC_ROOT}),
]

# if settings.DEBUG:
#     urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
#     urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
#

if settings.DEBUG:
    import debug_toolbar

    urlpatterns = [
                      # path('__debug__/', include(debug_toolbar.urls)),
                      path('__debug__/', include(debug_toolbar.urls)),
                  ] + urlpatterns

Youez - 2016 - github.com/yon3zu
LinuXploit