Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Heroku: H18 right before my app should download .mp4
I'm having trouble with my app that generates 5-8sec videos. The entire request takes about 15 seconds, the app does all the steps required, but when it's time to download the video file it fails. I'm deploying the same python version as I run locally python-3.11.5. I'm running the app right now as we speak locally with no issue. Web console returns this error: generate-reel/:1 Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH (index):562 Error in generating reel: TypeError: Failed to fetch Headers have both Content-Length and Content-Type correctly, but when I go to "Response" theres nothing... I copied header: Request: POST /generate-reel/ HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, br, zstd Accept-Language: en-GB,en-US;q=0.9,en;q=0.8 Connection: keep-alive Content-Length: 14 Content-Type: application/json Cookie: sessionid=lcjfb0cgcd0fzth59hd95wg7g4jcl9m5; csrftoken=DcqP62fbGQkoyKTdR1tWnUrF2degrOLD; lastReset=Thu Apr 25 2024; usageCount=3 Host: vast-everglades-19722-937b6a99a857.herokuapp.com Origin: https://vast-everglades-19722-937b6a99a857.herokuapp.com Referer: https://vast-everglades-19722-937b6a99a857.herokuapp.com/ Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: same-origin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 X-CSRFToken: DcqP62fbGQkoyKTdR1tWnUrF2degrOLD sec-ch-ua: "Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99" sec-ch-ua-mobile: ?0 sec-ch-ua-platform: "macOS" Response: HTTP/1.1 200 OK Report-To: {"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1714013226&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=yq0l506BqIrW%2F3MHhVj%2Bj2D7GdjU4YvL1xFQNDkYycQ%3D"}]} Reporting-Endpoints: heroku-nel=https://nel.heroku.com/reports?ts=1714013226&sid=e11707d5-02a7-43ef-b45e-2cf4d2036f7d&s=yq0l506BqIrW%2F3MHhVj%2Bj2D7GdjU4YvL1xFQNDkYycQ%3D Nel: {"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]} Connection: keep-alive Server: gunicorn Date: Thu, 25 Apr 2024 02:47:23 GMT Content-Type: video/mp4 X-Frame-Options: DENY Content-Length: 8478634 Vary: Cookie X-Content-Type-Options: nosniff Referrer-Policy: same-origin Cross-Origin-Opener-Policy: same-origin Set-Cookie: sessionid=lcjfb0cgcd0fzth59hd95wg7g4jcl9m5; expires=Thu, 09 … -
When i press edit profile i get value error
trying to make an edit page where you can upload a profile picture and add various things to your profile, but when i click on edit profile i get "ValueError at /profile/ The 'profile_image' attribute has no file associated with it." models.py from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) full_name = models.CharField(max_length=50, null= True) designation = models.CharField(max_length=100, null= True) profile_image = models.ImageField(null=True, blank = True, upload_to="static/images/") profile_summary = models.TextField(max_length=300, null= True) city = models.CharField(max_length=100, null= True) state = models.CharField(max_length=100, null= True) county = models.CharField(max_length=100, null= True) @receiver(post_save, sender=User) def create_user_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender=User) def save_user_profile(sender, instance, **kwargs): instance.profile.save() urls.py from .views import HomeView, UserProfile, register, user_login, user_logout from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path("", HomeView.as_view(),name="home-page"), path("profile/", UserProfile.as_view(), name="user-profile"), path("register/", register, name="register"), path("login/", user_login, name="login"), path("logout/", user_logout, name="logout"), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) views.py from django.shortcuts import render, redirect from django.contrib.auth import login, authenticate, logout from .forms import RegisterForm from django.contrib.auth.forms import AuthenticationForm from django.contrib import messages from .models import Profile from django.core.files.base import ContentFile class HomeView(View): def get(self, request): return render(request, "home.html") def register(request): … -
ModuleNotFoundError: No module named 'project_name'
I tried to make 'load_data.py' file, but error confound me. Traceback (most recent call last): File "/Users/name/Downloads/Dev/culture/culture/api/load_data.py", line 4, in <module> from models import Theatre File "/Users/name/Downloads/Dev/culture/culture/api/models.py", line 4, in <module> class Theatre(models.Model): ... ModuleNotFoundError: No module named 'culture' The project has only one app 'api' and 'load_date.py' in it. Project name is 'culture'. settings.py: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'api.apps.ApiConfig', ] i tried export DJANGO_SETTINGS_MODULE=culture.settings but it didnt help. -
Single dropdown with values from two tables
I may be going about this entirely wrong. I'm new to Django, so sometimes the way I think of things doesn't seem to be the easy Django way to do it. I've got two tables: class LocationGroup(models.Model): #Fields ##Location Group ID - auto generated ID field id = models.AutoField('Location Group ID', primary_key = True) ##Location Group Name name = models.CharField('Location Group Name', max_length=200, help_text='Location Group name') def __str__(self): """String for representing the Model object.""" return self.name class Meta: verbose_name = "Location Group" verbose_name_plural = "Location Groups" and class Location(models.Model): #Fields ##Location ID - auto generated ID field id = models.AutoField('Location ID', primary_key = True) ##Location name name = models.CharField('Location Name', max_length=200, help_text='Location name') ##Location Group - link location to a Location Group group = models.ManyToManyField('LocationGroup', verbose_name='Location Group', blank=True, help_text='...') ...etc Then I have my forms.py calling as follows: class MyForm(forms.ModelForm): class Meta: model = Call fields = ['location', ...etc] This all works well and I can pick a location and add it to the database with the other values that are on that form/model. But what I'd like to do, is include the values from the locations plus the location groups. And to go further, if a value is picked … -
Django: how to store email credentials when sending email from a Django application
What is a standard or safe way to store my Google Workspace email credentials in my first Django project? I've tried to store the password in an .env file, but I get all kinds of error messages (e.g., "decouple module not recognized"--despite my alternately using pip install decouple and pip install python-decouple). But more importantly, I suspect it's not the best approach anyway. My research seems to whittle the options down to eliminating my password altogether and to somehow API into Google from within my app (to send out emails to my customers from my Google Workspace email). Is that would you recommend? Is there an simpler/better way? -
StreamingHttpResponse redirect it Django
I am facing problem in showing the status in the scanned this basically scans the QR of a Coupon and tells that weather the coupon is valid or not i have stored the status of each coupon in the database along with coupon id i have figured out the comparison part and to update the database But I'm not able to display the status of the i.e weather the coupon is valid or not the below is the camera.html code {% include 'header.html' %} <div class="w3-main" style="margin-left:300px;margin-top:60px;"> <div> <img src="/cameraOn/"> {{print}} kjhjvh </div> </div> {% include 'footer.html' %} The below is the views.py code def scan_qr(request): return render(request, 'camera.html') @gzip.gzip_page def cameraView(request): stat = False cam = qr_scanner.VideoCamera() return StreamingHttpResponse(gen(cam, stat), content_type = "multipart/x-mixed-replace;boundary=frame") def gen(camera, stat): while not stat: frame, stat = camera.get_frame() if stat: yield b'--text \r\n' + b'Content-Type: text/plain\r\n\r\n' + b'Hello\r\n\r\n' yield (b'--frame \r\n' b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n') The below is my qr_scanner.py import cv2 import threading from pyzbar.pyzbar import decode from services.models import Service class VideoCamera(object): thread_flag = True scanned_otp = 'no_data' def __init__(self): self.video = cv2.VideoCapture(0) _, self.frame = self.video.read() self.qr_scanned = False threading.Thread(target=self.update, args=()).start() def release_camera(self): self.video.release() self.thread_flag = False def get_frame(self): … -
Operating AI program by using WebODM plugin
I created an AI Python program and made the program screen visible through a plug-in. I try to run a program written in Python on that screen, but it doesn't work. How do I get it to run? To run an AI program, you must run Anaconda 3, run a virtual environment inside it (if it does not exist, create it and run it), and run it after completing the installation of the required programs. These must be included in the implementation process. I added new url ''' url(r'^airesults/$', app_views.aiwork, name='results') ''' in \WebODM\app\urls.py and create new function 'aiwork' in \WebODM\app\views\app.py and make new coreplugin 'aiwork' by copying and modifying the 'cloudimport'. -
How can I use stored procedures in Django with MySQL and run 'python manage.py migrate' without issues?
Context: I'm working on a project using Django with the Django REST framework to build an API. My database is MySQL, and I'm using XAMPP as my local development environment. Problem: I need to use stored procedures in my Django application to perform specific operations in my MySQL database. However, I'm facing difficulties integrating the stored procedures with Django, and I'm also experiencing issues when running python manage.py migrate. Additional Details: I have created stored procedures directly in my MySQL database using phpMyAdmin. I'm using Django's ORM to interact with the database in other parts of my application. I would like to be able to call the stored procedures from my Django application and run python manage.py migrate without errors to ensure that my database is properly synchronized with Django's models. Relevant Files and Code: utils.py - File containing the calls to the stored procedures. models.py - File where I define Django models representing my database schema. Questions: What is the best way to use stored procedures in Django, particularly with a MySQL database? How can I ensure that the stored procedures are compatible with Django's migration process (python manage.py migrate)? Are there any special considerations I should be aware … -
Seeing yellow lines below django.shortcuts in VS CODE
I'm new in Django, And I'm seeing yellow lines below everything I include from Django like django.db import models Seeing yellow lines on Django.db and model also in app.djando In all of the Django imported stuff The food is working totally fine but whenever i see a video there is nothing like this And as much as I know it generally shows when you haven't installed a Library or package When I hover on it, it shows "Import "django.shortcuts" could not be resolved from sourcePylancereportMissingModuleSource (module) shortcuts" I have tried like many solutions shown in Google result and also on chatgpt like Reinstalling the Django checking the typho mistakes Reinstalling python Updating all two latest version But I'm unable to find a solution -
Persistent storage in a Python app hosted in Heroku
I have an app that I recently deployed to Heroku. I wrote the app in Python utilizing the Django framework. When I create user accounts via my admin dashboard in the app I see the user accounts after being created. After a while has passed, I check and the new user accounts I created has disappeared. My thoughts are that this is down to allocated resources/dynos and everything is stored only for a session and once the session ends all changes are reverted to the state the app was in when first uploaded. The database is SQLite. I am trying to determine how I can have new users stay in the database or how other apps hosted on the platform (Heroku) allow user registration without the user accounts disappearing after a session ends. I have searched and read documentation on Heroku, Googled the problem and found nothing that matches my situation. One issue I read about mentioned an issue uploading static files that would disappear after sessions ended and how integrating 3rd party storage could resolve that. I understand that solution, but for user creation and registration, this would not be feasible. Thanks in advance! -
Django default connections.cursor() not parsing JSONB into DICT despite using PSYCOPG3
I am switching an old codebase from Django ~2 to Django 4.2.1. Along side this switch, I upgraded psycopg2 to psycopg (also known as psycopg3), but this switch has caused my cursor to incorrectly fetch rows from my PostgreSQL database. I am receiving STR instead of DICT when selecting JSONB objects in my database Important: When I use psycopg.connect directly, all of the behavior returns to what I expected. It is only when I am using the default django connection. from django.db import connection Here I fetch some json objects and check the type. with connection.cursor() as cursor: cursor.execute("select json_file from json_file") # These are of type jsonb for row in cursor.fetchall(): type(row[1]) This usually returns dict but is now returning str Here is my DATABASES variable in settings: 'default': {'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'db', 'PORT': 5432, 'CONN_MAX_AGE': None, 'CONN_HEALTH_CHECKS': False, 'ENGINE': 'django.db.backends.postgresql', } Here is Django's Connection + Cursor > connections['default'].connection <psycopg.Connection [IDLE] (host=db database=postgres) at 0x...> > connections['default'].connection.cursor() <django.db.backends.postgresql.base.Cursor [no result] [IDLE] (host=db database=postgres) at 0x...> Here is psycopg's Connection + Xursor > psycopg.connect("...") <psycopg.Connection [IDLE] (host=db database=postgres) at 0x...> > psycopg.connect("...").cursor() <psycopg.Cursor [no result] [IDLE] (host=db database=postgres) at 0x...> -
The problem with arabic language in xhtml2pdf django
Im useing xthml2pdf for generate invoice with arabic language. I searched a lot to solve the problem and followed all the steps, but I don't know why it doesn't work. Utils code: def render_to_pdf(template_src, context_dict={}): template = get_template(template_src) html = template.render(context_dict) result = BytesIO() pdf = pisa.pisaDocument(BytesIO(html.encode("UTF-8")), dest=result, encoding='UTF-8') if not pdf.err: return HttpResponse(result.getvalue(), content_type='application/pdf') View code: pdf = render_to_pdf('pdf/invoice.html'), context) if pdf: response = HttpResponse(pdf, content_type='application/pdf') filename = "invoice-%s.pdf" % invoice_number content = "inline; filename= %s" % filename response['Content-Disposition'] = content return response And finally the HTML code: <!DOCTYPE html> <html lang="ar" dir="rtl"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta charset="UTF-8"> <style> @font-face{font-family:samim; src: url('/assets/fonts/Shabnam-FD.ttf') } body{ background: #fff; font-family: samim !important; direction: rtl !important; } </style> </head> <body> <div> <pdf:language name="arabic"/> <p>سلام</p> </div> </body> </html> But what is generate in the end -
The problem of not generic refresh and access token for users
I have a problem with the code written with Python and Django framework I wrote a custom model and used Abstrcatuser in it, and instead of the username field, I used the phone number field. Now, when I enter the login address in the api I wrote and want to get the access token and refresh token, it creates only these things for the superuser and tells the other users that the phone number or password is wrong if they are also correct. I also use jwt. I tried to make some changes in the code, but I didn't find anything important -
clickable label for radio in django
i want to have clickable labels for my radio buttons in django but i cant click and the values are not registered in the database , its like just text <div class="probprior"> <div class="radio-container"> <label for="id_is_observer"> {{register_user_form.is_observer}} Observer </label> <label for="id_is_technician"> {{register_user_form.is_technician}} Technician </label> <label for="id_is_self_service"> {{register_user_form.is_self_service}} Self Service </label> <label for="id_is_staff"> {{register_user_form.is_staff}} Staff </label> </div> </div> and im using this style too in css file .radio-container input[type="radio"] {display: none;} .radio-container input[type="radio"]:checked + label {background: #F7B1AB;border: 1px solid rgba(0,0,0,.1);} -
Show two distinct column count in annotate Django
I'm getting trouble with annotate in Django. I have two models in projects. (just structure) model A (field:name(char)) model B (field:A(A; related_name="b"), user(user), content(char; null=True)) The data of model B is just like... row1 -> A:1, user:2, content:"content1" row2 -> A:1, user:3, content:"content2" row3 -> A:1, user:2, content:None row4 -> A:2, user:1, content:None row5 -> A:1, user:3, content:None My intention is a unique value that combines user and content according to the pk of model A being searched. If I look up pk:1 of Model A and the answer I want is 2, and the reason is as follows. row1 -> A:1, user:2 row2 -> A:1, user:3 So the orginal code was... A.objects.annotate(count=Count(Concat("b__user", "b__a), distinct=True)).get(pk=pk) However, a value error occurs when looking up model A that is not referenced in model B. (count:1) What can should do? -
Django model foreignkey null=false, but null value on select list on form
I've got the following model field: category = models.ForeignKey("QuestionCategory", on_delete=models.CASCADE, null=False, blank=False ) Is it proper behaviour of django, that rendering it in html form, on the select list there are all options (all categories) as well as "empty option", represented by "-----------" ? (as on the image here): enter image description here Still, if selecting that empty option and trying to save, there is validation error, that I need to select one of the element from the list... -
Two foreign keys in one model
I am making my first Django app and I am having trouble exporting some values. I have a model let's call it Machines with some attributes (buyer, name, model, serial number etc). My other model is a visit category model that has 2 reasons for the visit (service, inspection) Finally I have my last model that has visitDetails (date of visit, notes, reason of visit (which is visit category model foreign key, and machine details (which is Machines model foreign key). How can I get for each visitDetails the reason of visit? I managed to get all machineDetails for each Machine with: machine = Machines.objects.get(id=id) visit_details = machine.details.all() - details is relate_name for machine_details which is an object inside visitDetails model with foreign key Machines. But I cannot figure out how to also get visit category for each visit. -
Django And Netbox Error: Invalid permission name: . Must be in the format <app_label>.<action>_<model>
I recently updated from 3.4.5 to 3.7.4. Everything worked great with my customizations except for logins. I have Nginx running as a remotebackend, which creates the users. So the users are able to login when I make them a superuser, but when I try to assign permissions other than superuser, I get the error of "Invalid permission name: . Must be in the format <app_label>._." Not really sure what's going on as if I use a superuser, everything works great, and that data can be uploaded just fine. Looking for some help as to what the issue could be, as it could be with my plugins, but I dont think it is. -
Django Hot Reload
I am running docker image of a Django application with an entrypoint like this: export PYTHONUNBUFFERED=1 python3 manage.py runserver 0.0.0.0:8080 In settings.py DEBUG=True. However StatReloader doesn't seem to boot up (no logs regarding it's existence) to watch for module/.py file changes. Also there is mount configured so that the docker is aware of host changes and I have double checked it using docker exec. -
Permission denied error while deleting the image from directory media/mobile_images
view.py: if 'del_img2' in request.POST: product.image2.delete() img_path = os.path.join(settings.MEDIA_ROOT, str(product.image2)) print(img_path) os.remove(img_path) product.image2.delete() models.py class Mobiles(models.Model): id=models.AutoField(primary_key=True) name=models.CharField(max_length=50, blank=False, unique=True) actual_price=models.DecimalField(max_digits=10, decimal_places=2,blank=False) discount_price=models.IntegerField(validators=[MinValueValidator(0), MaxValueValidator(100)], default=0) selling_price=models.DecimalField(max_digits=10, decimal_places=2,default=0) review=models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(10)]) features=models.CharField(blank=False, max_length=5000) days=models.IntegerField(default=0) image1=models.ImageField(null=False, blank=False, upload_to='mobile_images/') image2=models.ImageField(null=True, upload_to='mobile_images/' , blank=True) While clicking on submit button Image is deleting from db and media/mobile_images but throwing an error : PermissionError at /admedit1/1 [WinError 5] Access is denied: 'D:\MyProjects\DjangoProjects\Elec&Gad\ElecAndGad\media\' Request Method: POST Request URL: http://127.0.0.1:8000/admedit1/1 Django Version: 4.2.5 Exception Type: PermissionError Exception Value: [WinError 5] Access is denied: 'D:\MyProjects\DjangoProjects\Elec&Gad\ElecAndGad\media\' Local vars D:\MyProjects\DjangoProjects\Elec&Gad\ElecAndGad\adminapp\views.py, line 105, in admedit1 os.remove(img_path) -
It is possible to set a title tab in django without to pass throught html?
Is it possible to set a page title in Django without going through the HTML file directly? I have data stored in my object, and I want to extract the name to set it as the title in my template. Essentially, I generate my views and URLs dynamically from the backend using HTTP requests. I'd like to know if there's a way to set the title dynamically without having to possess a .html file, as I generate my templates dynamically and don't have static .html files I except to set a title tab without passing through a .html file just from the .py files -
DJango rest-framework pagination without settings in REST_FRAMEWORK
I am following pagination help. It has para as You can also set the pagination class on an individual view by using the pagination_class attribute. Typically you'll want to use the same pagination style throughout your API, although you might want to vary individual aspects of the pagination, such as default or maximum page size, on a per-view basis. I set pagination_class in my ViewSet, but until I set REST_FRAMEWORK setting, it wont effect. REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination', 'PAGE_SIZE': 100 } When I set, it will set pagination for all view set, I have 10 views, but I want set pagination only on one view. Can I set pagination without setting in REST_FRAMEWORK parameter? -
how to access a django project when we are in the same network?
As you know, you can check django application by running this command: python3 manage.py runserver Let's say, there are 2 laptop which are sharing same internet network. When i run server for django app, i can access it on my browser from this address: http://127.0.0.1:8000/ But i would like to know if it is possible to access from another computer? I tried the same address but I could not access. My development stack is; Django version => 4.2.4 Python version => 3.11 How can i solve this issue? I tried to access from another laptop which sharing same network. i could not access. -
Heroku deploy with docker and poetry
I'm trying to deploy a django application on heroku. I use docker and poetry. I have a problem because in the dockerfile I install poetry and install dependencies using poetry. Locally it works fine, but when I want to deploy on heroku, the dependencies are not installed. Only putting code like: 'RUN pip install -r requirements.txt' installs the dependencies on heroku (I created the requirements.txt file using poetry export). Should I have two different Dockerfiles for dev and prod, where I will use poetry in one and pip install requirements in the other ? Or should I use multistaged Dockerfile or do you have any other suggestions ? My Dockerfile with potery: FROM python:3.11-alpine WORKDIR /code ENV PYTHONUNBUFFERED 1 ENV PATH "/root/.local/bin:$PATH" RUN apk add --no-cache curl \ && curl -sSL https://install.python-poetry.org | python3 - \ && apk add --no-cache postgresql-dev musl-dev COPY poetry.lock pyproject.toml /code/ RUN poetry install --no-root COPY . /code/ RUN poetry install heroku.yml: build: docker: web: backend/Dockerfile run: web: gunicorn core.wsgi:application --bind 0.0.0.0:$PORT -
How do I get out the doubles of the dropdown menu?
I have a dropdown in the index.html which shows duplicate values. These are displayed if I have e.g. 2 articles with the same ‘developer_id’ in index.html. I want that if several articles with the same value for the dropdown menu are get from the database, it is only displayed once in the dropdown menu. Can anyone help me with this? Thank you very much. view.py def index(request): return render(request, "auctions/index.html", { "auctions": Listing.objects.all() }) def sort_categories(request): if request.method == "POST": get_category = request.POST["developer_id"] dev = Games.objects.get(developer=get_category) sortobjects = Games.objects.values(developer_id=dev).distinct() #sortobjects = Games.objects.values("developer_id").distinct() #if dev == "": # messages.error(request, "Developer not in List") # return HttpResponseRedirect(reverse("article", args=(id, ))) get_article = Listing.objects.filter(developer_id=dev) all_dev = Listing.objects.all() #else: return render(request, "auctions/index.html", { "get_article": get_article, "all_dev": all_dev, "data": sortobjects }) models.py class Comment(models.Model): user_comment = models.ForeignKey(User, on_delete=models.CASCADE, blank=True, null=True, related_name="user_comment") listing = models.ForeignKey(Listing, on_delete=models.CASCADE, blank=True, null=True, related_name="listing_comment") comments = models.CharField(max_length=500) def __str__(self): return f"{self.user_comment} {self.listing} {self.comments}" index.html <form action="{% url 'sort_categories' %}" method="post"> {% csrf_token %} <label for="dev"></label> <!--<input type="text" name="dev" id="developer_id" placeholder="Developer">--> <select name="developer_id" id="developer_id"><br> {% for i in auctions %} <option value="{{ i.developer_id }}">{{ i.developer_id }}</option> {% endfor %} . . .