Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
passenger_wsgi.py not responding while deploying django project on cpanel
I am trying to deploy my django project on cpanel for the first time. The problem I am dealing with is that when I create a python app in cpanel, the passenger_wsgi.py file is created but does not run as expected. These are the steps I have taken so far: first I cloned my project then I started to setup a python application from cpanel a passenger_wsgi.py file and two folders named temp and public are now created in my project directory(as you can see in the screenshot). (https://i.stack.imgur.com/hEZeI.png) As I saw in youtube videos, in this step I must be able to see a message in my web url saying: it works! python x.y.z (https://i.stack.imgur.com/QmT63.png) but it does not show this message and only error 403 is retrieving (you can see the response in the screenshot) -
Latency in video streaming from backend to frontend (and vice versa)
I am building a mobile app in flutter X firebase, with the backend in Django. The issue is, my Computer vision algorithm is on the front end, and it sends live key points to the backend where the classifier classifies, and sends the result back to the frontend. This is causing a huge delay of 200ms+. How can I fix this? I tried the CV algo on the frontend, and classifier on the backend to reduce the complexity of the server side. But im out of ideas now. Please let me know if establishing a websocket would help me achieve the desired goals. Also, I wanted to know if i could host the algo on a server rather then using the client's mobile's computation power to reduce the latency. Please note that i am in dire of reducing the latency. All answers are appreciated, thanks! -
Stop Exasol sessions with sqlalchemy+django querries
I have Django endpoint that retreive data from Exasol DB using sqlalchemy. It looks as simple as that: @api_view(['GET']) def exasol_data_view(request): *** engine = create_engine(connection_string) Session = sessionmaker(bind=engine) with Session() as session: result = session.execute(query) data = result.fetchall() session.close() I want to implement a feature where the system cancels a request whenever the user calls the same endpoint repeatedly. This will prevent Exasol from accumulating a large queue of pending requests when a user repeatedly clicks the 'request' button. I tried multiple options including session.close(), close_all_sessions(), and so on. Additionally, engine.poop.status() always gives info that I have only 1 connection. P.S. I'm not allow to send row sql request with KILL SESSION -
How to raise a ValidationError in the ModelForm's save method in Django?
I want my ModelForm error handler to show validation errors from the save() method just like they do in the clean() method - i.e. as a warning on the admin form, instead of generating a 500 page. The code flow is as follows, in admin.py: class XForm(ModelForm): def save(self, **kwargs): super().save(**kwargs) try: self.instance.update_more_stuff_based_on_extra_fields_in_the_form() except IntegrityError: raise ValidationError(_("Earth to Monty Python.")) return self.instance class XAdmin(admin.ModelAdmin): form = XForm admin.site.register(X, XAdmin) This results in a debugger's 500 page when the validation error is triggered, not the preferred admin warning. Note: The following question addresses the similar problem of raising a validation error within the model's save method. Here we want to raise the error in the model form's save method. -
Weasyprint - Django, how to disable header / footer
Good day, I have a problem, I'm creating a pdf Api and I need to disable the header. view : @api_view(["GET", "POST"]) def test(request): # Renderizar la plantilla HTML con los datos # datos = json.loads(request.body) datos = {"name": "pedro"} context = { "STATIC_URL": settings.STATIC_URL, } query = Personas.objects.filter(name=datos.get("name")).values()[0] query = ( ) context.update({ "query" : query }) html_template = render_to_string( "pdfs_templates/Certificado Servicio.html", context ) template {% load static %} {% block content %} <!DOCTYPE html> <html> <head> <style type="text/css" media="all"> @page { /* size: A4 portrait; /* can use also 'landscape' for orientation */ margin: 20px 1cm; /* Margen de la página */ } table, th, td { border: 1px solid black; } .table1-cont { width: 95%; margin-top: 15px; } .tac { text-align: center; } .table-r1 { width: 30%; } .table-r2 { width: 70%; } #content { background-color: red; height: 600px; } tbody, tr, td { /*border: none;*/ } </style> </head> <body> {% include 'pdfs_templates/head.html' %} <div> <div> <label class="txt-lb-3" for="">La Dirección General de Haberes/ o Área Responsable de la Liquidación de haberes extiende el presente certificado</label> </div> <div id="content"> <div class="tac"> <div class="table1-cont"> <table> <tbody> {%for q in query %} <tr> <td class="txt-lb-3 table-r1">{{q.0}}</td> <td class="txt-lb-3 table-r2">{{q.1}}</td> </tr> … -
OSError [Errno 101] Network is unreachable, when trying to send Email in Django using smtplib on GoDaady Server
I have a strange issue. I have a Payment app in Django, deployed on GoDaddy. In app, I need to send email to the user when their payment is successful. I am using smtplib and email libraries. The steps I did are: Created Application Password in Google Account Used my email, that app password, 587 port and smtp.gmail.com server The problem is, it totally works fine on my local host and I receive the email. But, it is not working on GoDaddy and I receive the following error: [Errno 101] Network is unreachable Traceback (most recent call last): File "/home/g549hesohwxf/public_html/pl_payment_gateway/app/utils.py", line 52, in send_email with smtplib.SMTP(smtp_server, smtp_port) as server: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/alt/python311/lib64/python3.11/smtplib.py", line 255, in __init__ (code, msg) = self.connect(host, port) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/alt/python311/lib64/python3.11/smtplib.py", line 341, in connect self.sock = self._get_socket(host, port, self.timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/alt/python311/lib64/python3.11/smtplib.py", line 312, in _get_socket return socket.create_connection((host, port), timeout, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/alt/python311/lib64/python3.11/socket.py", line 851, in create_connection raise exceptions[0] File "/opt/alt/python311/lib64/python3.11/socket.py", line 836, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable I searched around the web and got to know that many hosts block this ports by default to avoid spamming. I tried talking to GoDaddy support. They said following things: GoDaddy does not block … -
Django Model Auto Translation
I have a website in Django. All the static text in the website ( include the admin ) is available in 3 different languages and the user can switch between them. I also have a model in the website called Product with the fields name and description. This is how the product would be saved within the database: product_name = Headphones product_description = Ordinary headphones Is there any way/ library that can automatically translate the field values for each Product object depending on the language chosen? -
Getting CSRF 403 error with django server and nexjs client
I am sending requests to Django server from next.js but I am getting error :403 Forbidden (CSRF cookie not set.), even after sending the csrf token. I am running both Django server and next.js locally. Requesting to same api from postman/insomnia works perfectly fine but not with my next.js app. I did some digging and found it may be issue with CORS, so I did some changes in settings.py but still getting same error. Please help me understand what is going wrong, how I can debug, and what changes should I make. First, I fetch CSRF token using another API which works fine. Then in second api, I add my CSRF token. fetching in Next.js const uploadFile = async () => { // Select file from input element or any other method const fileInput = document.getElementById('fileInput'); const file = fileInput.files[0]; const form = new FormData(); form.append("image", file); const options = { method: 'POST', headers: { cookie: 'csrftoken=2V7dKpZXLN24pLDdDkub9GxM2ljzI0nI', 'Content-Type': 'multipart/form-data; boundary=---011000010111000001101001', 'X-CSRFToken': '2V7dKpZXLN24pLDdDkub9GxM2ljzI0nI' } }; options.body = form; fetch('http://127.0.0.1:8000/getinfo', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err)); }; my settings.py in Django : # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = … -
How can I delete a holiday from a person in vue.js?
I am new to vue.js and I make a project with vue.js and django I write this code in vue.js <i class="mdi mdi-trash-can" @click.prevent="confirm(holiday.id)" ></i> deleteHoliday(holidayID){ setTimeout(()=>{ session.delete(`api/person/${this.$route.params.id}/holiday/${holidayID}/actions/`).then(()=>{ this.fetchPersonHolidays(); }); this.drawerMsg = ""; },5000); }, confirm(holidayID){ Swal.fire({ title: "", text: "", icon: "warning", showCancelButton: true, confirmButtonColor: "#34c38f", cancelButtonColor: "#f46a6a", confirmButtonText: "" }).then((result)=>{ if (result.value){ eventCreate(`${holidayID}`, 3) this.deleteHoliday(holidayID) Swal.fire( "", "success" ); } }); And in django I write this in url file path('api/person/<int:pk>/holiday/<int:id>/actions/', PersonHolidaysActionsView.as_view()) And in views.py file this: class PersonHolidaysActionsView(generics.RetrieveUpdateDestroyAPIView): permission_classes = [permissions.IsAdminUser] serializer_class = PersonHolidaysSerializer queryset = PersonHoliday.objects.all() But I can't delete the holiday of the person. -
Gunicorn Freeze issue
I'm encountering a problem with Gunicorn freezing. I'm hosting a Django application using Docker with Nginx as the web server container and Gunicorn as the application server. The Django instance is replicated in three instances with the following Gunicorn configuration. # gunicorn_config.py worker_class = "gevent" bind = "0.0.0.0:8000" workers = 1 worker_connections = 10 max_requests = 1000 max_requests_jitter = 50 # Request timeout (adjust as needed) timeout = 200 # 30 seconds # Log settings accesslog = "-" # Log to stdout errorlog = "-" # Log to stderr loglevel="debug" # Preload the application before forking worker processes preload = True gunicorn -c gunicorn_config.py django_app.wsgi:application Sometimes, my Gunicorn workers freeze and don't accept any incoming requests. In the Gunicorn log, the message shows the worker stops with signal 9 EPIPE. I can't seem to find the issue. It works fine after I restart the Django containers, same issue occurs after sometime. Meanwhile, I encountered an error on the Redis side: "BusyLoadingError: Redis is loading the dataset in memory." Redis is used for Celery broker, Django channels, and Django caching. Could Redis be the reason for the issue? Package versions: ------------ django = "3.2.12" celery = "5.1.2" redis = "^4.4.1" channels-redis … -
Django MSSQL trying to connect with some arbitrary schema rather than dbo
I am deploying a Django service for a client on their Azure env. When switching the DB connector to their Azure SQL DB I get the following error: django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]The specified schema name "b96c7a94-5645-4f7d-ab79-b42d99373823@2fc13e34-f03f-498b-982a-7cb446e25bc6" either does not exist or you do not have permission to use it. (2760) (SQLExecDirectW)')) This is weird, becuase I have not specified any schema name in Django, and dbo schema does exists in the client DB. For example I am able to run a python script with simple queries like this: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_SCHEMA = 'dbo' or CREATE TABLE dbo.Example_test ( ID INT PRIMARY KEY, Name VARCHAR(50), Age INT ) I tried specifing the schema to dbo in the setting like this: DATABASES = { 'default': { 'ENGINE': 'mssql', 'NAME': NAME, # Initial Catalogue 'USER': USER, # Azure Client Id 'PASSWORD': PASSWORD, # Secret Key 'HOST': HOST, # Data Source 'PORT': '1433', 'OPTIONS': { 'driver': 'ODBC Driver 17 for SQL Server', 'extra_params': 'Authentication=ActiveDirectoryServicePrincipal', 'options': '-c search_path=dbo' }, } } but then I get this error: django.db.utils.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL … -
ValueError in django project [duplicate]
**Hi all i am creating a student login page and gettting the error below, and to my surprise the same code for adminlogin works perfect. I am new to django so kindly clear my doubts to reduce this types of errors in future. Thanks in advance ** ValueError at /studentlogin/ The view myapp.views.studentlogin didn't return an HttpResponse object. It returned None instead. Request Method: GET Request URL: http://localhost:8000/studentlogin/ Django Version: 5.0.4 Exception Type: ValueError Exception Value: The view myapp.views.studentlogin didn't return an HttpResponse object. It returned None instead. Exception Location: C:\Users\Hardip Gajjar\AppData\Local\Programs\Python\Python312\Lib\site-packages\django\core\handlers\base.py, line 332, in check_response Raised during: myapp.views.studentlogin Python Executable: C:\Users\Hardip Gajjar\AppData\Local\Programs\Python\Python312\python.exe Python Version: 3.12.2 Python Path: ['E:\\KantamEducation', 'E:\\KantamEducation', 'C:\\Program ' 'Files\\JetBrains\\PyCharm2023.3\\plugins\\python\\helpers\\pycharm_display', 'C:\\Users\\Hardip ' 'Gajjar\\AppData\\Local\\Programs\\Python\\Python312\\python312.zip', 'C:\\Users\\Hardip Gajjar\\AppData\\Local\\Programs\\Python\\Python312\\DLLs', 'C:\\Users\\Hardip Gajjar\\AppData\\Local\\Programs\\Python\\Python312\\Lib', 'C:\\Users\\Hardip Gajjar\\AppData\\Local\\Programs\\Python\\Python312', 'C:\\Users\\Hardip ' 'Gajjar\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages', 'C:\\Program ' 'Files\\JetBrains\\PyCharm2023.3\\plugins\\python\\helpers\\pycharm_matplotlib_backend'] Server time: Tue, 23 Apr 2024 11:56:21 +0530 my views.py code is as under, def studentlogin(request): if request.method == 'POST': try: user = Student.objects.get( email=request.POST['email'], password=request.POST['password'] ) request.session['email'] = user.email request.session['fname'] = user.fname return render(request, 'studentindex.html') except: msg = 'Invalid Email or Password' return render(request, 'studentlogin.html',{'msg':msg}) and my student login HTML form code is as under, {% extends 'header.html' %} {% load static %} {% block content %} <!-- Admin Login Page … -
Dependency check with liccheck fails - Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier
In a django app, with poetry as the dependency/packaging manager, I am using a library (also a django one) that is used by multiple django apps. Those different apps are using different versions of django. So, in the pyproject.toml file of the library, the django dependency is defined like so: django = ">=3.2.18,<4.0.0 || >=4.0.10,<4.1.0 || >=4.1.7" while in my application I am have: django="4.1.13" The dependency check with liccheck is done as follows: poetry export --without-hashes -f requirements.txt > requirements.txt liccheck -r requirements.txt After I run the check, it fails for with the following error message: pkg_resources.extern.packaging.requirements.InvalidRequirement: Expected matching RIGHT_PARENTHESIS for LEFT_PARENTHESIS, after version specifier django (>=3.2.18,<4.0.0 || >=4.0.10,<4.1.0 || >=4.1.7) ~~~~~~~~~~~~~~~~~^ It seems that the django dependency from the library is affecting the dependency check. Initially I had the 0.9.1 version of liccheck and I have already updated it to the latest 0.9.2 but with the same results. Any idea? -
Django CloudinaryField: Setting Default Privacy on Upload and Generating Presigned URLs for Public Access
I'm working on a Django project where I have a model Media with an image field stored using CloudinaryField. Currently, I'm able to upload images via multipart/form, and I can generate a public link using media_object.image.url. However, I'm facing two challenges: Default Upload Privacy: How can I set the default privacy of the uploaded images to be private? Generating Presigned URLs: I need to generate presigned URLs for public access to these images, but I want these URLs to expire after a certain period, say 5 minutes. Here's what my current model looks like: from django.db import models from cloudinary.models import CloudinaryField class Media(models.Model): # Other fields... image = CloudinaryField('document', null=True, blank=True) Could someone please guide me on how to achieve these two objectives? Any help or pointers would be greatly appreciated. Thanks! -
(AWS + React + Django) Storing API Keys for my Frontend
I know this question has been asked before and I've reviewed the posts here: How do I hide an API key in Create React App? and here Using API keys in a react app that API keys in React are not secure if stored as environment variables and should instead be retrieved from your backend, other requests are typically handled with cookies and session authentication. I built my application with Django REST Framework for the backend, this is deployed to AWS Beanstalk. My frontend is built on React that I was planning on deploying to S3. I'm still having trouble putting together how this applies in my case though. In my case I have an REST API built that requires SessionAuthentication for all requests except for two that I built in API key authentication for: Logging in and creating a new account. Reason being is because the user wont have an account to authenticate with, but I still wanted to have some sort of authentication built in for my front end. I also wanted to allow the front end to display user data (like a list of users) without requiring a user to be signed in. In these cases, is … -
django create a record in a table with a foreign key
I want to make a new entry in table with foreign key, through the UI The Model: class SchemeMovement(models.Model): id = models.AutoField(db_column='Id', primary_key=True) scheme = models.ForeignKey(Scheme, models.DO_NOTHING, db_column='Scheme_Id', blank=True, null=True) The view: def schmov(request): if request.method == "POST": form = SchememovForm(request.POST) if form.is_valid(): try: form.save() return redirect('/showSchemeMovement') except: pass else: form = SchememovForm() return render(request,'indexSchemeMovement.html',{'form':form}) The html: <form method="POST" class="post-form" action="/schmov"> {% csrf_token %} <div class="container"> <br> <div class="form-group row"> <label class="col-sm-1 col-form-label"></label> <div class="col-sm-4"> <h3>Enter Details</h3> </div> </div> <div class="form-group row"> <label class="col-sm-2 col-form-label">Scheme Code:</label> <div class="col-sm-4"> {{ form.scheme.scheme_code }} </div> </div> But get blank on the UI: How to make a new entry through the UI? -
how to change the existing "add to model" url in django admin
enter image description here So like this, I created a proxy model then I registered the proxy model, now I want to create a proxy for this model, when I go to the form, it will be added to the model that the proxy model was created for. model.py class Congregation(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) masteruser = models.OneToOneField( Master, verbose_name='Master Data', on_delete=models.CASCADE, related_name='Congregation', ) member_number = models.IntegerField() alias_name = models.CharField(max_length=255) chinese_name = models.CharField(max_length=255) is_congregation = models.BooleanField(default=False) worship_id = models.IntegerField() created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True) updated_at = models.DateTimeField(auto_now=True, null=True, blank=True) class Meta: verbose_name = 'Data Jemaat' verbose_name_plural = 'Data Jemaat' def __str__(self): return self.masteruser.full_name model_proxy.py from master.models import Congregation, class CongregationManage(models.Manager): def get_queryset(self): return super(CongregationManage, self).get_queryset().filter( is_congregation=True ) class CongregationProxy(Congregation): objects = CongregationManage() class Meta: proxy = True admin.py class CongregationProxyAdmin(nested_admin.NestedModelAdmin): list_display = ('full_name' ,'alias_name', 'chinese_name', 'member_number', 'address' ) date_hierarchy = 'created_at' def full_name(self, obj): return obj.masteruser.full_name def address(self, obj): return obj.masteruser.address admin.site.register(CongregationProxy, CongregationProxyAdmin) So what I hope is that when the congregationProxyAdmin clicks the add button, the URL will be the first one http://127.0.0.1:8000/admin/master/congregationproxy/add/ become http://127.0.0.1:8000/admin/master/master/add/#group-fs-Congregation--inline-Congregation -
django & nginx & uwsgi deployed service not working
I have an issue with django & nginx & uwsgi, deployed service suddenly stopped with no reason few hours ago, so I don't know where to start debugging. (I'm very new to backend eng.) When I run the virtual environment using py manage.py runserver it works and 'sudo systemctl status uwsgi' 'sudo systemctl status nginx' both are active. But when I try to open the admin site with designated url, it doesn't respond and shows timeout error. there are no problems in ssl certifications(valid until next month), and port is opened normally (80, 443). When I tried ssh connection to the server via vscode it also worked. where should I find the problem? please help -
Fatal error in launcher Unable to create process install package
while i try to install any packages in django i get this error Fatal error in launcher: Unable to create process using '"C:\Users\lenovo\Desktop\PCADI\backend\myVenv\Scripts\python.exe" "C:\Users\lenovo\Desktop\data-collection\backend\myVenv\Scripts\pip.exe" install': Le fichier spÚcifiÚ est introuvable. i solve this issue with the following command : python -m pip then install the package that you want like the following command i try to install django-multiupload in my case : python -m pip install django-multiupload and it's installed Successfully installed django-multiupload-0.6.1 -
Table django_celery_beat_clockedschedule' doesn't exist
django_celery_beat_clockedschedule' doesn't exist I successfully installed django-celery-beat package with django==2.1. All migrations are also applied successfully, There are five models are showing in django such as clocked, crontabs, intervals etc. Although when i open there detailed view it says Table '....django_celery_beat_clockedschedule' doesn't exist. It shows the same error for all of them. Note: I also tried too many time to unapply all migrations and reinstalling the django-celery-beat package with no luck -
Django retrieves old content from the database
I've developed an app using Django 5, tested it on my server and my local, and made it in production on my server. The problem is that when a certain action is taken to write or update a record in the database, it's not reflected in the frontend as if it's returning cached data. This only happens to the version in production on my server. I tried the following: Turned the debugging off. Making sure the content was written to the database. Clearing my local cache. Trying to make CSS changes (It works!), but for database content, it doesn't work and no new data is shown. Trying never cache for that view. Checking if there is middleware caching. Deleting pyc files. Making a change to wsgi.py. Restarting Apache several times. Again, This never happens in my local it's just the server. I've also checked older questions, but nothing helps yet. Note: I'm using Django 5, mySQL, Apache, and WSGI on AWS. Your help is highly appreciated. Thanks! -
Getting "Bad Request" error when implementing Google authentication with Django and Djoser
I followed the instructions in this Medium article (https://medium.com/@nitesht.calcgen/google-authentication-using-django-and-djoser-b0ef5f61a50b) to implement Google authentication in my Django application using Djoser. However, when I try to authenticate with Google, I'm getting a "Bad Request" error. I'm currently at the step where I need to make a POST request to the following endpoint: http://127.0.0.1:8000/auth/o/google-oauth2/?state='xxxx'&code='yyyyy'. Additionally, I'm not receiving the expected access and refresh tokens i have "non_field_errors": [ "Invalid state has been provided." ] Bad Request: /auth/o/google-oauth2/ [22/Apr/2024 20:39:13] "POST /auth/o/google-oauth2/?code=4/0AeaY............ -
Docker container is not started due to error: DATABASES is improperly configured. Please supply the ENGINE value on my Django application
Docker container is not started due to error: DATABASES is improperly configured. Please supply the ENGINE value on my Django application. DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': '*name*', 'HOST': '*host*', 'USER': '*user*', 'PASSWORD': '*password*' } } I use Docker container in Azure with postgresql database. Can anyone help solving the problem? please tell me if you need more information. Thank you! When I run my application locally my application is working with my production database connected, so that shows that code in application should work and error is in Azure? Right? -
Custom widget in the choice field Django
I'm passing a form to the template. I need from this template to then pass to another template the option that the user has selected. In this case, one of the payment options. I can do this with ChoiceField, select built-in widget=RadioSelect() and so on. But the ChoiceField should look like this: When you select an option, it is highlighted with an orange box. That is, I have no text at all, and I need to pass it to the handler in views.py. I'm using Django 4.0. How do I do that? class CheckoutForm(forms.Form): payment_method = forms.ChoiceField( choices=CHOICES, widget=... ) I tried using mark_safe to insert the code into the second CHOICES element, and then in the template using a loop to output the payment_method, but it didn't work as I expected -
Django allauth linkedin login with oauth 2.0 updated scopes
I am trying to add a "Sign In with Linkedin" button in a django site with allauth. I tried adding the following configuration to the social providers setting - 'linkedin_oauth2': { 'SCOPE': [ 'openid', 'profile', 'email' ], 'FIELDS': [ 'id', 'name', 'given_name', 'family_name', 'email', 'picture' ], 'PROFILE_FIELDS': [ 'id', 'name', 'given_name', 'family_name', 'email', 'picture' ], 'VERIFIED_EMAIL': True } I also tried by removing all fields and profile fields and I get a code successfully on the redirect url but I think it fails for some reason either when exchanging the code for a token or mapping the profile fields. I don't see any errors in logs but I see Social Network Login Failure An error occurred while attempting to login via your social network account. on the callback url. I also tried adding the old scopes - r_liteprofile|r_basicprofile|r_emailaddress but all those scopes throw an error stating that the scope is not authorized for my application.