start adding dashboard page
This commit is contained in:
parent
aeb9e58ccf
commit
95d232e529
|
@ -100,6 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = '/dashboard'
|
||||||
|
|
||||||
AUTH_USER_MODEL = 'webui.User'
|
AUTH_USER_MODEL = 'webui.User'
|
||||||
|
|
||||||
|
|
|
@ -11,4 +11,18 @@
|
||||||
>Pricing</a
|
>Pricing</a
|
||||||
>
|
>
|
||||||
</div>
|
</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>
|
</nav>
|
||||||
|
|
|
@ -4,5 +4,6 @@ from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", views.index, name="index"),
|
path("", views.index, name="index"),
|
||||||
|
path("dashboard", views.dashboard, name="dashboard"),
|
||||||
path("auth/register", views.register, name="register"),
|
path("auth/register", views.register, name="register"),
|
||||||
]
|
]
|
||||||
|
|
|
@ -20,6 +20,10 @@ def index(request):
|
||||||
return render(request, 'index.html')
|
return render(request, 'index.html')
|
||||||
|
|
||||||
|
|
||||||
|
def dashboard(request):
|
||||||
|
return HttpResponse("Hello, world. You're at the polls index.")
|
||||||
|
|
||||||
|
|
||||||
def register(request: HttpRequest):
|
def register(request: HttpRequest):
|
||||||
|
|
||||||
# if the form is not submitted yet, return the form
|
# if the form is not submitted yet, return the form
|
||||||
|
|
Loading…
Reference in New Issue