diff --git a/README.md b/README.md index 802fd9d..90838c8 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,19 @@ simple-ish! uses sqlite3 stored alongside the customer files. +## Development + +```shell +pipenv run python manage.py runserver +``` + + ## Compose Example ```yaml services: web_upload: + image: git.kitsunehosting.net/kenwood/smw-upload:latest volumes: - /var/seduttomachineworks/data:/app/store ports: @@ -21,4 +29,13 @@ services: - SECRET_KEY=your-very-secret-production-key - ALLOWED_HOSTS=yourdomain.com,localhost,127.0.0.1 restart: always -``` \ No newline at end of file +``` + +## Building and pushing notes + +``` +docker build -t git.kitsunehosting.net/kenwood/smw-upload:latest . --load +docker push git.kitsunehosting.net/kenwood/smw-upload:latest +``` + +(obviously you have to be me to do this) diff --git a/seduttomachineworks_project/urls.py b/seduttomachineworks_project/urls.py index b5ec606..2787d86 100644 --- a/seduttomachineworks_project/urls.py +++ b/seduttomachineworks_project/urls.py @@ -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) - diff --git a/seduttomachineworks_project/views.py b/seduttomachineworks_project/views.py index 2fd1736..56c94bc 100644 --- a/seduttomachineworks_project/views.py +++ b/seduttomachineworks_project/views.py @@ -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") diff --git a/templates/test_iframe.html b/templates/test_iframe.html new file mode 100644 index 0000000..7ef4cfa --- /dev/null +++ b/templates/test_iframe.html @@ -0,0 +1,224 @@ + + + + + + + Iframe Test - Quote Upload + + + + +
+

Iframe Embedding Test

+
+

Purpose: Test how the quote upload page appears when embedded in an iframe

+

URL:

+
+ +
+

Responsive Iframe (Auto Height)

+
+ +
+
+ + +
+ + + + +
+
+
+
+ + + + + \ No newline at end of file