Add test iframe
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
"""
|
||||
URL configuration for seduttomotorsports project.
|
||||
"""
|
||||
|
||||
from django.urls import path
|
||||
from . import views
|
||||
from django.conf import settings
|
||||
from django.conf.urls.static import static
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.quote_upload, name='quote_upload'),
|
||||
path("", views.quote_upload, name="quote_upload"),
|
||||
]
|
||||
|
||||
if settings.DEBUG:
|
||||
urlpatterns += [
|
||||
path("test-iframe/", views.test_iframe, name="test_iframe"),
|
||||
]
|
||||
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from django.shortcuts import render
|
||||
from django.views.decorators.clickjacking import xframe_options_exempt
|
||||
from django.http import Http404
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
@xframe_options_exempt
|
||||
@@ -8,4 +10,10 @@ def quote_upload(request):
|
||||
Simple embeddable quote upload box.
|
||||
TODO: Implement file upload and email integration
|
||||
"""
|
||||
return render(request, 'quote_upload.html')
|
||||
return render(request, "quote_upload.html")
|
||||
|
||||
|
||||
def test_iframe(request):
|
||||
if not settings.DEBUG:
|
||||
raise Http404("Not available in production")
|
||||
return render(request, "test_iframe.html")
|
||||
|
||||
Reference in New Issue
Block a user