Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django form now showing input fields
I've tried to fix this issue with chat GPT for a while now, but it says that everything okay, but it clearly ain't. For now I;m trying to just run the e-mail field before doing the rest. Here are my files: forms.py: from django import forms class SignupForm(forms.Form): email = forms.EmailField() password = forms.CharField(widget=forms.PasswordInput()) firstname = forms.CharField(widget=forms.TextInput()) lastname = forms.CharField(widget=forms.TextInput()) isOwner = forms.BooleanField() the form: <form method="post" action="{% url 'signup' %}" class="registerForm"> {% csrf_token %} {{ form.as_p }} <div class="header">Registration</div> <div class="loginText">E-mail:</div> <div class="loginInformation"> {{ form.email.label_tag }} {{ form.email }} </div> </form> and my controller: @api_view(('POST',)) @renderer_classes((TemplateHTMLRenderer, JSONRenderer)) def signup(request): if request.method == "POST": form = SignupForm(request.POST) if form.is_valid(): account = accountService.signup( request.POST["email"], request.POST["password"], request.POST["firstName"], request.POST["lastName"], request.POST["isOwner"] ) if account: return Response({'account': account}, template_name="index.html") return render(request, "signup.html") -
Input field using tailwind 2.2.16 in django form
I am using tailwind 2.2.16 in my Django project. I want to style the form, but the input fields are misbehaving and a weird looking border is encircling them. Please help me create a decent looking input field. <form method="post" class="bg-green-200 shadow-lg m-10 rounded p-10 w-2/5"> {% csrf_token %} <div class="mb-4"> <label class="text-gray-700 text-xl font-bold" for="username">Username</label> <div class="shadow appearance-none border rounded py-2 px-3 mr-10">{{form.username}}</div> </div> <div class="mb-4"> <label class="text-gray-700 text-xl font-bold" for="username">Password</label> <div class="shadow appearance-none border rounded py-2 px-3 mr-10">{{form.password}}</div> </div> <button type="submit">Login</button> </form> ]1 -
UpdateView can't update (Django, HTMX)
I'm working on a Django app similar to some streaming platforms, as I am building a portfolio. In the database management part (where I add, edit or delete films), I'm trying to use UpdateView (as I did on other projects) to update the films informations. The link works, I go to the edit page where the form is populated with the already existing informations, but when I save after an edit, I got my message 'This film is already in the database', a message I created that should only appears when I add a film (with a modal and an API call). It's not even in the same view... I've tried everything I could, searched for hours online to find a solution, but I'm still stuck. What I am trying to understand is what happens when I click on the save button. It looks like it redirects to the ManageFilmsView where it tries to create a new entrance to the database. Which is weird, as it is called UpdateView... Should I overwrite something in the UpdateView ? So, if somebody had the same problem, or can help me find a solution, it would be great ! (My code is probably … -
Designing a DRF-React App with Configurable Social and LDAP Authentication
I'm working on a DRF + React and aiming to implement various authentication methods, including social authentication (Google, Facebook, GitHub) and LDAP server integration. I want the flexibility to configure these authentication methods according to my requirements. Specifically, I would like to remove or add social authentication providers as needed. The key requirements are: Social authentication (Google, Facebook, GitHub). LDAP server authentication. Configurability to easily add/remove authentication providers. JWT-based session login authentication. I want to ensure that the solution is maintainable, scalable, and provides the desired flexibility in configuring authentication methods. Any examples or references to existing projects with similar setups would be greatly appreciated. This is what I am currently doing, I have configured a google auth which has a client based flow - Users click on sign in with google from frontend - Google returns a one time code - Then frontend send this code to backend and backend validates this with google and returns user details in form of jwt token - jwt token is stored on local storage, and this token is used to call each and every API as an authorisation header, if token is expired/invalid backend sends 403 forbidden and user is logged out. … -
How can I tell django how to revert custom migration?
I have two simple migrations: 0001_initial.py # Generated by Django 4.2.7 on 2023-11-30 11:15 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.RunSQL( """ CREATE TABLE comments ( id SERIAL PRIMARY KEY, created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, contents VARCHAR(240) NOT NULL ); """ ), ] 0002.py # Generated by Django 4.2.7 on 2023-11-30 11:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("polls", "0001_initial") ] operations = [ migrations.RunSQL( """ ALTER TABLE comments RENAME COLUMN contents to text; """ ), ] I run python manage.py migrate Then I want to undo the 0002 migration I run python manage.py migrate polls 0001 But Django does not know how to undo the changes from the second migration. How can I tell Django that for undoing the changes from the 0002 migration I need to run this SQL: ALTER TABLE comments RENAME COLUMN text to contents; I tried searching but without success. -
unsupported locale setting en DigitalOcean, Django y Python
tengo este error en producción en DigitalOcean, con un droplet Ubuntu 20.04, el proyecto es en Python con Django como framework. error Esta es mi función de home. home He estado intentado cambiar la variable LC_ALL en C, pero no soluciona el error. Estos es lo que me aparece al hacer el locale -a comando. locale -a comando -
Replacement for Fabric's Execute Function in Python 3.10
I'm in the process of updating a Python project that extensively uses the fabric.api module for remote command execution. The existing code relies heavily on the execute function, which has been removed from the newer versions of Fabric. My current Fabric version is 3.2.2. The execute function is used when working with different instances of the project. Here’s an example of how the execute function is currently used: if tmp_url == "innomanager": execute(delete_instance, "development", True, name) else: execute(delete_instance, "production", True, name) I’ve looked at the Fabric documentation for upgrading from older versions. According to the documentation, the execute function has not been rewritten yet for new versions of Fabric. Based on the documentation, it’s not clear how to achieve similar functionality without the execute function. How could I perform similar actions without the use of execute? -
How to get Django Organization Specific Microsoft Authentication working?
I know this is a broad question. I am currently trying to figure out how to get Django app to only accept organization specific Microsoft accounts. I do not need a step by step answer but some guidance on what I should go research or do. -
django-database-view get_str() depends on older source code version during django migrations
I am facing a problem in a project. There is django-database-view from https://github.com/manuelnaranjo/django-database-view used to inject SQL-Commands during the migrations into the database to create views. This worked in the past so far and the problem I have, did not show up for existing installations, where the original migration step had been already executed. Now, there was a change in the SQL-string of the DbView which is returned by get_view_str() and the original migration step fails, because CreateView calls internally get_view_str() and receives the string of the current version of the code base. However, this new string depends on db-tables which had been created after the original migration step, that´s why this step fails now. There is also a later migration step to apply the changes of the view, but that point is not reached anyway. As it is not possible for me to change the original migration step anymore because it is too far in the past and we can not roll back, I have to modify somehow the get_view_str() method of the DbView to return the proper one for the according migration step. This is a part of the original migration script: operations = [ CreateView( name='DbViewModelExample', fields=[ … -
DRF dynamic select field
class DealSerializer(serializers.ModelSerializer): organization = serializers.PrimaryKeyRelatedField(style={'placeholder': 'Организация'}, label='Организация', required=True, queryset=Organization.objects.all()) services = serializers.PrimaryKeyRelatedField( queryset=Service.objects.all(), many=True, label="Услуги", required=True) How to make sure that the services, or rather their queryset, change in the template depending on the choice of the organization? P.S. Each organization has its own services. It must work without reload page. -
SyntaxError: future feature annotations is not defined using python 3.9
I am using python 3.9 in a virtual environment. The only solution I can find just says to use python 3.7 or higher and try using a virtual environment to ensure it is. I am doing both and as you can see from the backtrace, it is indeed using 3.9. Internal Server Error: /api/auth/token-auth/ Traceback (most recent call last): File "/workspace/mktplace/env/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 165, in _get_response callback, callback_args, callback_kwargs = self.resolve_request(request) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/core/handlers/base.py", line 288, in resolve_request resolver_match = resolver.resolve(request.path_info) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/urls/resolvers.py", line 545, in resolve for pattern in self.url_patterns: File "/workspace/mktplace/env/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/urls/resolvers.py", line 589, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/workspace/mktplace/env/lib/python3.9/site-packages/django/urls/resolvers.py", line 582, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/workspace/mktplace/market/market/market/urls.py", line 47, in <module> path(prepath, include('reporting.urls'), name='payg_v1_reporting') … -
How to change the button name after performing the corresponding action?
In this code, the action is performed completely, but after adding the product to the list:: 1- The button doesn't change its name from Add to Remove. 2- The product information that's in watchlist.html is not displayed, that is, the output's: Products: Category: First Bid: $ views.py: @login_required(login_url="login") def watchlist(request, username): products = Watchlist.objects.filter(user = username) return render(request, 'auctions/watchlist.html', {'products': products}) @login_required(login_url="login") def add(request, productid): product_id = request.GET.get('productid', False) watch = Watchlist.objects.filter(user = request.user.username) for items in watch: if (items.watch_list.all) == int(productid): return watchlist(request, request.user.username) else: return remove(request, productid) new_watch = Watchlist(product_id, user=request.user.username) new_watch.save() messages.success(request, "The product has been added to your WatchList.") return product_detail(request, productid) @login_required(login_url="login") def remove(request, pid): list_ = get_object_or_404(Watchlist, pk = pid) messages.success(request, "The product was removed from your WatchList.") list_.delete() return redirect("index") product_detail.html: {% if product in watch %} <form method= "get" action = "{% url 'remove' product.id %}"> {% csrf_token %} <button type = "submit" value = "{{ product.id }}" name = "productid" >Remove from Watchlist</button> </form> {% else %} <form method= "get" action = "{% url 'add' product.id %}"> {% csrf_token %} <button type = "submit" value = "{{ product.id }}" name = "productid" >Add to Watchlist</button> </form> {% endif %} watchlist.html: {% … -
PostgreSQL - Custom ordering for each user's income for each item's price
I have two tables in Django Item column_name | data_type -------------+----------- id | integer price | integer User column_name | data_type -------------+----------- id | integer amount | integer Item's price rarely changes while user's amount might change once a day or more frequently. Ordering in Django need be done be like below. Show items whose price is less than or equal current user's amount (affordable) - order by item price high to low Then rest of the items (unaffordable) - order by item price high to low I need to show items in this order with pagination. We have around 200k items and around 100k users. Around 100 items are added per day. All these need to be updated whenever an item/user changes/added/removed. Django model from django.db import models class Item(models.Model): id = models.AutoField() price = models.IntegerField() class User(models.Model): id = models.AutoField() amount = models.IntegerField() I thought of creating an extra column but that will has to change for each call for all items. Has anyone built something like this? Should I use some other DB tool? I am open to suggestions. Thanks -
How to send pdf files with cyrillic text in django?
I'm trying to generate pdf files in django and upload them. To do this, I use the reportlab library. django v4.2.7 reportlab v 4.0.7 Here is a fragment of my code def patients_report_view(request): title = f'Отчет Выгрузка карт {datetime.now().strftime("%d.%m.%Y")}' response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = f'filename="{title}.pdf"' font_path = settings.STATICFILES_DIRS[0] + '\\fonts\\DejaVuSerif.ttf' pdfmetrics.registerFont(TTFont('DejaVuSerif', font_path, 'UTF-8')) p = canvas.Canvas(response) p.setFont('DejaVuSerif', 12) p.drawString(100, 100, "Привет мир.") p.showPage() p.save() return response I also installed some fonts for the Russian language, but still incomprehensible characters are displayed in the file. -
How to `annotate` in Django without using `LEFT OUTER JOIN`
Having models like Company, NotificationGroup and Notification I'm trying to sort by max notification importance Company.objects.annotate(max_importance="notification__importance").order_by("max_importance") By default djange generate LEFT OUTER JOIN for the annotate. MAX("grow_userrulenotification"."importance") AS "max_importance", MAX("grow_userrulenotificationgroup"."latest_timestamp") AS "max_timestamp" FROM "core_company_info_ukcompany" LEFT OUTER JOIN "grow_userrulenotificationgroup" ON ("core_company_info_ukcompany"."id" = "grow_userrulenotificationgroup"."uk_company_id") LEFT OUTER JOIN "grow_userrulenotification" ON ("grow_userrulenotificationgroup"."id" = "grow_userrulenotification"."notification_group_id") INNER JOIN "grow_userrulenotificationgroup" T4 ON ("core_company_info_ukcompany"."id" = T4."uk_company_id") INNER JOIN "grow_userrulenotification" T5 ON (T4."id" = T5."notification_group_id") how to force django to use existing INNER JOINS for aggregation functions? MAX(T5."importance") AS "max_importance", MAX(T4."latest_timestamp") AS "max_timestamp" FROM "core_company_info_ukcompany" INNER JOIN "grow_userrulenotificationgroup" T4 ON ("core_company_info_ukcompany"."id" = T4."uk_company_id") INNER JOIN "grow_userrulenotification" T5 ON (T4."id" = T5."notification_group_id") -
why is my chatbot is not sending responses when it does not have an error?
@csrf_exempt def home(request): if request.method == 'POST': data = request.body.decode("utf-8") try: data_json = json.loads(data) response = JsonResponse({'status': 'success'}, status=200) Thread(target=process_data, args=(data_json,)).start() return response except json.JSONDecodeError as e: return JsonResponse({'status': 'error', 'message': str(e)}, status=400) else: return JsonResponse({'status': 'invalid request'}, status=400) def process_data(data): chatID = data.get('waId') msg = data.get('text') if chatID and msg: try: track_obj, created = Track.objects.get_or_create(id=chatID) handle_message(track_obj, created, chatID, msg) except Exception as e: print(f"Error processing data: {str(e)}") def handle_message(track_obj, created, chatID, msg): if created: track_obj.status = "welcome" welcome_message = 'Welcome to AFC Insurance! I am here to assist you with any insurance-related queries or concerns. Whether you are looking for policy information, claims assistance, or need guidance, feel free to ask. Your peace of mind is our priority! How can I help you today?' sendMessage(chatID, welcome_message) options_message = "Choose an option:\n1. Register Vehicle\n2. Make a Claim\n3. Lodge a Complaint" sendMessage(chatID, options_message) track_obj.status = "home" track_obj.save() elif track_obj.status == "home": # Handle other cases for track_obj.status == "home" pass i tried everything i know in the book but its not showing any errors but its not sending any resonse. -
Paginate items after filtering by ajax
guys! I have a page with brands and two checkboxes list, category and country. I realized filter logic by jsonresponse, and ajax: its my filter view its my checkbox template its my js its a part of my page template my filter view work for and finally, all my page template looks like this its all work correctly. now I need add pagination, but I have a problem - my checkboxes filtering rendered by filter_data view, and my main page template rendered by another view, this: my main view so, when I try add paginate to my filter_date view, calculations my objects by paginator works good, but when i submit to the second page, logic stop working. I have no idea, how to realize this, please, help me ;) -
how can i save local file in django models
i want to save a local file in django model. and i am using this codes: with open('data.json', 'w') as file: file.write('somethings') myModel.objects.create(file=file, name='name') this codes save data.json in root path: root image but when i want to create model this codes raised following error: AttributeError: '_io.TextIOWrapper' object has no attribute 'field' how can i save data.json in myModel??? -
Celery progress bar isn`t being updated
i am developing some Django app, which generates reports. I am using celery to enable progress bar after hitting 'submit' button. The problem is that I cant figure out what i am missing and why ProgressRecorder isnt being set properly, so it stays at 0 always, although the task is being executed and i can get results of it. It is my celery task: @shared_task(bind=True) def regular_report(self, year: int, month: str, device_groups: list, prom_url: str): global speed, full_alias, short_alias, interfaces wb = Workbook() ws = wb.active progress_recorder = ProgressRecorder(self) # Define the column headers for the worksheet column_headers = ['Device Name', 'Interface', 'Description', 'ACDR Group (NIE only)', 'Port (G/Sec)', 'Speed (G/Sec)', f"Hyperlink to interface {month}-{year}", f'95th Util {month}-{year}',f'95th In {month}-{year}', f'95th Out {month}-{year}', f'Avg Util In {month}-{year}',f'Avg Util Out {month}-{year}', f'Max Util In {month}-{year}', f'Max Util Out {month}-{year}'] ws.append(column_headers) total_devices = [] for group in device_groups: total_devices += devices(group) done = 0 # Iterate through device groups for group in device_groups: device_list = devices(group) # Iterate through devices in the group for device in device_list: # Determine interfaces based on the group if group == "SOB": interfaces = info(queries(group, device, year, month, 'WAN')[4], 0, prom_url)[0] # getting all interfaces of … -
DJANGO-choicefield not appearing in website
views.py def remark_proof_api(request, room_id, bills_slug): submission_form = SubmissionForm() try: room = Room.objects.get(join_code=room_id) room_bills = bills.objects.get(room=room, slug=bills_slug) if request.method == "POST": data = json.loads(request.body.decode("utf-8")) submission_id = data.get("subId") status = data.get("status") if submission_id is not None and status in dict(Submission.STATUS_CHOICES).keys(): sub = Submission.objects.get(id=int(submission_id)) sub.status = status sub.save() return JsonResponse({"success": True}) except (Room.DoesNotExist, bills.DoesNotExist, Submission.DoesNotExist, json.JSONDecodeError, ValueError) as e: return JsonResponse({"success": False, "error": str(e)}) return JsonResponse({"success": False, "error": "Invalid request"}) models.py class Submission(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) bills = models.ForeignKey(bills, on_delete=models.CASCADE) proof = models.FileField(null=True) STATUS_CHOICES = (('P', 'Pending'), ('A', 'Accepted'), ('R', 'Rejected')) status = models.CharField(max_length=1, choices=STATUS_CHOICES, default='P') html {% extends "base/room_home.html" %} {% block content %} <div class="container d-flex align-items-center justify-content-center" style="min-height: 100vh;"> <div class="text-center"> <h1>{{ room_bills.title }}</h1> <p>Due: {{ room_bills.due }}</p> <div class="col-3"> <h3>Paid Members: </h3> <ul> {% for submission in submissions %} <li> <a href="proof/{{ submission.user.id }}" target="_blank">{{ submission.user.username }}</a> {% if submission %} <form class="statusForm" data-subid="{{ submission.id }}"> {% csrf_token %} {{ submission_form.as_p }} <button type="submit" class="btn btn-primary">Update</button> </form> {% endif %} </li> {% endfor %} </ul> </div> <div class="col-3"> <h3>Did not pay members: </h3> <ul> {% for user in did_not_submit %} <li>{{ user.username }}</li> {% endfor %} </ul> </div> </div> </div> <script> document.querySelectorAll('.statusForm').forEach(form => { form.addEventListener('submit', e => { … -
Malloc: double free error on M3 Macbook pro
I am working on a Django python project with a postgres db hosted with render.com. The code works fine on server and my imac. I recently got a Macbook Pro M3 (running sonoma). I have replicated the exact same setup and environment however when I try to run the code locally, I get Python(40505,0x1704f7000) malloc: double free for ptr 0x1368be800 Python(40505,0x1704f7000) malloc: *** set a breakpoint in malloc_error_break to debug The setup is the exact same on the other device and it works fine there. Here is the link to repo https://github.com/moreshk/django-postgres Any assistance would be useful. Setup https://github.com/moreshk/django-postgres on my new device. Setup virtual environment, any dependencies and installed requirements and .env file. Would have expected it to run fine locally. Other Django Python projects seem to work fine, except this one which has a postgres db with render.com When I try to run the code locally, I get the below error: python manage.py runserver Watching for file changes with StatReloader Performing system checks... System check identified no issues (0 silenced). Python(40505,0x1704f7000) malloc: double free for ptr 0x1368be800 Python(40505,0x1704f7000) malloc: *** set a breakpoint in malloc_error_break to debug -
How to convert a geodataframe in Django to json file and save it to MEDIA_ROOT?
I have two geodataframes and I want to clip them and save them as a json file in the local memory. I used the following codes for this: def clip_feature(request): gdf1 = gpd.read_file(firstJson.path, driver='GeoJSON') gdf2 = gpd.read_file(secondJson.path, driver='GeoJSON') clip = gpd.clip(gdf1, gdf2) save = clip.to_json() return JsonResponse({'somethings': True}) now i want to save 'clip' as json file in local memory. and to_json cant do this. How can I do this? -
I Want To Create AN API Of Notifcation App
I Created AN Notification App By Using The Django Channels, Websockt and Successfully Sending Notification To The Webscoketking.com, Now I Want To Create The API of This App For Sending The Notifications Of the Website, I Want To Create AN Api For Send The Notifications On Frontend But It Successfullly Sending Notification on Websocketking models.py from django.db import models from django.contrib.auth.models import AbstractUser from channels.layers import get_channel_layer from asgiref.sync import async_to_sync import json # Create your models here. class CustomUser(AbstractUser): """Model class for users""" USER_CHOICES = [ ('expert', 'Expert'), ('business', 'Business'), ('admin', 'Admin'), ] username = models.CharField(max_length=40, null=True, blank=True) full_name = models.CharField(max_length=40) email = models.EmailField(unique=True) password = models.CharField(max_length=40, null=False, blank=False) confirm_password = models.CharField(max_length=40, null=False, blank=False) user_choices = models.CharField(max_length=30, choices=USER_CHOICES, default='expert') USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['username'] def __str__(self) -> str: return f"{self.email}" class Notification(models.Model): account_user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) message = models.TextField() is_read = models.BooleanField(default=False) created_at = models.DateTimeField(auto_now_add=True) def save(self, *args, **kwargs): print('saving notification') channel_layer = get_channel_layer() notification_objs = Notification.objects.filter(is_read=False).count() data = {'count': notification_objs, 'current_notification': self.message} async_to_sync(channel_layer.group_send)( "test_group", { "type": "send_notification", "value": json.dumps(data) } ) super(Notification, self).save(*args, **kwargs) class AccountApproval(models.Model): account_user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) approved = models.BooleanField(default=False) approval_message = models.TextField(blank=True, null=True) COnsumers.py from channels.generic.websocket import WebsocketConsumer from asgiref.sync import async_to_sync import … -
Is there an easy way to suppress ResourceWarning when running tests -Wd
Is there a way on the Python or Django command line to suppress ResourceWarning when running tests with python -Wd i.e. python -Wd ./manage.py test ... A bunch of my tests don't close files, which is no problem because the test class instance which opened them goes away and that closes the file. I don't want to spend time editing all the tests. But fishing through the ResourceWarnings for the DeprecationWarnings is rather painful. -
Total worktime calculation displaying problem , Python, Django
[views.py 2 Html page |Django, where it is displaying the data ](https://i.stack.imgur.com/ahx95.png) Views.py 1 i am a beginner and i am building a project in python where you have a clock in clock out and break in break out for employees, so we can calculate the total worktime and i am getting the total calculated time but there is a problem when again calculating the same email(employee) the previous days date is also updating when its displaying on the html page(Django), only the date is being changed, is there something wrong with the way i am passing the data to the html page or is the problem how i print it ? i need the data of each employees worktime of every day in the table