minimal changes

This commit is contained in:
fjrodriguez
2022-12-22 14:08:17 -06:00
parent 53230f122f
commit bd2c214273
6 changed files with 22 additions and 28 deletions

View File

@@ -13,29 +13,22 @@ def response_error_handler(request, exception=None):
context={}
return render(request, '403.html',context,status=403)
def permission_denied_view(request):
raise PermissionDenied
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')),
path('accounts/', include('allauth.urls')),
path('DRF_Token/', obtain_auth_token, name='DRF_Token'),
path('', include('Clientes.urls')),
path('403/', permission_denied_view),
]
handler403 = response_error_handler
if settings.DEBUG: #DEV only
urlpatterns += static(settings.STATIC_URL, document_root= settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root= settings.MEDIA_ROOT)
# ROOT_URLCONF must specify the module that contains handler403 = ...
@override_settings(ROOT_URLCONF=__name__)
class CustomErrorHandlerTests(SimpleTestCase):