Skip to content

Commit

Permalink
created user_profile app
Browse files Browse the repository at this point in the history
  • Loading branch information
frasanz committed Oct 17, 2024
1 parent 5d2e0f8 commit 1f0a89f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions gdalface/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions user_profile/templates/user.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% load i18n %}
{% load static %}
{% load bootstrap5 %}

iaa
{{ user.email }}
{{ time}}
6 changes: 6 additions & 0 deletions user_profile/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.urls import path
from .views import UserView

urlpatterns = [
path('', UserView, name='user'),
]
19 changes: 19 additions & 0 deletions user_profile/views.py
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 1f0a89f

Please sign in to comment.