Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
why am I getting "This field is required." on loading of the page
I have a form in my template which I have used the django-crispy-forms to implement. I have the models.py, and then created the forms.py and then used it in my views.py. I don't know why I keep having the "This field is required." whenever I load the page. I have some feelings that it has to do with the views.py thou. I would be glad if i could receive some solutions. Thanks This is the image of the page. views.py def manager_page(request): if request.method=="POST": manager_id = request.POST.get('manager_id') manager_name = request.POST.get('manager_name') form3 = AddCourses() if request.method == "POST": form3 = AddCourses(request.POST) if form3.is_valid(): form3.save() return redirect("/") # get_course_details = add_course.objects.all() courses = add_courses.objects.all().order_by('-id') get_supervisor_man=manager_supervisor.objects.filter(manager_id=manager_id) Manager_login_information_get1 = Manager_login_information.objects.get(manager_ID=manager_id) # print(Manager_login_information_get1) manager_usid = Manager_login_information_get1.manager_ID manager_usname = Manager_login_information_get1.manager_Name context9 = {'manager_id':manager_id, 'manager_name':manager_name, 'form1':form1, 'form2':form2, 'form3':form3, 'courses':courses, 'Manager_login_information_get1':Manager_login_information_get1} return render(request, 'manager_page.html', context9) else: return redirect('/') -
Data is not validated in Django Rest Framework
I am trying to pass the data to a serializer like the following: myDict = { "invoice_date": "2021-02-24T11:44:13+05:30", "invoice_number": "12", "vendor": "4", "amount": "12", "gst": "12", "total_amount": "14", "transaction_type": "Allot", "status": "Hold", "transactions": [ { "t_no": 47, "f_mile": "45", "long_haul": "45", "l_mile": "45", "labour": "45", "others": "54", "a_t_no": 47, }, { "t_no": 102, "f_mile": "12", "long_haul": "12", "l_mile": "21", "labour": "21", "others": "21", "a_t_no": 102, }, ], "owner": 2, } But when I check the validated data in the serialzer it shows it without the transactions data: {'invoice_date': datetime.datetime(2021, 2, 24, 6, 14, 13, tzinfo=<UTC>), 'invoice_number': '12', 'amount': 12, 'gst': 12, 'total_amount': 14, 'status': 'Hold', 'transaction_type': 'Allot', 'vendor': <Vendor: Vendor object (4)>, 'owner': <User: yantraksh>} so I tried to check the initial data that is being passed to the serializer : <QueryDict: { "invoice_date": ["2021-02-24T11:44:13+05:30"], "invoice_number": ["12"], "vendor": ["4"], "amount": ["12"], "gst": ["12"], "total_amount": ["14"], "transaction_type": ["Allot"], "status": ["Hold"], "transactions": [ '[{"t_no":47,"f_mile":"45","long_haul":"45","l_mile":"45","labour":"45","others":"54","a_t_no":47},{"t_no":102,"f_mile":"12","long_haul":"12","l_mile":"21","labour":"21","others": "21","a_t_no":102}]' ], "owner": [2], }> It shows that the transaction data is being passed as a string, what should I change it to in order to get it as validated data ? -
Django - 403 (Forbidden): CSRF token missing or incorrect with Ajax call. Tried everything
I know this is a well worn question and I scoured the web and this website finding countless answers that boil down to the very same solutions and none of them worked for me and I do not know why. my info/trials so far: suprisingly the csrf_exempt decorator does not work tried setting up Headers/beforeSend once before all Ajax calls, it does not work (I tried setting the headers both in call and just once for all the ajax calls) I can pick up the django token easily both via javascript or via django {{ token }} django.middleware.csrf.CsrfViewMiddleware is present in the settings.py python 3.8; django 2.2 here below you can see the different trials in /*...*/ var csrftoken = '{{ csrf_token }}' $.ajaxSetup({ crossDomain: false, beforeSend: function(xhr, settings) { xhr.setRequestHeader("X-CSRFToken", csrftoken) } }); $.ajax({ url: '/do_things/', type: 'POST', contentType: 'application/json', data: { /*'csrfmiddlewaretoken': csrftoken*/ }, beforeSend: function (xhr) { /*xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');*/ /*xhr.setRequestHeader('X-CSRFToken', csrftoken);*/ /*xhr.setRequestHeader('X-CSRF-Token', csrftoken);*/ }, headers: { /*'X-CSRFToken': csrftoken,*/ /*'X-CSRF-Token': csrftoken*/ }, success: function (data) { console.log('Fill all the tables') } }) on the view side @login_required(login_url='/login/') def do_things(request): if request.method == "POST": ... Resources: a) Forbidden (CSRF token missing or incorrect.) | Django and AJAX b) Adding … -
How to add phone column in auth_user table and save request send by postman
serializers.py class RegisterSerializer(serializers.ModelSerializer): class Meta: model = User fields = 'all' def save(self): user = User(password=self.validated_data['password'],username=self.validated_data['username'],email = self.validated_data['email'],is_superuser = 1,is_active = 1,is_staff=1) email = self.validated_data['email'] if email == None: raise serializers.ValidationError({'email': 'email can not be null'}) password = self.validated_data['password'] if password == None: raise serializers.ValidationError( {'password': 'Password can not be null'}) phone = Users(self.validated_data['phone'],) phone = self.validated_data['phone'] print("phone ",phone) if phone == None: raise serializers.ValidationError({'phone': 'phone can not be null'}) user.set_password(password) user.save() print("user :",user) return user sending request from Postman[enter image description here][1] How can I get phone no in serializer and save phone on Users table? ** here is one to one relation between auth_user and Users** -
reuse of views in django
I am creating a django site where I use an OTP (one time password) to validate user data when logging in. So I have a view in which I manage the login and one that emails the otp, provides the form, checks that the otp is correct and redirects the user to the homepage. Now I would like to reuse the otp view in other situations as well (e.g. password change or recovery). How can I use a view as if it were a normal function, in the sense of calling it from within another view, rendering a template and returning a value to the calling view? Thanks in advance -
Django custom boolean field representation on template
I would like to use extended custom field on django model to modify the value printed on template. Now appears True/False, and should be Si/No. It will be possible overwriting some of these custom field methods ? class CustomBooleanField(models.BooleanField): def from_db_value() ... def to_python() ... def value_to_string() ... class Budget(models.Model): periodic = app_fields.CustomBooleanField(verbose_name="Recurrente", default=False) Anybody could help me please ? Thanks in advance. -
How to create a search field for searching all pages in Django?
I created a system with Django. In this system there are several apps, models and pages. I create a search field in the navigation. I want to a user can search all pages from this field. For example I have Customer list page when user type customers to search field user can go to this page. how can I do it? navigation.hmtl <div class="collapse" id="search-nav"> <form class="navbar-left navbar-form nav-search mr-md-3"> <div class="input-group"> <div class="input-group-prepend"> <button type="submit" class="btn btn-search pr-1"> <i class="fa fa-search search-icon"></i> </button> </div> <input type="text" placeholder="Search ..." class="form-control"> </div> </form> </div> -
while running django server "ModuleNotFoundError: No module named 'corsheaders' "and "OSError: [WinError 123] " are thrown
Below errors thrown while running the Django server,( django rest framework application) while running django server "ModuleNotFoundError: No module named 'corsheaders' "and "OSError: [WinError 123] " are thrown while running django server "ModuleNotFoundError: No module named 'corsheaders' "and "OSError: [WinError 123] " are thrown while running django server "ModuleNotFoundError: No module named 'corsheaders' "and "OSError: [WinError 123] " are thrown Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\Siva\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Siva\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "E:\apiproject\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "E:\apiproject\venv\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "E:\apiproject\venv\lib\site-packages\django\utils\autoreload.py", line 76, in raise_last_exception raise _exception[1] File "E:\apiproject\venv\lib\site-packages\django\core\management\__init__.py", line 357, in execute autoreload.check_errors(django.setup)() File "E:\apiproject\venv\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "E:\apiproject\venv\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "E:\apiproject\venv\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "E:\apiproject\venv\lib\site-packages\django\apps\config.py", line 90, in create module = import_module(entry) File "C:\Users\Siva\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'corsheaders' Traceback (most recent call last): File "manage.py", line 22, in <module> main() File "manage.py", line 18, in … -
What is the fastest way to copy data from regular table to partitioned table in django?
I have two same structured tables difference is one of them is partitioned. I want to copy data from regular table to partitioned one. I want to write dynamic and optimal solution.What is your idea for this? My db is Postgres -
How to filter on subclass fields in an InheritanceQueryset (avoiding a FieldError)
On the filtering action of a datatable I'm getting the following issue: I have an inheritance queryset containing 2 Models inheriting from the Equipment Model: Motors & PU: class Equipment(EngineeringItem): ... class Motor(Equipment): cos_phi = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) class PU(Equipment): cos_phi = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) <InheritanceQuerySet [<Motor: M624>, <PU: U103>, <Motor: I501>, '...(remaining elements truncated)...']> When applying the following filter q (django.db.models.Q object): <Q: (AND: ('cos_phi__icontains', '0.7'))> queryset = queryset.filter(q) I get the following field error: django.core.exceptions.FieldError: Cannot resolve keyword 'cos_phi' into field. Choices are:... With the fields of 'Equipment' indicated. Clearly I can only filter on the Equipment fields, but I'm looking for a way to still filter on 'cos_phi', as all items in the queryset have this field (This filter is applied when loading the data) -
How to delete an uploaded image with a html button in Django?
How can I delete an uploaded image from my updateview template? I tried using <input type="checkbox" onchange="submit();" name="{{ object.image }}-clear" id="{{ object.image }}-clear_id"> to remove the image but with no success. I have django_cleanup in INSTALLED_APPS so I am just looking for a simple method to remove the image from my object and return to the currrent update view. Code: models.py: class Report(models.Model): image = models.FileField(storage=PublicMediaStorage(), blank=True) forms.py: class ReportCreate(forms.ModelForm): def __init__(self, *args, **kwargs): super(ReportCreate, self).__init__(*args, **kwargs) class Meta: model = Report fields = ['image'] widgets = {'image': forms.FileInput(attrs={'onchange': 'submit();'}),} Views.py: class ReportView(LoginRequiredMixin, UserPassesTestMixin, UpdateView): model = Report template_name = 'myapp/report_update.html' form_class = forms.ReportCreate def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form) urls.py: urlpatterns = [ path('report/<int:pk>/', ReportView.as_view(), name='report-view'), ] html: <img src="{{ object.image }}"/> <input type="file" name="image" onchange="submit();" class="fileinput fileUpload form-control-file" id="id_image"> <input type="checkbox" onchange="submit();" name="{{ object.image }}-clear" id="{{ object.image }}-clear_id"> -
In Django ORM filter objects by annotation on the group by
I have this model and I need to filter all the objects A where the daily duration, for the same user, is greater than a value X. class A(models.Model): user = models.ForeignKey(User) day = models.CharField(choices=["monday", "tuesday" ... "sunday"]) duration = models.FloatField() -
How can I specify in the filter the presence of certain objects?
How can I specify in the filter the presence of certain objects? I have a ManyToManyField called members. I need to create a query where I specify that this object will only have 2 members: user1, user2. I write Model.objects.filter(members=[user1,user2]) But django returns me all models that have one of their user1, user2. -
Application showing login page even after user is logged in Django
When I log in to the Django project and then press the back button or enter the login page url, I am getting the Login page again even when the user is authenticated. I have tried adding the redirect_authenticated_user as in the code below: from django.contrib import admin from django.urls import path, include from django.contrib.auth.decorators import login_required from django.contrib.auth import views as auth_views from django.conf.urls import url admin.autodiscover() admin.site.login = login_required(admin.site.login) urlpatterns = [ path('admin/', admin.site.urls), path('accounts/', include('django.contrib.auth.urls')), path('accounts/login/', auth_views.LoginView.as_view(redirect_authenticated_user=True), name='login'), ] Not sure if I have implemented something incorrectly. -
Django query ValueError: Cannot assign "''": "Post.client" must be a "User" instance
ValueError: Cannot assign "''": "Post.client" must be a "User" instance. def create_contests(request): if request.method == 'POST': length = request.POST.get('length') client = request.POST.get('client') title = request.POST.get('title') description = request.POST.get('description') amount = request.POST.get('amount') skills = request.POST.get('skills') deadline = request.POST.get('deadline') post = Post.objects.create( client = client, title=title, description=description, skills=skills, amount = amount, deadline=deadline ) for file_num in range(0, int(length)): PostImage.objects.create( post=post, images=request.FILES.get(f'images{file_num}') ) -
Get data of Bookings of all users for admin user. Plus count bookings of each user?
I am working on admin panel APIS in DRF. There are two types of users Service Seeker(ss) and Service Provider(sp). I have used both of them as a foreign key to User model in my Booking model. A user can switch to ss and sp or vice versa. My question is that how I can get all the bookings against a user so that admin can see that data. Plus I also want to get count for those bookings. Thanks in advance for your addition to my knowledege. Here is my models.py: ORDER_STATUS = ( ('Pending', 'Pending'), ('Active', 'Active'), ('Complete', 'Complete'), ('Incomplete', 'Incomplete'), ('Declined', 'Declined') ) class Booking(models.Model): start_date = models.DateTimeField(default=datetime.datetime.today) end_date = models.DateTimeField(default=datetime.datetime.today) modified_data = models.DateTimeField(auto_now_add=True) order_status = models.CharField(max_length=50, choices=ORDER_STATUS, null=True, blank=True, default='Pending') ss = models.ForeignKey(User, on_delete=models.CASCADE, related_name="booking_ss_id") sp = models.ForeignKey(User, on_delete=models.CASCADE, related_name="booking_sp_id") price = models.DecimalField(max_digits=10, decimal_places=2) category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name="booking_category_id") -
How to subscribe to GCP Pub/Sub when running a server of Django?
I have a backend service using django, I need to subscribe a message queue hosted on GCP pub/sub Here's the example code provided by Google: https://cloud.google.com/pubsub/docs/pull Implementing a function is easy, but I will have to start the django server via the command like: python manage.py runserver Or ASGI commands This subscribing function should be running continuously, better in the background, How can I achieve this? -
How to create a filter a column in a data table in Django?
I have a data table in my Django project. This data table is for listing customers. The customer has attributes like name, country, email, etc... I want to put a button like a dropdown menu for listing countries of customers. (Excel-like or similar logic) But I just need this in the country column. How can I do that? customer_list.html {% extends "layouts/base.html" %} {% block title %} Customer List {% endblock %} <!-- Specific Page CSS goes HERE --> {% block stylesheets %}{% endblock stylesheets %} {% block content %} <div class="content"> <div class="page-inner"> <div class="page-header"> <div class="row"> <div class="col"> <h4 class="page-title">Customer List</h4> </div> <div class="col"> <a href="/customer"> <button class="btn btn-primary btn-round" style="">Add new customer</button> </a> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">My Customers</h4> </div> <div class="card-body"> <div class="table-responsive"> <table id="multi-filter-select" class="display table table-striped table-hover grid_" > <thead> <tr> <!-- class="filter" --> <th index="0">Customer Name</th> <th>Country</th> <th>E-Mail</th> <th>Phone</th> <th>VAT Number</th> <th>Operations</th> </tr> </thead> <tfoot> <tr> <th>Customer Name</th> <th>Country</th> <th>E-Mail</th> <th>Phone</th> <th>VAT Number</th> <th>Quick Operations</th> </tr> </tfoot> <tbody> {% for customer in customer_list %} <tr> <td>{{customer.customer_name}}</td> <td>{{customer.country}}</td> <td>{{customer.email}}</td> <td>{{customer.telephone}}</td> <td>{{customer.VATnumber}}</td> <td> <div class="row"> <a href="/customers/{{ customer.id }}/profile" class="btn btn-outline-primary btn-sm" data-toggle="tooltip" title="View Customer" ><i class="fas … -
send django model form to view as response
any way to send django model form as JsonResponse?! It's a simple edit form where I am passing id to view using axios post request, and inside the view i catch the instance form of that id, (the problem appears here how to send back this instance form to my template). I've tried django-remote-forms there i get errors as the object type is not is not JSON serializable.. and so on errors. any better way where I'm doing wrong please inform me(new to django:) -
Django Allowed_host issue despite entered in field
I was following this tutorial about Django 08:00 integration and I can't access any hosts other than local domains. I have configured the allowed hosts as such: ALLOWED_HOSTS = ['test.domains','productivity','127.0.0.1','localhost'] I run the Django server using this command: python manage.py runserver 0.0.0.0:8002 What I am trying to do is to access the Django website using by typing this URL (for example) http://test.domains:8002. For the life of me, I can't seem to get it working as simply as Tony does. I've been on countless thread about allowed_hosts but all of them seems to be solved once you entered the socked in the allowed_host list, and I've also restarted apache 2. Of note, when I use, for example 0.0.0.0:8002 I see the notification in the terminal about 0.0.0.0 not being part of the allowed domains but when I try any test.domains or productivity there is no ping. Thank you for your time and help. -
Application Error after successfully deploying Django API to Heroku
I am making an api for my deep learning model. The api is properly working on localhost. I tried to deploy it on Heroku. It is deployed but when I open the link it gives "Application error" like below image Application error image Release log: 2021-02-23 05:47:36.841582: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set Operations to perform: Apply all migrations: admin, auth, contenttypes, sessions Running migrations: Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying admin.0003_logentry_add_action_flag_choices... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying auth.0009_alter_user_last_name_max_length... OK Applying auth.0010_alter_group_name_max_length... OK Applying auth.0011_update_proxy_permissions... OK Applying auth.0012_alter_user_first_name_max_length... OK Applying sessions.0001_initial... OK Build log: -----> Building on the Heroku-20 stack -----> Python app detected ! Python has released a security update! Please consider upgrading to python-3.7.10 Learn More: https://devcenter.heroku.com/articles/python-runtimes -----> Requirements file has been changed, clearing cached dependencies -----> Installing python-3.7.8 -----> Installing pip 20.1.1, setuptools 47.1.1 and wheel 0.34.2 -----> Installing SQLite3 -----> Installing requirements with pip Collecting absl-py==0.11.0 Downloading absl_py-0.11.0-py3-none-any.whl (127 kB) Collecting asgiref==3.3.1 Downloading asgiref-3.3.1-py3-none-any.whl (19 kB) Collecting astunparse==1.6.3 Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting cachetools==4.2.1 Downloading cachetools-4.2.1-py3-none-any.whl … -
I need to styling the FileInput by adding bootstrap class and it do nothing
I need to styling the FileInput by adding bootstrap class, and after I added the bootstrap class for forms it did nothing, How Can I styling the both (FileInput) and (ClearableFileInput) by bootstrap or by styling manully My form class Video_form(forms.ModelForm,): class Meta: model = Video fields = ('video', 'video_poster') widgets = { 'video_poster': forms.ClearableFileInput(attrs={'class': 'form-control'}), 'video': forms.FileInput(attrs={'class': 'form-control'}), } My views def VideosUploadView(request, *args, **kwargs): all_videos = Video.objects.all() V_form = Video_form() video_added = False if not request.user.is_active: # any error you want return redirect('login') try: account = Account.objects.get(username=request.user.username) except: # any error you want return HttpResponse('User does not exits.') if 'submit_v_form' in request.POST: print(request.POST) V_form = Video_form(request.POST, request.FILES) if V_form.is_valid(): instance = V_form.save(commit=False) instance.author = account instance.save() V_form = Video_form() video_added = True contex = { 'all_videos': all_videos, 'account': account, 'V_form': V_form, 'video_added': video_added, } return render(request, "video/upload_videos.html", contex) The html template <form action="." method="post" enctype="multipart/form-data"> {% csrf_token %} {{V_form.as_p}} <input type="file" name="" value="" accept="video/*" class="form-control"> <button class="btn btn-primary btn-block mt-5" name="submit_v_form"> <i class="icon-upload icon-white " name="submit_v_form"></i> Upload </button> -
django Models One Author to Multiples Books Relationship
I'm trying to create a relationship on Django on models.py one Author could be the writer of multiples books for a Bookshop project. Please find below how the models.py looks. I'm afraid is not working correctly. Thank you. from django.db import models from django.utils import timezone from django.urls import reverse # Create your models here. class Category(models.Model): # books categories name = models.CharField(max_length=200,db_index=True) slug = models.SlugField(max_length=200,unique=True) class Meta: ordering = ('name',) verbose_name = 'category' verbose_name_plural = 'categories' def __str__(self): return self.name def get_absolute_url(self): return reverse('category_detail',args=[self.slug]) class Product(models.Model): # books as products category = models.ForeignKey(Category,related_name='products',on_delete=models.CASCADE) book_id = models.CharField(max_length=10, db_index=True, blank=True) name = models.CharField(max_length=200, db_index=True) slug = models.SlugField(max_length=200, db_index=True) image = models.ImageField(upload_to='products/%Y/%m/%d',blank=True) image2 = models.ImageField(upload_to='products/%Y/%m/%d',blank=True) image3 = models.ImageField(upload_to='products/%Y/%m/%d',blank=True) description = models.TextField(blank=True) price = models.DecimalField(max_digits=10, decimal_places=2) available = models.BooleanField(default=True) created = models.DateTimeField(default=timezone.now) updated = models.DateTimeField(auto_now=True) class Meta: ordering = ('-created',) index_together = (('id', 'slug'),) def __str__(self): return self.name def get_absolute_url(self): return reverse('product_detail',args=[str(self.slug)]) class Author(models.Model): # book's author product = models.ForeignKey(Product,related_name='authors',on_delete=models.CASCADE) first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) def __unicode__(self): return self.first_name + " " + self.last_name -
Axios not responsive at all, React Native with Django backend
I am trying to make a post request to a django-based REST API inside an RN project with an Axios post request. I am getting no network error messages, no crash, no errors no whatsoever. I tried the same code on an Expo project and I was facing the same reaction (no reaction). I already did all required steps (like using the IP address instead of localhost) for making Django local-host development-friendly: CORS_ORIGIN_ALLOW_ALL = True CORS_ALLOW_CREDENTIALS = True ALLOWED_HOSTS = ['*'] Also 'rest_framework', 'corsheaders', as well as 'django.middleware.common.CommonMiddleware', 'corsheaders.middleware.CorsMiddleware', I installed the latest packages for Axios, RN. The server is not receiving any requests at all too. So my initial guess is there is something blocking like an SSL issue or some kind of internal-error/loop. Disabled the firewall too, and you can guess the scenario. -
Django ImportError: Module "social_core.backends.google" does not define a "GoogleOpenId" attribute/class
I've cloned my working Django app into a Debian based Linux distribution, I've installed all dependencies, but when trying to login with email and password or with Google account it throws me the following error: ImportError: Module "social_core.backends.google" does not define a "GoogleOpenId" attribute/class I have the following dependencies for authentication: django-allauth==0.42.0 django-rest-auth==0.9.5 google-auth==1.27.0 oauthlib==3.1.0 requests-oauthlib==1.3.0 social-auth-app-django==3.1.0 social-auth-core==4.0.3 It was working well in Ubuntu and MacOs, the problem have appeared cloning to this Debian Based Distro.