diff --git a/gdalface/urls.py b/gdalface/urls.py index b961de1..a8bdfb9 100644 --- a/gdalface/urls.py +++ b/gdalface/urls.py @@ -40,6 +40,7 @@ path('django-rq/', include('django_rq.urls')), # Add this for django_rq path('api/v1/', include('georeferencing.urls')), # Adjust the path to your app's API path('accounts/', include('allauth.urls')), # Add this for allauth + path('user-profile/', include('user_profile.urls')), # Add this for user_profile # Swagger and Redoc paths diff --git a/user_profile/templates/user.html b/user_profile/templates/user.html new file mode 100644 index 0000000..d4d8661 --- /dev/null +++ b/user_profile/templates/user.html @@ -0,0 +1,7 @@ +{% load i18n %} +{% load static %} +{% load bootstrap5 %} + +iaa +{{ user.email }} +{{ time}} \ No newline at end of file diff --git a/user_profile/urls.py b/user_profile/urls.py new file mode 100644 index 0000000..176baa5 --- /dev/null +++ b/user_profile/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from .views import UserView + +urlpatterns = [ + path('', UserView, name='user'), +] \ No newline at end of file diff --git a/user_profile/views.py b/user_profile/views.py index 91ea44a..b2c53e9 100644 --- a/user_profile/views.py +++ b/user_profile/views.py @@ -1,3 +1,22 @@ from django.shortcuts import render +from django.views.generic import TemplateView +from django.contrib.auth.models import User # Create your views here. +def UserView(request): + user = request.user + if user.is_authenticated: + time = user.userprofile.time_spent + geo = user.userprofile.geoattempts_done + cp = user.userprofile.controlPointsDone + che = user.userprofile.cheating + context = { + 'user': user, + 'time': time, + 'geo': geo, + 'cp': cp, + 'che': che, + } + return render(request, 'user.html', context) + return render(request, 'user.html') +