Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to filter Django model for AND and OR simultaneously
Let's say I have a User model and a Dataset model. I want to get all datasets that (have a certain type AND (belong to a certain user OR don't belong to anyone)). What is the best approach to achieve this? Code sample: class User(AbstractUser): username = models.CharField(max_length=150,unique=True,) first_name = models.CharField(blank=True, max_length=150) last_name = models.CharField(blank=True, max_length=150) class Dataset(models.Model): name = models.CharField(null=False, unique=True, max_length=50) type = (models.PositiveIntegerField()) UserID = models.ForeignKey( User, null=True, blank=True, on_delete=models.CASCADE, related_name="ds_owner", ) I am trying to figure out how to select something like this: def view_name(request): usr = User.objects.get(id=request.user.id) allowed_datasets = Dataset.objects.filter(type=1 AND (UserID=usr OR UserID__isnull=True)) -
Validate Django form field before sumbitting
Django form has file field and clean_file method. class UploadFileForm(forms.Form): file = forms.FileField() def clean_file(self): ... And there is a button called 'Apply' I want to validate the file when I select it, and if the validating is successful, I will click the Apply button which will send a post request with this file. But I don't understand how I can validate file before submitting it or I should use form into form. Or it will be in two forms, but then how to throw a file between them -
How do I change the name of the Django "Dosya Seç" button?
enter image description here strong text Hello I am using ImageField as my Django model. I use the structure in my model as forms. But my problem is, how do I change the text of the "Dosya Seç" button here? Currently, English and Turkish are mixed. How can I fix this? Thank you -
how to do autocomplete field with choice field in django admin panel?
i have choice field like region_choices , i want to make autocomplete in it how can i do it ? there is my models.py from django.db import models from django.utils import timezone class Theriology(models.Model): REGION_CHOICE = ( ('Восточно-Казахстанская область.', 'Восточно-Казахстанская область.'), ('Абайская область', 'Абайская область'), ('Актюбинская область', 'Актюбинская область'), ('Атырауская область', 'Атырауская область'), ('Западно-Казахстанская область', 'Западно-Казахстанская область'), ('Мангистауская область', 'Мангистауская область'), ('Акмолинская область', 'Акмолинская область'), ('Костанайская область', 'Костанайская область'), ('Павлодарская область', 'Павлодарская область'), ('Северо-Казахстанская область', 'Северо-Казахстанская область'), ('Карагандинская область', 'Карагандинская область'), ('Улытауская область', 'Улытауская область'), ('Алматинская область', 'Алматинская область'), ('Жетысуская область', 'Жетысуская область'), ('Жамбылская область', 'Жамбылская область'), ('Кызылординская область', 'Кызылординская область'), ('Туркестанская область', 'Туркестанская область')) genus = models.CharField(max_length=250) species = models.CharField(max_length=250) subspecies = models.CharField(max_length=250,blank=True, null=True) metode = models.CharField(max_length=250,blank=True, null=True) region = models.CharField(max_length=250, choices=REGION_CHOICE) now i have this kind of list so i want to add autocomlete like in picture i want like that -
How to convert dynamic html page to pdf in Django?
I have a task to convert a dynamic html page into a pdf document. What we have: dogovor application. Formadogovora.html page which contains a form with the required fields. The page dogovortemplate.html which contains text into which the values from the form should be substituted on the page formadogovora.html and a pdf document should be immediately generated. The dogovor/forms.py file contains: `from django import forms class DogovorUserForm(forms.Form): sellername = forms.CharField(label='Seller's name', widget=forms.TextInput(attrs={'class':'form-input'})) yachtclass = forms.CharField(label='Yacht Class', widget=forms.TextInput(attrs={'class':'form-input'}))` The dogovor/urls.py file contains: `from django.urls import path from . import views app_name = 'dogovor' urlpatterns = [ path('formadogovora/', views.formadogovora_user, name='formadogovora'), ]` The file dogovor/views.py contains: def formadogovora_user(request): form = DogovorUserForm() # Import the form class from forms.py return render(request, 'dogovor/formadogovora.html', {'form': form}) Contents of the formadogovora.html file: `{% extends 'base.html' %} {% load static %} {% block title %}Form of agreement{% endblock %} {% block content %} Form of agreement {% csrf_token %} {{ form.as_p }} Generate document {% endblock %}` Contents of the dogovortemplate.html file: `Agreement This agreement is concluded between: Seller: {{ dogovor.sellername }} Yacht class: {{ dogovor.yachtclass }} About the subject of the agreement: The Contractor undertakes to perform work on the development and implementation of software for the … -
Pass a view as a parameter to the url filter
What happens is that I want in my header template that I will embed in my main page to have the links to the other templates and according to what I researched I find that using the url filter and passing it a view should work but in my case it does not work <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <header> <nav> <li> <ul><a href="{% url 'Home'%}">Principal</a></ul> <ul><a href="{% url 'Informacion'%}">Informacion</a></ul> <ul><a href="{% url 'Imagenes'%}">Imagenes</a></ul> </li> </nav> </header> </body> </html> from django.shortcuts import render # Create your views here. def Home(request): return render(request,"principal.html") def Informacion(request): return render(request,"Informacion.html") def Imagenes(request): return render(request,"images.html") This produces Reverse for 'Home' not found. 'Home' is not a valid view function or pattern name. -
Serializing multiple inheritance models in Django REST Framework
I have this model structure: class Main (models.Model): name=models.Charfield(max_length=50) ... class Category (Main): type=models.Charfield(max_length=50) ... class SubCategory1(Category): charasteristic=models.Charfield(max_length=60) ... class SubCategory2(Category): charasteristic=models.Charfield(max_length=60) That is, there is one parent from which one children inherits, from which, in turn, multiple childrens inherit. For the API, I would like to show a complete structure in the json, from grandparent to every grandson. I mean, if I use the following serializer: class Subcategory1_serializer(serializers.ModelSerializer): class Meta: model=Subcategory1 fields=("__all__") it returns something like this: [ { "name": "type": "charasteristic": }, ] But this forces me to create a serializer for every single Subcategory. I want to get it in an automatic way. I've tried accessing via subclasses, I took a look at some proposals about Polymorphism (but I get lost) and I have tried to redefine inheritance in terms of OneToOne relationships, but I still cannot solve it (and it complicates data introduction from the admin panel). Any help would be great, Thanks in advance -
Assign an action to the button
By clicking the button, the item must be sold and no one else can bid. However, the button does nothing. views.py: if request.user == off.seller: close_button = True off.bid_price = (off.bid_price) Bid_info.checkclose = True html: {% if close_button %} <button type="submit" class="btn btn-primary">Close</button> {% endif %} models: class Bid_info(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE) seller = models.ForeignKey(User, on_delete=models.CASCADE, related_name="seller") bid_price = models.DecimalField(max_digits=10, decimal_places=2) checkclose = models.BooleanField(default=False) -
Django cache not working on apache server
I'm using Django 4.2 In my development env the cache is working fine(file-based cache) but when I deployed on Apache (windows), the cache stopped working. Some research mentioned something to do with middleware but I don't have any cache meddleware in development. I'm using view-based cache. -
Attribute Error at / 'tuple' object has no attribute 'get' in Django
I add my index.html file to templates directory and then change all the src and etc but I receive this error what should I do for it: D:\Django\2\blog_project\venv\Lib\site-packages\django\core\handlers\exception.py, line 55, in inner response = get_response(request) ^^^^^^^^^^^^^^^^^^^^^ … Local vars D:\Django\2\blog_project\venv\Lib\site-packages\django\utils\deprecation.py, line 136, in call response = self.process_response(request, response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ … Local vars D:\Django\2\blog_project\venv\Lib\site-packages\django\middleware\clickjacking.py, line 27, in process_response if response.get("X-Frame-Options") is not None: ^^^^^^^^^^^^ … Local vars I try to run a html page in my django project but i receive an error -
The page on the site is not displayed, please help me figure out what the problem is?
Add the dogovor application to the settings.py file. INSTALLED_APPS = [ #... 'agreement', #... ] Create a Dogovor model. `from django.db import models class Dogovor(models.Model): name = models.CharField(max_length=255) enginer = models.CharField(max_length=255) capitan = models.CharField(max_length=255) def get_absolute_url(self): return reverse('dogovor:forma-dogovora')` Create a FormaDogovoraView. `from django.views.generic import FormView from .forms import DogovorForm class FormaDogovoraView(FormView): template_name = 'dogovor/forma-dogovora.html' form_class = DogovorForm success_url = '/' def form_valid(self, form): return super().form_valid(form)` Create a DogovorForm. `from django.forms import ModelForm from .models import Dogovor class DogovorForm(ModelForm): class Meta: model = Agreement fields = ['name', 'enginer', 'capitan']` Create a template forma-dogovora.html. `{% extends 'base.html' %} {% block content %} <h1>Form of agreement</h1> <form action="{% url 'dogovor:forma-dogovora' %}" method="post"> {% csrf_token %} <label for="name">Organization name:</label> <input type="text" name="name" id="name"> <label for="enginer">Engineer:</label> <input type="text" name="enginer" id="enginer"> <label for="capitan">Captain:</label> <input type="text" name="capitan" id="capitan"> <input type="submit" value="Generate document"> </form> {% endblock %}` Create a template dogovor-template.html. ` Agreement Agreement <p>This agreement is concluded between:</p> <ul> <li>Name of organization: {{ name }}</li> <li>Engineer: {{ engineer }}</li> <li>Captain: {{ capitan }}</li> </ul> <p>The parties agreed on the following:</p> <!-- ... --> </body> </html>` But when I go to the address dogovor/forma-dogovora, it says that the page was not found. I don't know what to do. -
django forms placeholder not working as expected?
i created a django form and tried to add placeholder and remove the form label. i came across a solution to add the palceholder but it seems to have no effect. this is forms.py class AppForm(forms.ModelForm): class Meta: model = App fields = ('__all__') def __init__(self, *args, **kwargs): super(AppForm, self).__init__(*args, **kwargs) self.fields['appname'].widget.attrs['placeholder'] = 'App Name' self.fields['applink'].widget.attrs['placeholder'] = 'App Name' this is my html file {% extends 'main/base.html' %} {% load static %} {% load crispy_forms_tags %} {% block content %} <div class="content-above"> </div> <div class="content"> <div> <form action="" method="post" autocomplete="off" enctype="multipart/form-data"> <div> {% csrf_token %} {{ form.appname|as_crispy_field }} {{ form.applink|as_crispy_field }} </div> <div class="row"> <div class="col-md-8"> <button type="submit">Submit</button> </div> <div class="col-md-4"> <a href="{% url 'app_list' %}">Back to list</a> </div> </form> </div> </div> {% endblock content %} please help and if possible also tell me how to remove the default label! -
django template counter with "with" statement
{% with counter=1 %} {% for order in sales %} <tr> {% ifchanged order.date and order.dealer %} <td scope="row">{{ counter }}</td> {% with counter=counter|add:1 %} {% endwith %} {% else %} <td></td> {% endifchanged %} </tr> {% endfor %} {% endwith %} why is the counter '1' all the time? How can the counter be increased by 1 each time it is inside ifchanged statement? -
dumping django historical data in different database using django routers
I am using the django-simple-history package to track changes in my model. Now, I want to dump only the historical data into another database. I attempted to achieve this using a router, but I encountered an error: django.db.utils.OperationalError: (1824, "Failed to open the referenced table 'common_user'") The issue appears to be because the common_user table is in the default database and not in the history database. Here's the codes: # routers.py class HistoryRouter: def db_for_read(self, model, **hints): model_name = model.__name__ if 'historical' in model_name.lower(): return 'history_db' return 'default' def db_for_write(self, model, **hints): print('3'*100) model_name = model.__name__ if 'historical' in model_name.lower(): return 'history_db' return 'default' def allow_migrate(self, db, app_label, model_name=None, **hints): if hints.get("db") is not None: return db == hints.get("db") if model_name != None: if 'historical' in model_name.lower(): return db == 'history_db' return db == 'default' #models.py class Profile(models.Model): profile_type = models.ForeignKey(ProfileType, on_delete=models.PROTECT) user = models.ForeignKey(User, on_delete=models.CASCADE) nickname = models.CharField( max_length=64, unique=True, blank=False, null=False) org = models.ForeignKey( Org, null=True, on_delete=models.CASCADE, blank=True, related_name="user_org" ) address = models.ManyToManyField(Address, blank=True) is_active = models.BooleanField(default=True) is_section_admin = models.BooleanField(default=False) is_organization_admin = models.BooleanField(default=False) is_organization_member = models.BooleanField(default=False) date_of_joining = models.DateField(auto_now_add=True, null=True, blank=True) referral = models.CharField( max_length=64, blank=True, null=True) referred = models.CharField( max_length=64, blank=False, null=False, unique=True, default=uuid.uuid4().hex) history = HistoricalRecords(m2m_fields=(address, … -
Retrieving Video Duration During Save Operation in Django Model using OpenCV
I’m attempting to extract the duration of a video file within the Django model’s save method. I plan to use the OpenCV library for this purpose. My current challenge is properly accessing the video file in the isOpened() method of OpenCV to ensure that I can extract the duration. The problematic part seems to occur when I attempt to access the file during the execution of the super().save(*args, **kwargs) method, which I believe I need to call twice, once before and after obtaining the video duration, to ensure the file path is accessible to OpenCV. def save(self, *args, **kwargs) -> None: if not self.pk: super().save(*args, **kwargs) path = self.content.path self.duration = get_video_duration(path) return super().save(*args, **kwargs) Is this the correct approach? -
Django ORM One-To-Many relationships problem
Models: class Mark(models.Model): name = models.CharField(max_length=200, verbose_name="Марка", unique=True, null=True) #... class Model(models.Model): mark = models.ForeignKey(Mark, on_delete=models.CASCADE, verbose_name="Марка") name = models.CharField(max_length=200, verbose_name="Модель", unique=True, null=True) #... class Car(models.Model): vin = models.CharField(max_length=100, null=True) #... class Image(models.Model): car = models.ForeignKey(Car, related_name='images', on_delete=models.CASCADE) image = models.ImageField(upload_to=get_upload_path, verbose_name="Фото") #... How to make the following query in Django ORM without raw: query = "SELECT c.*, m.name mark_name, JSON_ARRAYAGG(img.image) image FROM incarcatalog_car c \ LEFT JOIN incarcatalog_mark m ON m.id=c.mark_id \ LEFT JOIN incarcatalog_image img ON img.car_id=c.id \ WHERE c.id>%s \ GROUP BY c.id;" queryset = Car.objects.raw(query, [id]) My problem... I did a left join for the Mark, Model tables, but I don’t know how to connect the car table with the Image table queryset = Car.objects.select_related("mark", "model").all() But i don't know how to create realtionship with Image table. -
'ascii' codec can't encode characters while uploading file in django and cpanel
hello I have a Django project. it work perfectly in local host but when I deployed it on cPanel I got an error when I want to upload an image. 'ascii' codec can't encode characters in position 37-43: ordinal not in range(128) /home/monkeymo/virtualenv/django/3.10/lib/python3.10/site-packages/django/core/files/storage/filesystem.py, line 106, in _save can you help me about this? -
Python Django Server - Production
When running my Django Server in Production mode, there is a problem with the render of one HTML. I have a HTML template, i copy and modify the content of it (according to some enter values) NAME_TEMPLATE.html then render this in to a different NAME_MODIFY.HTML. When i restart the server the 1st and 2nd render work then after it's always render the 1st and 2nd render in a random order. But if i check my NAME_MODIFY.HTML content, i can see the value display is not what it's in it. An image of the HTML content and what it display in chrome. CONTENT OF HTML and RENDER I try different explorer, CTRL+F5 but seems not worked. But if set the Django Server in DEBUG mode, then the issue disappear, when i enter always different value, i can see my value changed. Hope it's enough clear. Thanks in advance. CTRL+F5, Different Explorer, DEBUG MODE -
How to view FPDF pdf via http response in Django?
Hello I'm trying to view pdf on browser new tab via FPDF. getting error here my code. class PDFWithHeaderFooter(FPDF): def header(self): # Add your header content here self.set_font('Arial', 'B', 12) self.cell(0, 10, 'Your Header Text', 0, 1, 'C') def footer(self): # Add your footer content here self.set_y(-15) self.set_font('Arial', 'I', 8) self.cell(0, 10, 'Page %s' % self.page_no(), 0, 0, 'C') @login_required(login_url='/') def Print_Quote(request, pk): id = Quote.objects.get(id = pk) term = id.terms.all() quote_item = Quote_item.objects.filter( quotes = id ) sub_total = quote_item.aggregate(Sum('sub_total')) gst_total = quote_item.aggregate(Sum('gst_total')) total = quote_item.aggregate(Sum('total')) pdf = FPDF(format='letter') pdf = PDFWithHeaderFooter() # Add content to the PDF pdf.add_page() pdf.set_font('Arial', 'B', 16) pdf.cell(40, 10, 'Hello, World!') # Save the PDF to a HttpResponse pdf.output() return HttpResponse(pdf, content_type='application/pdf') **I'm view pdf on new tab but it's show me error ** -
In Django i can't display a form in index from another page. I only see the button and I don't see the textboxes
I would like to view the registration form directly on the index.html page (home page). The registration form was created in registration/register.html. I call it in index.html using: {% block content %} {% include 'registration/register.html' %} {%endblock%} In the urlpatterns of App1/views.py, i use: path("register_request", views.register_request, name='register_request') The problem is that on the index.html i see the form button, but not its textboxes (username, email, password). I can't understand where I'm wrong. Can you tell me what i'm doing wrong and can you show me code how to fix it? This is App1: App1 .migrations .static .templates ..index.html ..registration ...register.html index.html {% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>University</title> <!-- Bootstrap CSS --> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> <link href="https://getbootstrap.com/docs/5.3/assets/css/docs.css" rel="stylesheet"> <link href="/static/css/style.css" rel="stylesheet"> </head> <body> ....... ....... {% block content %} {% include 'registration/register.html' %} {%endblock%} </body> </html> App1/templates/registration/register.html <!--Register--> <div class="container py-5"> <h1>Register</h1> <form method="POST"> {% csrf_token %} {{ register_form.as_p }} <button class="btn btn-primary" type="submit">Register</button> </form> <p class="text-center">If you already have an account, <a href="/login">login</a> instead.</p> </div> App1/forms.py from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User # Create your forms here. class NewUserForm(UserCreationForm): email = … -
In django, is there a problem in checking csrf token only from request.META?
I'm experimenting with a custom FileUploadHandler that directly uploads a file to the cloud as the chunks are coming from the client. The problem is that Django's CsrfViewMiddleware accesses request.POST, which triggers the file upload handler before the view and starts the upload without any checks. Because of this, I've made a subclass of CsrfViewMiddleware with a slight change: to first check for csrf token in request.META, then request.POST. This way I can access the request in the view function before the file upload handler is called, but after csrf token protection, by putting the csrf token in the header. My perception is that both FileUploadHandler and CsrfViewMiddleware are more internal in Dango's implementation. Everything seems to work, but I'm afraid to break something unexpected with the custom CsrfViewMiddleware. Any input? from django.conf import settings from django.middleware.csrf import ( CsrfViewMiddleware, REASON_NO_CSRF_COOKIE, REASON_CSRF_TOKEN_MISSING, InvalidTokenFormat, RejectRequest, UnreadablePostError, _check_token_format, _does_token_match, ) class HeaderCsrfViewMiddleware(CsrfViewMiddleware): """only difference from CsrfViewMiddleware is csrf token checked first in request.META, then request.POST (defaut is other way around) if csrf token is in request.META, request.POST never is accessed makes possible to csrf protect a view before file upload handlers gets called """ def _check_token(self, request): # get secret from the … -
Why does the form not appear on my Django Webpage?
I am trying to display a search form on a Django webpage, I've included the search view function, the search form and DHTML. The form simply will not appear on the page, instead I only see the base.html template. I have disabled all CSS that could interfere and verified that base.html does not effect it. Additionally I've verified that the form is correctly passing to the view function and html. Help would really be appreciated as I feel my head is about to explode. HTML {% extends 'base.html' %} {%block title%} {% if form.is_valid and search_text%} Search Results for "{{ search_text }}" {% else %} UrMix Search {% endif %} {% endblock %} {% block content %} <h2> Search for Songs </h2> <form method="GET" action="{% url 'song_search' %}"> {% csrf_token %} {{ form.as_p }} <button type="submit" class="btn btn-primary">Search</button> </form> {% if form.is_valid and search_text %} <h3> Search results for <em> {{search_text}}</em></h3> <ul class = "list-group"> {% for song in songs%} <li class="list-group-item"> <span class="text-info">Name: </span> <a href="{%url 'song_detail' song.pk%}"> {{song}}</a> <br/> </li> {% empty %} <li class = "list-group-item">No result</li> {% endfor %} </ul> {% endif %} {% endblock %} Search View def song_search(request): search_text = request.GET.get("search", "") form = … -
Multiple filtering on Django Prefetch
Based on my codebase: class City(models.Model): name = models.CharField(max_length=100) ... class District(models.Model): city = models.ForeignKey(City, on_delete=models.CASCADE) class Park(models.Model): district = models.ForeignKey(District, on_delete=models.CASCADE, related_name="parks") class Plant(models.Model): name = models.CharField(max_length=200) plant_type = models.CharField(max_length=200) park = models.ForeignKey(Park, on_delete=models.CASCADE, related_name="plants") def plants_of_type_in_park(plant_type, park): return park.plants.filter(plant_type=plant_type) def generate_garden_report(): report_data = {} plant_types = ["rose", "tulip", "daisy", ...etc] districts = District.objects.all() districts = districts.prefetch_related("parks", "parks__plants") for dist in districts.all(): for park in districts.parks.all(): for plant in plant_types: report_data[dist.city.name][plant] += plants_of_type_in_park(plant, park).count() return report_data My objective is to optimize the generate_garden_report function using prefetching. I have added districts.prefetch_related("parks", "parks__plants"). However, since plants_of_type_in_park uses a filter, it triggers another query. My approach was to prefetch each filter: districts = districts.prefetch_related("parks", "parks__plants") for plant in plant_types: districts = districts.prefetch_related(Prefetch("parks_plants", queryset=Plant.objects.filter(plant_type=plant))) But, as parks_plants can only be assigned once, I can't create multiple filters for this. My goal is to prefetch everything needed with minimal impact on the plants_of_type_in_park function, as it is used elsewhere in the codebase. -
Why is docker compose saying no such file or directory?
I have a simple vue + django project and I want to be able to containerize this project with docker but I've run into some issues. I have dockerfiles and docker compose files in each subfolder - frontend and backend - and if I cd into either I can successfully start each individual project using docker compose with no problems. However, I want to be able to run one single docker compose command that can create both images simultaneously. I currently have a docker compose file in the root directory of the project and I am including the compose files and referencing them in the services. It works fine with just the vue service but gives me an error when I include the django services. Error code is this: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount2369903057/Dockerfile: no such file or directory The django project was created using cookiecutter so it has everything I need in the project. Here is a simple version of my file structure: - backend - compose - Dockerfile - docker-compose.yml - frontend - Dockerfile - docker-compose.yml - docker-compose.yml Here is my backend compose file: volumes: api_local_postgres_data: {} api_local_postgres_data_backups: {} services: django: build: context: . … -
Procfile for deploying django in Heroku "web: gunicorn [app name]:application -b xx.xxx.xxx.xx:8000"
I'm trying to deploy my app and the Profile seemed to be wrong and my app crashes before I can view it. I tried to write this in the Procfile: web: gunicorn SC_BASIS:application -b 127.0.0.1:8000 and I was expecting it to run since I previously had problems with web: gunicorn SCBASIS.wsgi However, it still errors with the following message. I'm not sure what is wrong: Starting process with command `gunicorn SC_BASIS:application -b 127.0.0.1:8000` 2023-12-22T22:28:22.256483+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [2] [INFO] Starting gunicorn 21.2.0 2023-12-22T22:28:22.256752+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [2] [INFO] Listening at: http://127.0.0.1:8000 (2) 2023-12-22T22:28:22.256788+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [2] [INFO] Using worker: sync 2023-12-22T22:28:22.258739+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [7] [INFO] Booting worker with pid: 7 2023-12-22T22:28:22.259865+00:00 app[web.1]: Failed to find attribute 'application' in 'SC_BASIS'. 2023-12-22T22:28:22.259934+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [7] [INFO] Worker exiting (pid: 7) 2023-12-22T22:28:22.280621+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [8] [INFO] Booting worker with pid: 8 2023-12-22T22:28:22.280808+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [2] [ERROR] Worker (pid:7) exited with code 4 2023-12-22T22:28:22.281142+00:00 app[web.1]: Failed to find attribute 'application' in 'SC_BASIS'. 2023-12-22T22:28:22.281204+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [8] [INFO] Worker exiting (pid: 8) 2023-12-22T22:28:22.300841+00:00 app[web.1]: [2023-12-22 22:28:22 +0000] [2] [ERROR] Worker (pid:8) exited with code 4 2023-12-22T22:28:22.300880+00:00 app[web.1]: Traceback (most recent call …