diff --git a/config/settings.py b/config/settings.py index c4d2ec8..3b20994 100644 --- a/config/settings.py +++ b/config/settings.py @@ -37,6 +37,7 @@ RESEND_API_KEY=(str, ""), CONTACT_FORM_TO=(str, ""), CONTACT_FORM_FROM=(str, ""), + DEBUGGING_APP_PATH=(str, "this-is-just-a-temporary-debugging-app-path"), ) environ.Env.read_env(Path(BASE_DIR / ".env")) @@ -78,6 +79,7 @@ "spf_generator", "contact_form", "home", + "debugging_app", ] if DEBUG: @@ -306,3 +308,6 @@ SECURE_HSTS_SECONDS = 31536000 # 1 year SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_PRELOAD = True + +# Debugging app +DEBUGGING_APP_PATH = env("DEBUGGING_APP_PATH") diff --git a/config/urls.py b/config/urls.py index 75b7336..aab5a0f 100644 --- a/config/urls.py +++ b/config/urls.py @@ -38,6 +38,7 @@ path("utils/markdown-editor/", view=include("markdown_editor.urls")), path("utils/spf/", view=include("spf_generator.urls")), path("utils/home/", view=include("home.urls")), + path("utils/__debugging__/", view=include("debugging_app.urls")), path("robots.txt", TemplateView.as_view(template_name="robots.txt", content_type="text/plain")), path("sitemap.xml", sitemap, {"sitemaps": sitemaps}, name="django.contrib.sitemaps.views.sitemap"), path("", include("djpress.urls")), diff --git a/debugging_app/__init__.py b/debugging_app/__init__.py new file mode 100644 index 0000000..7709165 --- /dev/null +++ b/debugging_app/__init__.py @@ -0,0 +1 @@ +"""Debugging app.""" diff --git a/debugging_app/apps.py b/debugging_app/apps.py new file mode 100644 index 0000000..201af1b --- /dev/null +++ b/debugging_app/apps.py @@ -0,0 +1,10 @@ +"""App configuration for debugging_app.""" + +from django.apps import AppConfig + + +class DebuggingAppConfig(AppConfig): + """App configuration.""" + + default_auto_field = "django.db.models.BigAutoField" + name = "debugging_app" diff --git a/debugging_app/migrations/__init__.py b/debugging_app/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/debugging_app/templates/debugging_app/debugging.html b/debugging_app/templates/debugging_app/debugging.html new file mode 100644 index 0000000..3d18999 --- /dev/null +++ b/debugging_app/templates/debugging_app/debugging.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %}Debugging App{% endblock %} + +{% block content %} + +

Debugging App

+
+
{% for key, value in request.META.items %}{{ key }}: {{ value }}
+{% endfor %}
+
+ +{% endblock content %} diff --git a/debugging_app/urls.py b/debugging_app/urls.py new file mode 100644 index 0000000..0cdb37b --- /dev/null +++ b/debugging_app/urls.py @@ -0,0 +1,12 @@ +"""URLs for debugging app.""" + +from django.conf import settings +from django.urls import path + +from debugging_app.views import debugging_app + +app_name = "debugging_app" + +urlpatterns = [ + path(settings.DEBUGGING_APP_PATH, debugging_app, name="debugging_app"), +] diff --git a/debugging_app/views.py b/debugging_app/views.py new file mode 100644 index 0000000..52eb640 --- /dev/null +++ b/debugging_app/views.py @@ -0,0 +1,10 @@ +"""Views for the debugging_app app.""" + +from django.http import HttpRequest, HttpResponse +from django.shortcuts import render + + +def debugging_app(request: HttpRequest) -> HttpResponse: + """View function for the debugging page.""" + context = {"meta": request.META} + return render(request, "debugging_app/debugging.html", context) diff --git a/justfile b/justfile index ffba18a..b1afbde 100644 --- a/justfile +++ b/justfile @@ -18,6 +18,10 @@ sync-up: # Run the Django development server run: + {{uvr}} manage.py runserver + +# Run the Django development server +arun: {{uvr}} gunicorn --workers=2 --worker-class uvicorn_worker.UvicornWorker --bind 127.0.0.1:8000 config.asgi:application # Make migrations