Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Profile page not retrieving/updating data
I am unable to fetch data or update data on my profile page. I have taken a look at network tab and have tried to adjust settings.py but have not been able to resolve the issue. When I go on the profile page, I get the following error: Forbidden: /accounts/profile/ "GET /accounts/profile/ HTTP/1.1" 403 58 On the network tab, it says this under Response: {"detail":"Authentication credentials were not provided."} On Cookies header, it says: This cookie was blocked because it had the SameSite=Lax attribute and the request was made from a different site and was not initiated by a top-level navigation I am using Django's built in session framework for simplicity but I ran into this issue. Here are relevant parts of code: Settings.py: DEBUG = True ALLOWED_HOSTS = [] AUTH_USER_MODEL = 'accounts.CustomUser' INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'accounts', 'corsheaders', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'corsheaders.middleware.CorsMiddleware', ] CORS_ALLOWED_ORIGINS = [ "http://localhost:8080", "http://127.0.0.1:8080", ] CORS_ALLOW_CREDENTIALS = True CSRF_COOKIE_SECURE = False SESSION_COOKIE_SECURE = False CSRF_COOKIE_HTTPONLY = False SESSION_COOKIE_HTTPONLY = False CSRF_COOKIE_SAMESITE = 'None' SESSION_COOKIE_SAMESITE = 'None' REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework.authentication.SessionAuthentication', ], } Here is UserProfile.vue: <template> <div> <h1>User Profile</h1> <form … -
geoDjango location api
Please I want to If I can create a website for my university that include map for students to search for specific location in the school. To know if I am able to do, or if it will not work, please suggest me other framework to use. -
PDFViewer for Django
I'm struggling to find a solution to embed a PDF Viewer into my Django website. Currently, I'm using an iframe to display a PDF, but now I want to enable annotations on the PDF directly on the website. The only option I've come across is using PDF.js, but it requires having Node.js alongside Django, and that introduces a host of other challenges. Does anyone know of an alternative approach to achieve this? Thanks! -
Zobrazení nahraných souborů v Django5
Django5 still shows me page not found for my uploaded files. Here are my files, please where is my error, I don't know what to do anymore. urls.py if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) settings.py MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'uploads') models.py class Tutorial(SoftDeleteModel): image = models.ImageField(upload_to='') My images are uploaded in the uploads folder at the same level as the manage.py file. Thanks for your advice. -
Display Loading Screen While Processing Form Data in Django View
In Django I have an app that displays welcome message and empty form and then after submiting the form it displays processed data instead of welcome message and the same form in the same place as before, so user can input new data and submit it again. Simplified view code looks like this: def my_view(request): if request.method == "POST": my_form = MyForm(request.POST) if my_form.is_valid(): # Do some calculations return render(request, 'myapp/my_template.html', {"calculations_results":calculations_results}) else: my_form = MyForm() welcome_message = "Hello" return render(request, 'myapp/my_template.html', "welcome_message":welcome_message) And here is html code: <div class="main-div"> {% if welcome_message %} <div class="welcome-mess-div"> <div class="welcome-mess-div-2"> <h1 class="white-text">Hello!</h1> <br> <br> <h5 class="white-text">Welcome to my website, nice to meet you!</h4> </div> <div class="loading-screen"> <h1>Loading...</h1> </div> </div> {% else %} <div class="results"> {% for result in calculations_results %} <p>{{result}}</p> {% endfor %} </div> </div> <div class="form-div"> <form id="my-form" method="post" enctype="multipart/form-data" onsubmit="displayLoadingScreen()"> {% csrf_token %} {{form.input}} <button type="submit"></button> </form> </div> Please note, that because of the if statement ({% if welcome_message %}), it's possible to use only one template for this. As processing form data takes a while, I want to add a loading screen. I already managed to that when submitting the form is done form the 'welcome_message' perspective (GET … -
Getting 502 Bad Gateway error on nginx proxy manager with gunicorn
I am currently using nginx proxy manager in conjunction with Gunicorn: gunicorn main_app.wsgi:application --bind 0.0.0.0:8000 Everything functions properly when I select HTTP, as shown in the image. However, the only drawback is that static files are not loading because they cannot be located, resulting in a "Not Found: /static/" error. Upon switching to HTTPS, a 502 gateway error is encountered. The following error is logged: my-portfolio-app | [2024-01-27 18:26:18 +0000] [8] [INFO] Starting gunicorn 21.2.0 my-portfolio-app | [2024-01-27 18:26:18 +0000] [8] [INFO] Listening at: http://0.0.0.0:8000 (8) my-portfolio-app | [2024-01-27 18:26:18 +0000] [8] [INFO] Using worker: sync my-portfolio-app | [2024-01-27 18:26:18 +0000] [10] [INFO] Booting worker with pid: 10 my-portfolio-app | [2024-01-27 18:27:23 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:10) my-portfolio-app | [2024-01-27 23:27:23 +0500] [10] [INFO] Worker exiting (pid: 10) my-portfolio-app | [2024-01-27 18:27:23 +0000] [8] [ERROR] Worker (pid:10) exited with code 1 my-portfolio-app | [2024-01-27 18:27:23 +0000] [8] [ERROR] Worker (pid:10) exited with code 1. When running the application via python manage.py runserver 0.0.0.0:8000 with the scheme set to HTTP, everything works as expected, and static images are loaded. However, I prefer to use Gunicorn. here are my docker-compose files. Django docker-compose file version: '3' services: django_app: container_name: my-portfolio-app volumes: … -
Auto-populating BaseModel fields Django model
I have a base model class which is: class BaseModel(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) created_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='%(class)s_createdby', null=True, blank=True, on_delete=models.DO_NOTHING) updated_by = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='%(class)s_updatedby', null=True, blank=True, on_delete=models.DO_NOTHING) class Meta: abstract = True And all my objects extend this parent class. I want it to automatically adjust the data for created_by and updated_by whenever user .save() the objects(either create or update). And I don't want to manually pass the user every time. I'm graphene and here's an example where I adjust the object and I don't want to pass the updated_by manually. class CreateWorkspace(graphene.Mutation): workspace = graphene.Field(WorkspaceType) class Arguments: name = graphene.String(required=True) description = graphene.String(required=False) @login_required def mutate(self, info, name, description): workspace = Workspace(name=name, description=description) return CreateWorkspace(workspace=workspace) Is there any automated way of doing it without the need to add a code for each subclass? -
Django webapp does not set azure variables
Oke so my main issue is that my django backend that is deployed cannot read Azure env variables. Context: For context i am using github actions to deploy my application. The workflow makes a docker image out of a docker file, then pushes it to my docker registry. After that does the usual installing python packages needed for the app and making migrations for the database. In my local enviroment i am using docker compose with a .env file and this works good, but now that i am deploying the app to azure in a docker container i get issues. My main reason is because i do some logging in my settings.py and also i try to make a user in my database, but i get an error that it can't find my "key" which is correct because before the error i am printing some env values which are empty aswel. root@905a7777498c:/usr/src/app# python manage.py createsuperuser key openai None key db name None key db user None Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in main execute_from_command_line(sys.argv) File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File … -
Is there a way to prevent self-deletion of the superuser user in Django?
I need to restrict the self-deletion of super users in django admin (maintaining the ability to edit): If trying to self-delete it should result in a validation error Super user must maintain the ability to remove other users, so has_delete_permission() is not an option for me. I have tried using signals: @receiver(pre_delete, sender=User) def delete_user(sender, instance, **kwargs): if instance.is_superuser: raisePermissionDenied but, it results in HTTP status 403 and not Validation Error. Now I am trying using a custom user admin, where I have tried several methods (override save method, override form), but probably due to my inexperience with django I don't know if this approach is correct. So I turn to those who can help me. Thank you so much -
I have a problem creating a diary with Django
I am making a diary with Django. [urls.py] from django.urls import path from . import views urlpatterns = [ path('', views.diary_index, name = "diary-index"), path('int:month/', views.diary_date , name = "diary-date"), path('int:month/int:day/', views.diary_list, name = "diary-list"), [view.py] def diary_date(request, month) : day = HaruDiary.objects.filter(dt_created__month = month) context = {"month":month} return render(request, "change/diary_date.html", context) def diary_list(request, month, day) : day = HaruDiary.objects.filter(dt_created__month = month, dt_created__day = day) context = {"day":day} return render(request, "change/diary_list.html", context) [Button to select month - html] {% for num in "x"|rjust:"12" %} {{ forloop.counter }} {% endfor %} [After selecting the month, a button to select the day on another page] 01 I don't want to specify the month, but if I don't specify the month by putting int:month/int:day in urls.py, an error keeps popping up. Is there any way to fix this??..Please help... I tried a lot of things through ChatGBT, but I wrote and deleted it, so I don't have any data. I'm sorry. -
Check Constraint in Django
I want to include a check constraint for my model in my members app where the sex field should be male, female or null. Here is my code: from django.db import models from django.db.models import CheckConstraint, Q # Create your models here. class Member(models.Model): firstname = models.CharField(max_length=255) lastname = models.CharField(max_length=255) telephonenum = models.IntegerField(null=True) sex = models.CharField(max_length=10, null=True) CheckConstraint(check=Q((sex == "Female") | (sex == "Male")), name="check_sex") This code is not working I can still make sex field something different than Female or Male. I've tried this code but it didn't work either: from django.db import models # Create your models here. human_sex = ( ("1", "Woman"), ("2", "Man"), ) class Member(models.Model): firstname = models.CharField(max_length=255) lastname = models.CharField(max_length=255) telephonenum = models.IntegerField(null=True) sex = models.CharField(max_length=10, choices=human_sex, null=True) -
What is the best framework for backend? [closed]
I am learning programming to set up an internet store for myself. I have learned css, html, javascript, react, next for the front end and now I wanted to see what your suggestion is for the back end? Considering that I have no programming experience and I am not going to continue this course. But I will definitely need a lot of help in the future. I have reviewed the following languages and frameworks node JS Laravel Django -
Django project, Assertion Error: 200 != 302
I am trying to get my tests to run successfully and I am not sure what I am missing with this. here is my tests.py from django.test import TestCase, Client, override_settings from .forms import CommentForm, PostForm, PostEditForm from django.urls import reverse from .models import Post from django.http import HttpResponseRedirect from django.views.generic.edit import CreateView from django.contrib.auth.models import User from django.urls import reverse_lazy class PostTests(TestCase): def setUp(self): self.user = User.objects.create_user(username='testuser', password='testpassword') self.post = Post.objects.create( title='Test Post', content='This is a test post content.', author=self.user, ) def tearDown(self): if hasattr(self, 'user'): self.user.delete() if hasattr(self, 'post'): self.post.delete() def test_post_detail_view(self): response = self.client.get(reverse('news:post_detail', kwargs={'slug': self.post.slug})) self.assertEqual(response.status_code, 302) def test_post_add_view(self): self.client.force_login(self.user) response = self.client.post(reverse('news:post_add'), data={'title': 'New Test Post', 'content': 'Test content'}) self.assertEqual(response.status_code, 302) self.assertRedirects(response, reverse('news:post_detail', kwargs={'slug': 'new-test-post'})) new_post = Post.objects.get(title='New Test Post') self.assertEqual(new_post.author, self.user) self.assertRedirects(response, reverse('news:post_detail', kwargs={'slug': new_post.slug})) views.py: from django.shortcuts import render, get_object_or_404, reverse, redirect from django.views import generic, View from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic import ListView from django.views.generic.edit import CreateView, DeleteView from django.views.generic.detail import DetailView from django.utils.text import slugify from django.urls import reverse_lazy from django.http import HttpResponseRedirect from .models import Post, Category, Article from .forms import CommentForm, PostForm, … -
how to use same url and class for put, get, post, delete functions in drf class base api
in my views file I want to have this logic: class Articles(APIView): def get(self, reqeust, id): #logic def put(self, request, id): #logic def post(self, requst, id): #logic def delete(self, request, id): #logic and I want handle urls like this : /articles/int:pk # articles shows with id=pk /articles/add # add article to db and so on... but I have problem that I dont want to use different class and at the same time i want that if I call /articles/add post method call , what is the best way to implement this? sry I'm very new to python and drf, I will be thanks to help me to do this in best way, is the way I'm thinking to handle this totally wrong? I just I don't want to have different class in APIView approach using drf for every single post, get, ... ones. -
How can I insert a QR code reader in my django application to verify if a code exists on the database?
I have a django app of musical show tickets that a QR code is generated and saved on the database after every sale of a ticket. Now I'm trying to create a page that will read these QR codes to verify if it exists on the database. HTML: <h1>QR code reader</h1> <video name="qr-video" id="qr-video" width="100%" height="100%" autoplay></video> <script> const video = document.getElementById('qr-video'); navigator.mediaDevices.getUserMedia({ video: { facingMode: 'environment' } }) .then((stream) => { video.srcObject = stream; return new Promise((resolve) => { video.onloadedmetadata = () => { resolve(); }; }); }) .then(() => { video.play(); const canvas = document.createElement('canvas'); const context = canvas.getContext('2d'); canvas.width = video.videoWidth; canvas.height = video.videoHeight; setInterval(() => { context.drawImage(video, 0, 0, canvas.width, canvas.height); const imageData = context.getImageData(0, 0, canvas.width, canvas.height); const code = jsQR(imageData.data, imageData.width, imageData.height); if (code) { alert('QR code read: ' + code.data); sendQRcode(code.data); } }, 1000); }) .catch((error) => { console.error('Error trying to access camera: ', error); }); function sendQRcode(code) { alert('QR code sent') const url = 'https://ac7-1bd37c9a12e8.herokuapp.com/show/scanner/'; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': getCookie('csrftoken') }, body: JSON.stringify({ code: code}), }) .then((response) => { response.text().then((text) => { alert('Response from server:', text); }); if (!response.ok) { throw new Error('Network response was not ok'); … -
Django frontend convenient handle different responses
I am unsure how to deal with different return options in Django. Let me describe a fictive scenario: I have an endpoint /books/5/ that returns an html showing infos about the book and the chapters it contains. Those are reachable at /books/5/chapters/ and /books/5/chapters/3/ for example. I can make a POST to /book/5/chapters/ via a form with title etc. to create a new chapter. This can either succeed and a new chapter is created or it can fail, because of whatever reason. To make my frontend a bit convenient I included the form to create chapters at the endpoint /book/5/. So I can see the books details and chapters and enter details for new chapter in this view in the form and click create. My desired experience would be that I get a refresh of the /book/5/ to see the new state. If the post failed I would like to see a notification with the error message. Is there a standard way how to do this? I have played around with JsonResponse and returning the next URL to go to and calling the endpoint with a JavaScript function that sets the current window to it. Vut I don't know how … -
post_save seams has bug
my simplified problem is below: i have a model like this: class Alert(models.Model): ALERT_CHOICES = [("email","email"),("sms","sms"),("notif","notif")] name = models.CharField(max_length = 50) owner = models.ForeignKey(User , on_delete=models.CASCADE) coins = models.ManyToManyField(Coin,blank=True) when an object of Alert like alert changes. i want to print number of coins that connected to alert after change in this method: @receiver(post_save, sender=Alert) def handle_alert_save(sender, instance, **kwargs): coins = instance.coins.all() print(len(coins)) Unfortunately! it prints number of coin before change alert. i want after change the object. in other words post_save signal is exactly equal to pre_save. for example when i have 2 connected coin to aler and i change it to 5. it prints 2! i try all other signals like pre_save and pre_delete and pre_migrate and post_migrate. -
Django Aws ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
I am trying to upload my static files to Amazon S3 from my django project using boto3 and django-storages modules. Here is the AWS S3 configurations in my settings.py file AWS_ACCESS_KEY_ID = "<public-key>" AWS_SECRET_ACCESS_KEY_ID = "<private-key>" AWS_STORAGE_BUCKET_NAME = "<bucket-name>" STORAGES = { # Media files (images) management "default": { "BACKEND": "storages.backends.s3boto3.S3StaticStorage", }, # CSS and JS file management "staticfiles": { "BACKEND": "storages.backends.s3boto3.S3StaticStorage", }, } AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com' AWS_S3_FILE_OVERWRITE = False I have given AmazonS3FullAccess permission policy to the IAM user. and here is my bucket policy: { "Version": "2012-10-17", "Id": "Policy1706347165594", "Statement": [ { "Sid": "Stmt1706347164281", "Effect": "Allow", "Principal": "*", "Action": "s3:*", "Resource": "arn:aws:s3:::<bucket-name>/*" } ] } previously I only gave PutObject action it didn't work. I was gettting the same error given below. Im using the python manage.py collectstatic command to upload to S3 You have requested to collect static files at the destination location as specified in your settings. This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: yes Traceback (most recent call last): File "/home/gajeet/Documents/Django/Django_ultimate/dev2/manage.py", line 22, in <module> main() File "/home/gajeet/Documents/Django/Django_ultimate/dev2/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/home/gajeet/Documents/Django/Django_ultimate/dev2/.venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File … -
Unable to Push to Bitbucket Repository: Git Push Error
hi everyone I tried to push some project into bit bucket but it just gives me the message of permission denied(public key) fatal: could not read from remote repository. and idk why i entered every thing just like the book. thank you so much for answering. I tired re writing the project or trying with my other codes but the problem is still there. -
Celery does not see objects in SQLite (in Docker)
I have project on Django, DRF, SQLite, RabbitMQ and Celery. When I run the project locally (separately rabbitmq, celery and django), everything works correctly. But when I run it in Docker, the task in celery does not find an object in the database. Attempts to find the created task from the celery container shell are also unsuccessful (I only see old objects). If I enable CELERY_TASK_ALWAYS_EAGER=True setting, then everything works fine in Docker. settings.py DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "db.sqlite3", } } docker-compose.yaml version: "3.7" services: rabbitmq: restart: always container_name: "rabbitmq" image: rabbitmq:3-management-alpine ports: - 5672:5672 - 15672:15672 app: restart: always container_name: "fbrq_api" build: . volumes: - .:/code command: python3 manage.py runserver 0.0.0.0:8000 ports: - "8000:8000" celery: restart: always container_name: "celery" build: context: . command: celery -A fbrq_api worker -l info env_file: - ./.env depends_on: - app - rabbitmq environment: - CELERY_BROKER_URL=amqp://guest:guest@rabbitmq:5672/ celery.py import os from celery import Celery os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fbrq_api.settings") app = Celery("fbrq_api", broker="amqp://guest:guest@rabbitmq:5672/") app.config_from_object("django.conf:settings", namespace="CELERY") app.autodiscover_tasks() @app.task(bind=True, ignore_result=True) def debug_task(self): print(f"Request: {self.request!r}") I understand that SQLite is not the best choice, but I think it's not about the database itself, but about the connection between Celery and the database. -
Get Value of Iterable Element
I have a list as shown below. Now I want to get the values of each radio button when clicking on it. However, I get always the first value since the IDs (list-name) will be the same when rendered out the list. Is there a simple way to do so? Maybe with onclick=function(this) <form id="form-1"> {% for u in user %} <li> <div> <input id="list-name" type="radio" value="{{ u.name }}" name="list-radio"> <label for="list-name">{{ u }}, {{ u.name }}</label> </div> </li> {% endfor %} </form> <script> $(document).on('change', '#form-1', function (e){ console.log($('#list-name').val()) } </script> -
Merge video and audio using ffmpeg and download immediately in django
I have video and audio file which is to be merge and download automatically. I have written some code but it will start download after merged. I want when user hit the url, then it will start merging and downloading immediately so that user don't have to wait for it. video_url = "./video.mp4" audio_url = "./audio.mp4" output_filepath = './merged.mp4' try: process = subprocess.Popen([ "ffmpeg", "-i", video_url, "-i", audio_url, "-c:v", "copy", "-c:a", "copy", "-f", "mp4", "-movflags", "frag_keyframe+empty_moov", "pipe:1" ], stdout=subprocess.PIPE) def generate_stream(): while True: data = process.stdout.read(1024) if not data: break yield data response = StreamingHttpResponse(generate_stream(), content_type="video/mp4") response['Content-Disposition'] = 'attachment; filename="stream.mp4"' return response except subprocess.CalledProcessError as e: return HttpResponse("Error: {}".format(e), status=500) But it will merge and then start downloading. I want to be at same time so that user don't have to wait until the merging process. I am using django and i am learning django -
How to make a div overflow beyond its parent's boundaries when hovered over?
for starters, here is code that works: {%for movie in topRated%} <div class="container2"> {%with base_url="https://image.tmdb.org/t/p/original/"%} <img class="img-1" src={{base_url}}{{movie.poster_path}}> {%endwith%} <div class="info2"> <div class="year-rating"> <span class="yrtext">{{movie.release_date}}</span> <span class="yrtext">{{movie.vote_average}}</span> </div> <div class="movietitle2"> <a href="{% url 'movieDetails' movie.id %}" class="movietitlespan">{{movie.title}}</a> </div> </div> </div> {%endfor%} </div> the css code for the above is the following: .moviePage .indexdiv2 .flow-into2{ margin-top: 30px; display: flex; align-items: start; flex-direction: column; padding-left: 25px; } .moviePage .indexdiv2 .container2{ width: 400px; height: 150px; display: flex; flex-direction: row; border-radius: 7px; /*overflow-x: hidden; overflow-y: visible;*/ position: relative; margin-top: 10px; margin-bottom: 25px; scale: 1; transition: transform 0.3s ease; /* Apply transition to .container2 */ z-index: 10; } .moviePage .indexdiv2 .container2:hover { transform: scale(1.5); /* Scale the entire container on hover */ z-index: 100; } .moviePage .indexdiv2 .number-icon{ margin-right: -20px; height: 50px; width: 50px; z-index: 5; position: relative; } .moviePage .indexdiv2 .img-1{ height: 149px; position: relative; z-index: 2; scale: 1; transition: scale 0.3s ease; } As you can see from the above, the code works where i hover over the container, it scales up and above its parent div and sister elements, which is shown in the following image: and this. the problem lies in the following code, which aims to have a similar behaviour, … -
I am using a Hostinger VPS cloudhost to host a django Backend , everything working fine while hosting IP address and port but not in domain?
Hosting Problem Its showing like this , But in IP address its is working fine all the images are fetching from backend... See this also coming like this but its working in IP address with port its working fine ,while in domain its not working or posting the form if i check the hosting method its working fine but its not working good in my domain ,do i have to change something in server conf file -
When I write a python django for loop, it does not return the data I created in the model [closed]
I can see everything I defined in the model in the admin panel, but when I write a for loop in html, the data I defined does not appear. this is my model: enter image description here this is my view: enter image description here this is my url: enter image description here this is my for loop code: enter image description here this is my admin panel: enter image description here after writing for loop code: enter image description here before writing for loop code: enter image description here I would be very grateful if you can help me where I made a mistake. Thank you in advance.