Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Floating Point Exception with 'Openseespy' in Python
While trying to import module from 'openseespy - (v3.2.2.3)' on a Ubuntu VM machine(cloud), I'm running into 'Floating Point Exception', refer to the screenshot below. Apparently, the same module works fine on a local machine with Ubuntu VirtualBox (it’s a VM machine on a Windows laptop). Note: I'm using Python 3.8.0 -
update users logging in through API in django admin
I have made a APP in which users log in through a microsoft graph API now i want every user that has logged in updated in django Admin users just like normal django auth would do. -
Error while eb create - argument of type 'NoneType' is not iterable
this is the first time I am deploying a web application through AWS. I followed this tutorial - https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html While creating a new environment with -> eb create, I got this error. ERROR: TypeError - argument of type 'NoneType' is not iterable Can anyone please help me know what's the issue This is what I have done so far: PS E:\projects\portfolio> & e:/projects/portfolio/eb-virt/Scripts/Activate.ps1 (eb-virt) PS E:\projects\portfolio> pip freeze > requirements.txt (eb-virt) PS E:\projects\portfolio> mkdir .ebextensions Directory: E:\projects\portfolio Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 8/26/2020 10:26 AM .ebextensions (eb-virt) PS E:\projects\portfolio> deactivate PS E:\projects\portfolio> eb init -p python-3.6 django-tutorial You have not yet set up your credentials or your credentials are incorrect You must provide your credentials. (aws-access-id): A*****************Q (aws-secret-key): V*****************************i Application django-tutorial has been created. PS E:\projects\portfolio> eb init Do you wish to continue with CodeCommit? (Y/n): y Enter Repository Name (default is "portfolio"): portfolio Successfully created repository: portfolio Enter Branch Name ***** Must have at least one commit to create a new branch with CodeCommit ***** (default is "master"): portfolio_branch1 Successfully created branch: portfolio_branch1 Do you want to set up SSH for your instances? (Y/n): y Type a keypair name. (Default is aws-eb): aws-eb-portfolio Generating public/private … -
got problem in the ajax form submission code
<form action="" method="post" class="f-color" id="email-form"> {% csrf_token %} <label>Name</label> <input type="text"> <label>From</label> <input type="email"> <label>Message</label> <button type="submit">Sent</button> </form> <div class="mt-5" id="spin" style="display: none;"> <div class="loader"></div> </div> <div id="msg"></div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(document).on("submit", "#email-form", function(event){ event.preventDefault(); $('#spin').show(); $.ajax({ url: "{% url 'contact' %}", type: "POST", data: $("#email-form").serialize(), success: function(data){ $("#spin").hide(); if(data.status == "success"){ $("#msg").html("<p class='alert alert-success'>we will get back to you as soon as possible</p>" ); $("#email-form").reset(); } } }) }) }) </script> using this code I can submit the form successfully, but after the form submission the message(msg) not showing, the 'if condition statement' is perfectly working (for the testing I gave the alert, the alert was worked) another problem is form reset, for this I'm using $("#email-form").reset(); but the form dose't reset how can I solve these problems -
when i send data through my api i get this Error TypeError at /api/add/ Object of type UserInfo is not JSON serializable
i have two models one is for User and another is UserInfo, i am inserting additional information of user to a model that have foreignkey relationship with user model. when i add additional information to the api ,the data is getting stored but i get error instead of response. serilaizers.py class UserCreateSerializerCustom(UserCreateSerializer): class Meta(UserCreateSerializer.Meta,): model = User fields = ( 'id', 'email', 'username', 'password', 'first_name', 'last_name', 'phone', ) ## User Additional Info Serializers class UserAdditionalSerializers(serializers.ModelSerializer): user = UserCreateSerializerCustom() class Meta: model = UserInfo fields = ( 'user', 'address', 'zipcode', ) Views.py class UserAdditionalView(generics.ListCreateAPIView): queryset = UserInfo.objects.all() serializer_class = UserAdditionalSerializers # authentication_classes = (TokenAuthentication) def post(self,request,*args,**kwargs): token = request.META['HTTP_AUTHORIZATION'].split(" ")[1] print(token) us = Token.objects.get(key=token).user user1 = User.objects.get(email=us) user,_ = UserInfo.objects.get_or_create(user=user1) user.address=request.POST['address'] user.zipcode=request.POST['zipcode'] user.save() return Response({'user':user}) urls.py path('add/',views.UserAdditionalView.as_view()), models.py class User(AbstractUser): # username = None email = models.EmailField(verbose_name='email',max_length=50,unique=True) #phone_regex = RegexValidator(regex=r'^\+?1?\d{9,15}$') #phone = PhoneNumberField(unique=True,blank=False,null=False) phone = models.CharField(max_length=17,blank=True) REQUIRED_FIELDS = [ 'first_name', 'last_name', 'phone', 'username', ] USERNAME_FIELD = 'email' def get_username(self): return self.email class UserInfo(models.Model): user = models.ForeignKey(User,on_delete=models.CASCADE) address = models.CharField(max_length=50) zipcode = models.CharField(max_length=20) def __str__(self): return str(self.user) My expected response is { "user": { "id": 3, "email": "test@test.com", "username": "test", "first_name": "test", "last_name": "test", "phone": "+1(123)-456-7890" }, "address": "kjbnjklqnja", "zipcode": "69996" } … -
DRF Viewset set action detail=false for exixting routes
@action(detail=False) def update(self, request): serializer = self.serializer_class(user, request.data) . . . . return Response(res) How to set detail=False for existing routes in Django Rest Framework? I don't need the primary key for this route to work, currently I'm sending a dummy value in the URL for this route. It works but still I wanna know if there is a way to bypass it by setting detail=False. If we set @action for it, it throws an error Cannot use the @action decorator on the following methods, as they are existing routes: Is there any solution for this? Thanks in advance! -
Celery task hangs after calling .delay() in Django
While calling the .delay() method of an imported task from a django application, the process gets stuck and the request is never completed. We also don't get any error on the console. Setting up a set_trace() with pdb results in the same thing. The following questions were reviewed which didn't help resolve the issue: Calling celery task hangs for delay and apply_async celery .delay hangs (recent, not an auth problem) Eg.: backend/settings.py CELERY_BROKER_URL = os.environ.get("CELERY_BROKER", RABBIT_URL) CELERY_RESULT_BACKEND = os.environ.get("CELERY_BROKER", RABBIT_URL) backend/celery.py from __future__ import absolute_import, unicode_literals import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') app = Celery('backend') app.config_from_object('django.conf:settings', namespace='CELERY') # Load task modules from all registered Django app configs. app.autodiscover_tasks() @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.request)) app/tasks.py import time from celery import shared_task @shared_task def upload_file(request_id): time.sleep(request_id) return True app/views.py from rest_framework.views import APIView from .tasks import upload_file class UploadCreateAPIView(APIView): # other methods... def post(self, request, *args, **kwargs): id = request.data.get("id", None) # business logic ... print("Going to submit task.") import pdb; pdb.set_trace() upload_file.delay(id) # <- this hangs the runserver as well as the set_trace() print("Submitted task.") -
Remove current URL autofill in fetch()
I'm new to web developing and I'm having a bit of trouble with my first website. I'm using Django REST Framework on the backend for the API and React.js on the frontend. I'm on URL 127.0.0.1:8000/course/1 and I'm trying to make a call to the API to retrieve the information of course 1. The API is in 127.0.0.1:8000/api/courses/1, so I use: fetch('localhost:8000/api/courses/1') The problem is that it apparently makes a GET request on 127.0.0.1:8000/course/1/127.0.0.1:8000/api/courses/1 which obviously doesn't exist. The problem is that for some reason it automatically appends the argument of fetch to the current URL. I tried this from the home URL with fetch('api/course/1') and it works. What should I do? This is the complete code: import React, { Component } from 'react'; export class Course extends Component { constructor(props) { super(props); this.state = { course: {} } this.getCookie = this.getCookie.bind(this); this.fethCourse = this.fetchCourse.bind(this); } getCookie(name) { let cookieValue = null; if (document.cookie && document.cookie != '') { let cookies = document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { let cookie = cookies[i].trim(); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) == (name + '=')) { cookieValue = … -
Django server is slow on wsl
Django server takes huge time to load/reload in wsl(Ubuntu). Running the same app on linux is fine. Is wsl it takes around 30-40 secs to load/reload. Sometimes even more. I tried setting path /etc/wsl.conf , there was no improvement. -
capture image and save it to database with django
I am trying to make a web app with django in which it clicks an image from the camera and saves the image to a database. How can that be implemented? if there is a source code available, kindly share a link to it. thank you -
Django-folium Integration ERROR (__init__() takes 1 positional argument but 2 were given)
Django beginner here.trying to display folium maps on my webpage. but getting this error: Screenshot of error Django version===3.0.2 code for this is as follows: views.py from .models import Product from .forms import Productform # Create your views here. import folium from django.views.generic import TemplateView class FoliumView(TemplateView): template_name = "folium_app/map.html" def get_context_data(self, **kwargs): figure = folium.Figure() m = folium.Map( location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain' ) m.add_to(figure) folium.Marker( location=[45.3288, -121.6625], popup='Mt. Hood Meadows', icon=folium.Icon(icon='cloud') ).add_to(m) folium.Marker( location=[45.3311, -121.7113], popup='Timberline Lodge', icon=folium.Icon(color='green') ).add_to(m) folium.Marker( location=[45.3300, -121.6823], popup='Some Other Location', icon=folium.Icon(color='red', icon='info-sign') ).add_to(m) figure.render() return {"map": figure} Templates\folium_map.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> {{map.header.render|safe}} </head> <body> <div><h1>Here comes my folium map:</h1></div> {{map.html.render|safe}} <script> {{map.script.render|safe}} </script> </body> </html> I WOULD ALSO APPRETIATE IF SOMEBODY COULD TELL ME HOW TO MAKE ANNOTATIONS ON THE MAP DISPLAYED please annswer ASAP -
Django Rest Framework: Custom Views
i have a django installation with currently two apps ( common / destinations ) and i want to create custom api views across these apps. in common i have a model country models.py app common from django.db import models # Create your models here. class Country(models.Model): CONTINENTS = ( ('Europe', 'Europe'), ('Asia', 'Asia'), ('Africa', 'Africa'), ('northamerica', 'North America'), ('southamerica', 'South America'), ('australia', 'Australia') ) name = models.CharField(max_length=120) code = models.CharField(max_length=2) continent = models.CharField(max_length=11, choices=CONTINENTS) content = models.TextField() image = models.FileField() models.py app destination from django.db import models # Create your models here. class Destination(models.Model): name = models.CharField(max_length=120) code = models.CharField(max_length=3) country = models.ForeignKey("common.Country", on_delete=models.CASCADE) image = models.FileField() serializers.py app destination from rest_framework import serializers from common.serializers import CountrySerializer from .models import Destination class DestinationSerializer(serializers.ModelSerializer): country = CountrySerializer() class Meta: model = Destination fields = ("id", "name", "code", "country", "image") views.py app destination from rest_framework import views from rest_framework.response import Response from .serializers import DestinationSerializer, ImageSerializer from .models import Destination # Create your views here. class DestinationView(views.APIView): def get(self, request, code): destination = Destination.objects.filter(code=code.upper()) if destination: serializer = DestinationSerializer(destination, many=True) return Response(status=200, data=serializer.data) return Response(status=400, data={"Destination not found"}) When i make a API call /api/destination/PMI everything works. i get my destination … -
Create and Update API for Project and Task (One to Many relationship) Django REST API (bulk create and update)
Does anyone have a good example of creating an API where I can create a project and add multiples tasks to it? class Project(models.Model): name = models.CharField(max_length=30) class Task(models.Model): priority = models.CharField(max_length=30) todo = models.CharField(max_length=30) project = models.ForeignKey(Project, on_delete=models.CASCADE) I would like to be able to create a project and at the same time provide a list of tasks for the project. Json post would look something like this { name: "Project", tasks: [ {priority: "High", todo: "Create front-end page" }, {priority: "High", todo: "Connect back-end " }, {priority: "High", todo: "Deploy server " } ] } With this Json I hope to create project with name="Project name" and after creating project I would like to add the tasks which uses the project as foreign key. From this API I hope to be able to project model with field name = "Project name" and creating the other 3 tasks model using given fields priority, todo, and project as a foreign key. -
how to move an existing django project to pycharm
tutorial --- venv --- lib --- include --- bin --- first --- manage.py my problem is , trying to open in pychrem and when i try to run the manage.py i have this error. in terminal evreything work , but in pychrem not . /usr/local/bin/python3.8 /Users/alekseyzgeria/Desktop/tutorial/manage.py Traceback (most recent call last): File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 11, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django' **The above exception was the direct cause of the following exception:** File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 22, in <module> main() File "/Users/alekseyzgeria/Desktop/tutorial/manage.py", line 13, in main raise ImportError( ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? -
Django CreateUpdateView implementation in the django template
I am very new to django Class based views, trying to integrate it with my existing project. My goal is to use same Class based view to Create and Update student application form. I am trying to integrate CreateUpdateView from the @scubabuddha's answer this solution. urls.py path('add/', StudentView.as_view(), name='addview'), path('<int:pk>/edit/', StudentView.as_view(), name='editview'), views.py from createupdateview import CreateUpdateView class StudentView(CreateUpdateView): template_name="admission.html" Model = Student form_class = StudentForm def get(self, request, *args, **kwargs): return self.post(request, *args, **kwargs) def post(self, request, *args, **kwargs): forms = {"userform": UserForm(request.POST or None), guardian..., contact..., # other 5-6 forms} if request.POST: invalid_forms = [form.is_valid() for form in self.forms.values()] if not all(invalid_forms): messages.error(request,'You must fill up all the valid mandatory form fields!') return render(request, 'admission.html', forms) #-- Logic to validate and save each form ... return render(request, 'admission.html', forms) return render(request, 'admission.html', forms) This is perfectly working for CreateView, but not able to understand how to use this for UpdateView or editview. If user hits editview, admission.html should display all the saved details in the html I want to display, all the student details in the UpdateView forms - <form class="form" name="admissionForm" id="admissionForm" method="post" enctype="multipart/form-data" action="{% url 'addview' %}" > {% csrf_token %} <div class="pages"> <h4 class="mt-2 mb-3">Personal … -
"invalid literal for int() with base 10: '' Error coming while using dynamic field in django update query
user = models.users.objects.filter(token=request.POST['token'],otp=otp).update(Q(**{ column: new_email_or_phone})); -
Respond with Not Found if user is not authorised to view the instance
How can I modify Django behaviour, for some models only, to obscure the existence of an object in that model, if the user is not authorised to view that object? By default, Django will respond to a query for a nonexistent object with 404 Not Found, and to an existing object that the user is not permitted to view, with 403 Forbidden. This is all correct, as a default. What I'd like to do though, is to present some specific models to each user as containing only the records that user may view, and nothing else exists in there to be queried. If they're authorised to view the instance, it is shown; if it exists but they're not authorised, then Django should not reveal even whether that instance exists and should respond only with 404 Not Found. This requirement is only for some models in the database. For example, confidential documents: the visitor should not be able to sniff around and discover which documents exist and which do not. Either they have permission to view that document, or they should not be told there's anything there just as if they queried a nonexistent document. For other models, the normal behaviour … -
How to force event.preventDefault()?
Inside my fetch function, I'm sending a mail variable through a POST request to my server as JSON. In my server I open my database and check if the mail exists, and if it does, I add to my jsoned dict a string {"exists":"exists"} So I know that it exists. Then, still on the server side, I return a JSONResponse of my dict back to the js. I want my javascript to detect if it exists, so i look for the string i added to my dict. I look for result.exists in my script. I only want the form to be prevented from submit if the email doesn't exists, and want the form to be submitted if the email already exists. So I`m doing: document.addEventListener("DOMContentLoaded", function() { document.querySelector('#laform, #elform').addEventListener("submit", function(event) { var content = document.querySelector('#elcontent').value; fetch("", { method: 'POST', body: JSON.stringify({ mail: document.querySelector('#email').value, name: document.querySelector('#name').value }), headers: { "Content-type": "application/json; charset=UTF-8", "X-CSRFToken": getCookie('csrftoken') } }) .then(response => response.json()) .then(result => { // Print result if (result.exists === undefined) { event.preventDefault(); if (content.length > 700) { popup_content('show'); } } }); }); }) </script> But here is a big problem. Inside the .then() it's too late to add an event.preventDefault() So I … -
Django on wamp apache hijacking all the wampp functionalities?
I am trying to bring my Django project and my other PHP project on the same Wamp instance. However, after bringing the Django to the wamp server, all of the wamp functionalities are hijacked by the Django, including phpMyadmin, and all the projects in the www directory of the wamp refuse to load as those URLs are hijacked by Django. Unfortunately, I am very new to the apache and I need to rapidly set up my hosting environment for my research purposes and I am running short on time, and I need both of my projects e.g. Django and Php to run on the same server and the same port. I have tried many vhost configs, but none have been working for me, I have even tried changing the alias of django and PHP in all possible combinations with subdirectories but it still doesn't work. The following is my current vhost configuration: # Virtual Hosts <VirtualHost *:80> ServerName php.localhost ServerAlias localhost Alias / ${INSTALL_DIR}/www/ DocumentRoot "${INSTALL_DIR}/www" <Directory "${INSTALL_DIR}/www/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local </Directory> </VirtualHost> # This is for your Django stuff <VirtualHost *:80> ServerName localhost DocumentRoot C:/Users/abdur/PycharmProjects/untitled/discovery/ WSGIDaemonProcess discovery python-path=/C:/Users/abdur/PycharmProjects/untitled python-home=/C:/Users/abdur/PycharmProjects/untitled/discovery WSGIProcessGroup discovery WSGIScriptAlias / … -
Call django task from button click in nuxt application via rest api
I have a python wrapper that updates data from a third party api in my backend. The background task cannot fetch all the data without taking params in order to filter down each call and return filtered batches. I don't want to have these background tasks running periodically because I would like to limit my api calls. What I'm trying to do is use button click to make a post request from my nuxt frontend and trigger a function that will fetch the data and update a model in in the view. When I make the post request from nuxt I get data to the backend and saving to the models. What doesn't happen is events function being called and saving to the events model. I'm not getting any error but I would've expected the rest of the code within the view would be called before being 201 created. How can I get the rest of the code to execute or even pass a parameter each time the button is clicked in nuxt to events = api.market_data.get_events(sport_ids=['my_param']) nuxtapp <template> <div> <button type="button" class="btn btn-dark" v-on:click="get_tennis">get_tennis</button> </div> </template> <script> export default { methods: { get_tennis () { this.$axios.post('api/sportsid/', { sport_id: "9", … -
How to efficiently upload multiple files in django
Have a working app that allows the user to upload multiple files (typically images) at once, but if they upload more than a few files at once, or very large files, it takes very long to go through and they're stuck on the form template waiting while this is happening. I can tell that what I'm doing isn't very efficient but I'm not sure how to make it better/faster. Am new to django/python, thanks for any help. views.py: def add_event(request): form = EventFullForm(request.POST or None, request.FILES or None) files = request.FILES.getlist('images') if request.method == "POST": if form.is_valid(): user = request.user title = form.cleaned_data['title'] description = form.cleaned_data['description'] start_time = form.cleaned_data['start_time'] end_time = form.cleaned_data['end_time'] event_obj = Event.objects.create(user=user, title=title, description=description, start_time=start_time, end_time=end_time) for f in files: Images.objects.create(event=event_obj, image=f) return redirect('calendarapp:calendar') else: form = EventFullForm() context = {'form': form, 'files': files} return render(request, 'calendarapp/test_form.html', context) Please let me know if sharing any additional code would be helpful -
Django search / filter across multiple models
In my Django website, I'm trying to create a search bar on my homepage that returns results that are stored in two different models(Articles, Jobs) Currently, I get an empty result set when I search using this code: In models.py, class Articles(models.Model): objects = None news_title = models.CharField(db_column="title", max_length=400) news_url = models.URLField(db_column="link", max_length=400) image_link = models.CharField(db_column="image", max_length=400) published_date = models.CharField(db_column="published_date", max_length=400) class Meta: managed = False db_table = "articles" def __str__(self): return self.news_title class Jobs(models.Model): objects = None company = models.CharField(db_column='company', max_length=100) job_title = models.CharField(db_column='job_title', max_length=300) experience = models.CharField(db_column='experience', max_length=300) edu_level = models.CharField(db_column='edu_level', max_length=50) class Meta: managed = False db_table = "job_list" def __str__(self): return self.job_title In views.py, class SearchView(ListView): template_name = 'blog/search_results.html' def get_queryset(self): request = self.request query = request.GET.get('q', '') articles_results = Articles.objects.filter(Q(news_title__icontains=query)) jobs_results = Jobs.objects.filter(Q(job_title__icontains=query)) context={ 'articles':articles_results, 'jobs':jobs_results, } return render(request, 'blog/search_results.html', context) In main_view.html, I'm using this code for creating a search bar: <form action="{%url 'search_results' %}" method="get" values="{{request.GET.q}}" class="search-jobs-form"> <div class="row mb-5"> <input name="q" type="text" values="{{request.GET.q}}" placeholder="search"> </div> <button type="submit">Search</button> </form> And in search_results.html, {% block content %} {% for job in jobs %} <h5>{{job.job_title}}</h5> <p>{{job.company}}</p> {% endfor %} {% for article in articles %} <h5>{{article.news_title}}</h5> <p>{{article.published_date}}</p> {% endfor %} {% endblock %} -
How to stack django model saving calls in case an error occurs?
My web app needs massive load from csv files. Files may have reference errors. How can I save "softly" each row and rollback all saved records if an error occurs? I'm using django command. -
Do you know why Django ls might not show up in project directory?
I tried to use django-admin.py from your virtualenv virtual environment but the manage.py and other files do not get created. I tried using the ls command and nothing shows up in the project directory. I am using version 3 of Django and I ran it using powershell in adminstrator mode. Please help! Thank you very much, Josh -
Problem with django 3.1, gunicorn : ModuleNotFoundError: No module named 'debates' - ubuntu 20.04 - digitalocean
I have the following problem following this tutorial, get to: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20 -04 # creating-systemd-socket-and-service-files-for-gunicorn, when checking the status of gunicorn the following error appears when reviewing the journal: Aug 26 02:17:12 web-debates gunicorn[23045]: ModuleNotFoundError: No module named 'debates' Aug 26 02:17:12 web-debates gunicorn[23045]: [2020-08-26 02:17:12 +0000] [23045] [INFO] Worker exiting (pid: 23045) Aug 26 02:17:12 web-debates gunicorn[23032]: Traceback (most recent call last): Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/lib/python3.8/site-packages/gunicorn/arbiter.py", line 202, in run Aug 26 02:17:12 web-debates gunicorn[23032]: self.manage_workers() Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/lib/python3.8/site-packages/gunicorn/arbiter.py", line 545, in manage_workers Aug 26 02:17:12 web-debates gunicorn[23032]: self.spawn_workers() Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/lib/python3.8/site-packages/gunicorn/arbiter.py", line 617, in spawn_workers Aug 26 02:17:12 web-debates gunicorn[23032]: time.sleep(0.1 * random.random()) Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld Aug 26 02:17:12 web-debates gunicorn[23032]: self.reap_workers() Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers Aug 26 02:17:12 web-debates gunicorn[23032]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) Aug 26 02:17:12 web-debates gunicorn[23032]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> Aug 26 02:17:12 web-debates gunicorn[23032]: During handling of the above exception, another exception occurred: Aug 26 02:17:12 web-debates gunicorn[23032]: Traceback (most recent call last): Aug 26 02:17:12 web-debates gunicorn[23032]: File "/root/proyectosDebates/web/bin/gunicorn", line 8, in <module> Aug 26 …