start adding dashboard page

This commit is contained in:
James Ravenscroft 2024-12-07 21:30:55 +00:00
parent aeb9e58ccf
commit 95d232e529
4 changed files with 20 additions and 0 deletions

View File

@ -100,6 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
LOGIN_REDIRECT_URL = '/dashboard'
AUTH_USER_MODEL = 'webui.User'

View File

@ -11,4 +11,18 @@
>Pricing</a
>
</div>
<div>
{% if user.is_authenticated %}
<a
href="{% url 'dashboard' %}"
class="bg-blue-500 text-white px-6 py-3 rounded-lg hover:bg-blue-600 transition duration-300"
>My Dashboard</a
{% else %}
<a
href="{% url 'register' %}"
class="bg-blue-500 text-white px-6 py-3 rounded-lg hover:bg-blue-600 transition duration-300"
>Get Started</a
>
{% endif %}
</div>
</nav>

View File

@ -4,5 +4,6 @@ from . import views
urlpatterns = [
path("", views.index, name="index"),
path("dashboard", views.dashboard, name="dashboard"),
path("auth/register", views.register, name="register"),
]

View File

@ -20,6 +20,10 @@ def index(request):
return render(request, 'index.html')
def dashboard(request):
return HttpResponse("Hello, world. You're at the polls index.")
def register(request: HttpRequest):
# if the form is not submitted yet, return the form