diff --git a/source/main/static/css/main.css b/source/main/static/css/main.css index 0c10983..38adeee 100644 --- a/source/main/static/css/main.css +++ b/source/main/static/css/main.css @@ -320,6 +320,18 @@ section#notice a { height: 2.9rem; } +/* LOGIN / LOGOUT */ + +#login-form { + width: 16rem; + margin: auto; + text-align: center; +} + +#login-form > * { + margin-top: .5rem; +} + /* ICONS; cfr: https://css.gg */ .gg-time { diff --git a/source/main/views.py b/source/main/views.py index 0cb8760..a407e55 100644 --- a/source/main/views.py +++ b/source/main/views.py @@ -44,3 +44,7 @@ def movie(request, id): def api(request): context = Movie.objects.api(request) return JsonResponse(context) + + +def error_404(request, exception): + return render(request, "404.html") diff --git a/source/mauflix/urls.py b/source/mauflix/urls.py index f5a2e96..50d31e3 100644 --- a/source/mauflix/urls.py +++ b/source/mauflix/urls.py @@ -17,4 +17,7 @@ urlpatterns = [ path("movie/", views.movie, name="movie"), path("ultimas/rss/", LatestMoviesFeed()), path("admin/", admin.site.urls), + path("user/", include("django.contrib.auth.urls")), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +handler404 = views.error_404 diff --git a/source/templates/404.html b/source/templates/404.html new file mode 100644 index 0000000..01fddf2 --- /dev/null +++ b/source/templates/404.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} + +{% block content %} + +
+
+

¡Ups! Página no encontrada.

+
+
+ +{% endblock %} diff --git a/source/templates/nav.html b/source/templates/nav.html index 77162a4..807897d 100644 --- a/source/templates/nav.html +++ b/source/templates/nav.html @@ -23,7 +23,11 @@ Acerca Ayuda - Ingresa + {% if user.is_authenticated %} + Salir + {% else %} + Ingresa + {% endif %} diff --git a/source/templates/registration/login.html b/source/templates/registration/login.html new file mode 100644 index 0000000..410524c --- /dev/null +++ b/source/templates/registration/login.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block content %} +
+
+
+ {% csrf_token %} + + + +
+
+
+{% endblock %}