diff --git a/app/item/migrations/0005_alter_comment_email_alter_comment_name_and_more.py b/app/item/migrations/0005_alter_comment_email_alter_comment_name_and_more.py new file mode 100644 index 0000000..a0f09e1 --- /dev/null +++ b/app/item/migrations/0005_alter_comment_email_alter_comment_name_and_more.py @@ -0,0 +1,51 @@ +# Generated by Django 4.2.3 on 2023-07-25 18:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("item", "0004_comment_session_key"), + ] + + operations = [ + migrations.AlterField( + model_name="comment", + name="email", + field=models.CharField(blank=True, max_length=1024), + ), + migrations.AlterField( + model_name="comment", + name="name", + field=models.CharField(blank=True, max_length=1024), + ), + migrations.AlterField( + model_name="comment", + name="published", + field=models.DateTimeField(blank=True, default=None, null=True), + ), + migrations.AlterField( + model_name="comment", + name="session_key", + field=models.CharField( + blank=True, default=None, editable=False, max_length=60, null=True + ), + ), + migrations.AlterField( + model_name="comment", + name="text", + field=models.TextField(default=""), + ), + migrations.AlterField( + model_name="item", + name="announced", + field=models.DateTimeField( + blank=True, default=None, editable=False, null=True + ), + ), + migrations.AlterField( + model_name="item", + name="description", + field=models.TextField(blank=True, default="", editable=False), + ), + ] diff --git a/app/templates/login.html b/app/templates/login.html new file mode 100644 index 0000000..9380368 --- /dev/null +++ b/app/templates/login.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% block head %} +Login - {{ settings.SITENAME }} +{% endblock %} +{% block content %} +
+
+ {% csrf_token %} + + + +
{{ error }}
+
+
+{% endblock %} diff --git a/app/templates/page.html b/app/templates/page.html new file mode 100644 index 0000000..9efaa1b --- /dev/null +++ b/app/templates/page.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% block head %} +{{ page.title }} - {{ settings.SITENAME }} +{% endblock %} +{% block content %} +
+ {{ page.content|safe }} +
+{% endblock %} + diff --git a/app/views.py b/app/views.py new file mode 100644 index 0000000..ac138aa --- /dev/null +++ b/app/views.py @@ -0,0 +1,21 @@ +from django.shortcuts import render +from django.http import HttpResponse + + +def robots_txt(request): + txt = '''User-agent: * +Disallow: +''' + return HttpResponse(txt, 'text/plain') + + txt = '''User-agent: * +Disallow: +Sitemap: {} +'''.format(request.build_absolute_uri('/sitemap.xml')) + return HttpResponse(txt, 'text/plain') + + +def sitemap_xml(request): + sitemap = '' + return HttpResponse(sitemap, 'application/xml') +