Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to edit data from database in Django?
I'm a beginner in Django . I got all data associated with User and displayed it in a table. And one field in the table is a dropdown which can be used to change the value in each row and there is an update button at the end to update changes(if any) in the dropdown.How can i do the updation ? I know it is simple. What should i do ? Just guide me .ThankYou //views.py @method_decorator(login_required, name='dispatch') class AllUsersView(TemplateView): template_name = 'users/all_users.html' def get_context_data(self, **kwargs): context = super(AllUsersView, self).get_context_data(**kwargs) context['users'] = User.objects.all() return context // all-users.html <table class="addrss-list"> <tr> <th>Name</th> <th>Email</th> <th>Country</th> <th>Plan</th> <th>Role</th> <th>Action</th> </tr> {% for user in users %} <tr> <td>{{user.username}}</td> <td>{{user.email}}</td> <td>{{user.country}}</td> <td>{{user.subscription.active_plan.title}}</td> <td> {% if user.role == "student" %} <select> <option selected>Student</option> <option>Tutor</option> </select> {% elif user.role == "tutor" %} <select> <option selected>Tutor</option> <option>Student</option> </select> {% endif %} </td> <td><a href="/update-user/{{user.id}}" class = "text-decoration-none">Update</a></td> </tr> {% endfor %} </table> -
Work with templates as frontend developer
I have accepted a job, in which I have to work on some html and css in frontend. However, the files I was given to work with seem to be interpreted by some kind of interpreter (I think Django or Jinja2). All I have however are frontend files and I cannot figure out, how to debug my code without any interpreter. F:. ├───static │ ├───css │ └───images │ └───navigation └───templates ├───admin ├───cart ├───home ├───order ├───partials ├───payment ├───product ├───ticket └───user above I have listed the folders I have to work with. Each folder only contains html files, that look like this for example: <input id="navi-open" type="checkbox" name="" class="ct" /> <div id="navigation" class="column"> <label for="navi-open" class="navi-button"> <img src="{{ url_for('static', filename='images/cancel.png') }}" alt="" /> </label> <div id="navigation-items" class="column h-sb"> <div class="category"> <a href="{{ url_for('home.home') }}" style="opacity:1" class="navigation-item light {{ 'active' if current_page == 'homepage' else '' }}"> <div style="opacity:1" class="icon"> <img src="{{ url_for('static', filename='images/karma_blackwhite.png') }}" alt="" style="filter: invert(0);" /> </div> <div class="label">Homepage</div> <div class="tooltip">Homepage</div> <div class="indicator"></div> </a> <a href="{{ url_for('home.news') }}" class="navigation-item {{ 'active' if current_page == 'news' else '' }}"> <div class="icon"> <img src="{{ url_for('static', filename='images/navigation/newspaper.png') }}" alt="" /> </div> <div class="label">News</div> <div class="tooltip">News</div> <div class="indicator"></div> </a> <a href="{{ url_for('home.about') }}" class="navigation-item … -
How to avoid typing "python" at the begining of new command [closed]
I have two notebooks Windows 10. Both with same installed PyCharm version. If I want to perform a command: At the first one I should type: manage.py runserver At another one I must type: python manage.py runserver (without word "python" the command would not perform). How to fix at the 2nd notebook to avoid typing "python" every time ? P.S. I added all routes to python39.exe to the PATH - no result. -
module has no Attribute in Django
i check everything but i still can't figure out the problem. this is the error that i get "AttributeError: module 'users.views' has no attribute 'CustomerSignUp' " urls.py path('customer/register/', views.CustomerSignUp.as_view(), name='customer_homepage'), path('merchant/signup/',views.MerchantSignUpView.as_view(), name='merchant_signup'), views.py class CustomerSignUpView(CreateView): model = User form_class = CustomerSignUpForm template_name = 'registration/signup_form.html' def get_context_data(self, **kwargs): kwargs['user_type'] = 'customer' return super().get_context_data(**kwargs) def form_valid(self, form): user = form.save() login(self.request, user) return redirect('catalog:index') thanks beforehand. -
Using Proxy as Static IP [PythonAnywhere] [closed]
recently I deployed a python web on Pythonanywhere and I also integrate some third-parties in it, then turned out I need a Static IP for third-parties to add to whitelist. Unlucky for me, PythonAnyWhere doesn't support it. As I intend to use a Proxy server for this purpose, will it work or do you have any advices for it. Many thanks in advance, -
Which Language or Framework Should I Use to Create an ETL
I am trying to build an ETL app which can schedule automated ingestion of weather and agriculture data from websites like agromonitoring.com and openweathermap.org. The app should, on schedule, pull data from an API, split the contents of the JSON response into individual JSON files and save it in AWS S3. The same app should also POST this same JSON to another API endpoint. I am unsure which language/framework or technology to study and use for this project. I tried with Apache Nifi but I am unable to figure out how to dynamically change the date parameter on the API's URL. What is the easiest and fastest way to do this? Thank you in advance for the assistance! -
Multiple forms in django template always submitting same form
I have a template with 3 forms, and submitting any of the last 2 always only results in the first form being submitted. I've searched on this issue, and tried adding prefixes and conditional logic like is suggested in answers to this question, but neither solution is working for me. A single form works absolutely fine, it is just attempting to get 3 working, or even 2, where I am running into issues. Is there another solution other than using conditional logic and prefixes? My current attempt is: if request.method == "POST": approveform = ApproveOrDenyForm(request.POST, instance=contestant, prefix='approved') if approveform.is_valid(): contestant = approveform.save() else: approveform = ApproveOrDenyForm(instance=contestant, prefix='approved') if request.method == "POST" and not approveform.is_valid(): statusform = ChangeStatusForm(request.POST, instance=contestant, prefix='status') if statusform.is_valid(): contestant = statusform.save() else: statusform = ChangeStatusForm(instance=contestant, prefix='status') if request.method == "POST" and not approveform.is_valid() and not statusform.is_valid(): assignteamform = AssignTeamForm(request.POST, instance=contestant, prefix='assignteam') if assignteamform.is_valid(): contestant = assignteamform.save() else: assignteamform = AssignTeamForm(instance=contestant, prefix='assignteam') I tried adding conditional logic to every form also, e.g. making sure approveform was not statusform or assignteamform, but it made no difference. What is the correct approach here? -
Django heroku : Unable to deploy application (ModuleNotFoundError)
When I am deploying my Django application on Heroku, the application crash and Heroku's logs notify me about this error : 2020-12-07T12:55:55.982458+00:00 app[web.1]: ModuleNotFoundError: No module named 'WebSite' The thing is, WebSite is not a python module, but a folder in my Django application (Achievement Comparer behing my main application name). Repository picture Of course, if I start my application locally, everything works just fine. -
Loading "/Media/" files with Django Webpack Loader
After I setup a frontend with a django webpack loader, the media files are not rendering. settings.py STATIC_URL = '/static/' MEDIA_URL = "/media/" MEDIA_ROOT = os.path.join(BASE_DIR, "media") STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),) WEBPACK_LOADER = { "DEFAULT": { "BUNDLE_DIR_NAME": "dist/", "STATS_FILE": os.path.join(BASE_DIR, "frontend", "webpack-stats.json"), } } And urls.py urlpatterns = [ path('admin/', admin.site.urls), path('api/v1/', include("companies.routes.urls")), path('api/v2/', include("projects.routes.urls")), path('accounts/register/', RegistrationView.as_view( form_class=CompanyUserForm, success_url="/", ), name="django_registration_register"), path('accounts/', include("django_registration.backends.one_step.urls")), path('accounts/', include("django.contrib.auth.urls")), path('api-auth/', include("rest_framework.urls")), path('api/rest_auth/', include("rest_auth.urls")), path('api/rest_auth/django_registration/', include("rest_auth.registration.urls")), re_path(r'^.*$', IndexTemplateView.as_view(), name="entry-point") ] # adding the media root path. urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) But when I browse the media file url, image isn't rendering. I think the problem lies in the webpack loader, but I am not sure how to fix the issue here. -
How to restrict anonymous users to vote only once in django poll app?
I want to limit that each user can only vote once for a question in my poll application. In case of authenticated users my code works very well, however when an anonymous user (not registered) try to vote I got the next error: TypeError: 'AnonymousUser' object is not iterable How can I restrict that anonymous users could vote only once? You can see my related code here: models.py: class Question(models.Model): question_text = models.TextField("Question", max_length=300) category = models.CharField(max_length=100) pupblish_date = models.DateTimeField(default=now) author = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.question_text class Choice(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) choice_text = models.CharField("Choice",max_length=200) votes = models.IntegerField(default=0) def __str__(self): return self.choice_text class Vote(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) voter = models.ForeignKey(User, on_delete=models.CASCADE) views.py: def vote_view(request, poll_id): poll = get_object_or_404(Question, pk=poll_id) if Vote.objects.filter(question=poll, voter=request.user).exists(): messages.error(request,"Already Voted on this choice") return redirect("poll_app:home") else: if request.method == "POST": try: selected_choice = poll.choice_set.get(pk=request.POST["clap"]) except(KeyError): return render(request, "poll_app/vote.html", { "poll": poll, "error_message": "You haven't voted yet!" }) else: selected_choice.votes += 1 selected_choice.save() Vote.objects.create(voter = request.user, question=poll) return redirect(reverse("poll_app:result", args=(poll.id,))) else: context = {"poll": poll} return render(request, "poll_app/vote.html", context) Thanks! -
django, constraint without effect?
I had something like the following model in my Django Application: class custom_user(models.Model): # ... number = models.IntegerField() # ... location = models.ForeignKey( Locations, on_delete=models.PROTECT ) I then relaized that number and location needs to be unique together, therefore I added the following to custom user class Meta: verbose_name_plural = "Patienten" constraints = [ models.UniqueConstraint( fields=['nummer', 'praxis'], name='unique_patientennummer_praxis' ) ] I ran makemigrations and migrate afterwards, and the console told me that the contraint was added successfully. Unfortunately it is still possible to add new users with the same number and location! Am I missing something? -
Can't paass count result using annotate with Django querysete to template
I'm using annotate with my Django queryset to count a number of records. I am using it with filter and understand the order makes a difference. My query is: numcontestants = Contestant.objects.filter(assigned_team__id=urlid).annotate(num_contestants=Count('id')) When I pass numcontestants to my template and display it with {{ numcontestants }}, I see a queryset containing each of the records I want to view. When I try {{ numcontestants.num_contestants }} I get nothing. I don't want to have to iterate over numcontestants to get a count, my understanding was that num_contestants should be a single integer number. What is the right way to access the number generated by annotate here? -
Image Upload Issue with TinyMCE
I'm trying to upload the images from tinymce's textarea to the server side media folder. I try to do it with file_picker_callback instance from tinymce and images_upload_url with postAcceptor.php. Here's the details; Tinymce customize script: tinyMCE.init({ selector: 'textarea', plugins: 'quickbars wordcount preview codesample image imagetools hr link lists media fullscreen autosave powerpaste nonbreaking', image_title: true, automatic_uploads: true, images_upload_url: "/static/js/postAcceptor.php", images_upload_base_path: "/media/images", file_picker_types: 'image file media', /* and here's the custom image picker */ file_picker_callback: function (cb, value, meta) { var input = document.createElement('input'); input.setAttribute('type', 'file'); input.setAttribute('accept', 'image/*'); input.onchange = function () { var file = this.files[0]; var reader = new FileReader(); reader.onload = function () { var id = 'blobid' + (new Date()).getTime(); var blobCache = tinymce.activeEditor.editorUpload.blobCache; var base64 = reader.result.split(',')[1]; var blobInfo = blobCache.create(id, file, base64); blobCache.add(blobInfo); cb(blobInfo.blobUri(), { title: file.name }); }; reader.readAsDataURL(file); }; input.click(); } }); *And the postAcceptor.php I get from static folder: <?php $accepted_origins = array("http://localhost", "http://192.168.1.1", "http://example.com", "http://127.0.0.1", "127.0.0.1"); $imageFolder = "/media/images"; if (isset($_SERVER['HTTP_ORIGIN'])) { if (in_array($_SERVER['HTTP_ORIGIN'], $accepted_origins)) { header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); } else { header("HTTP/1.1 403 Origin Denied"); return; } } if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { header("Access-Control-Allow-Methods: POST, OPTIONS"); return; } reset ($_FILES); $temp = current($_FILES); if (is_uploaded_file($temp['tmp_name'])){ if (preg_match("/([^\w\s\d\-_~,;:\[\]\(\).])|([\.]{2,})/", $temp['name'])) { … -
How to delete whole directory with files in it using Django default_storage
My Storage Structure: my-bucket/ - dir_1/ - file_1 - dir_A - dir_2/ What I tried: default_storage.exists('dir_2/') o/p: True default_storage.delete('dir_2/') dir_2 got deleted successfully. But when I try the same for dir_1: default_storage.exists('dir_1/') o/p: False default_storage.delete('dir_1/') This doesn't work. dir_1 still exists How to delete dir_1 completely using the default_storage? -
Cannot link an authenticated user to their new Account upon creation
I'd like each User to be able to create an Account (max of one account each). The user in session won't be able to see the option to create an account unless they are logged in/authenticated. When I log in and click submit on the Create Account form, this error is raised: 'ValueError at /accounts/create/ Cannot assign "<SimpleLazyObject: <User: Jimmy>>": "Account.user" must be a "User" instance.' My models.py: from django.db import models from django.contrib import auth from django.utils.text import slugify from django.urls import reverse from django import template register = template.Library() class User(auth.models.User,auth.models.PermissionsMixin): def __str__(self): return self.username class Account(models.Model): user = models.OneToOneField(User,related_name='customer_account',on_delete=models.CASCADE) first_name = models.CharField(max_length=30,blank=True) surname = models.CharField(max_length=30,blank=True) billing_address = models.TextField(blank=True) delivery_address = models.TextField(blank=True) def __str__(self): return f"Account: {self.user.username}" def get_absolute_url(self): return reverse('about',kwargs={'username':self.user.username, 'pk':self.pk}) Views.py: from django.shortcuts import render from django.urls import reverse_lazy from django.contrib.auth.mixins import LoginRequiredMixin from braces.views import SelectRelatedMixin from django.views.generic import (CreateView, UpdateView, ListView, DetailView, TemplateView,) from . import forms from . import models from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import redirect from django.contrib.auth import get_user_model # User = get_user_model() class SignUp(CreateView): form_class = forms.CreateCustomerForm success_url = reverse_lazy('login') template_name = 'accounts/signup.html' class CreateAccount(LoginRequiredMixin,CreateView): model = models.Account fields = ['first_name','surname','billing_address','delivery_address'] template_name = 'accounts/create_account.html' def form_valid(self,form): self.object = form.save(commit=False) … -
Django template tags through TinyMCE editor
I have a custom template tag which returns the URL of an image @register.simple_tag def mediaURL(slug): """Gets the URL of the media with the inputted slug""" print("Here") return str(utilities.getMediaURL(slug)) Referencing this template tag directly from the HTML file like shown below returns the URL of the image. {% load custom_tags %} {% mediaURL 'logo-300-by-300' %} When I try to create an image though the TinyMCE editor and set the image source as the template tag, the template tag isn't being rendered, {% block content %} {{ page.body | safe }} {% endblock %} This is the source code from the browser: <img style="display: block; margin-left: auto; margin-right: auto;" src="{% mediaURL 'logo-300-by-300' %}" alt="" /> How do I allow template tags through the TinyMCE editor? -
How to seperate messages based on both sender and receiver of the message in blog app using Django
Guys I have the following code for my message app in my instagram-like project in Django. I can get all the messages in my app. In the dialogues page I want to just classify the messages into categories based on the dialogues that the user has between him/herself and the other users of the app. How can I classify these messages. Is there any good solution for that. Just know that I dont want any online chat or anything related to web socket programming. Model of the Message: class Message(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user') dispatcher = models.ForeignKey(User, on_delete=models.CASCADE, related_name='dispatcher') receiver = models.ForeignKey(User, on_delete=models.CASCADE, related_name='receiver') content = models.TextField(max_length=500, blank=True, null=True) created_on = models.DateTimeField(auto_now_add=True) is_seen = models.BooleanField(default=False) content = models.TextField() def get_dialogues(user): sent_messages = Message.objects.filter(dispatcher=user) received_messgaes = Message.objects.filter(receiver=user) all_messages = sent_messages | received_messgaes return all_messages And this is the view @login_required def dialogues(request): messages = Message.get_dialogues(request.user) return render(request, 'message/dialogues.html', {'messages':messages}) I think this much of code suffices for the question to be answered. -
Is there a way to merge 2 querysets in Django and order them by a their repecting field?
I'm trying to create a twitter clone and this is my user and tweet Model(some irrelevant fields have been removed). class TwitterUser(models.Model): user = models.OneToOneField(to=User, on_delete=models.CASCADE,primary_key=True) Bio = models.CharField(max_length=200, blank=True) Location = models.CharField(max_length=200, blank=True) Website = models.URLField(blank=True) ProfilePicture = models.ImageField(upload_to="Twitter", default="../static/twitter/images/default_profile.png") CreateDate = models.DateField(default=timezone.now) class Tweet(models.Model): TweetBody = models.CharField(max_length=140, blank=False) TweetDate = models.DateTimeField(default=timezone.now) Owner= models.ForeignKey(to=TwitterUser,on_delete=models.CASCADE,related_name="Owner") RetweetedBy= models.ManyToManyField(to=TwitterUser,related_name="Retweeted",blank=True,through="RetweetIntermediate") and this the table that my many to many relationship for retweet is using. class RetweetIntermediate(models.Model): twitteruser=models.ForeignKey(TwitterUser,on_delete=models.CASCADE) tweet=models.ForeignKey(Tweet,on_delete=models.CASCADE) retweetDate=models.DateTimeField(default=timezone.now) In profile view all the tweets and retweets should be shown ordered by date what I'm doing right now (and it is working fine) is this: def keymaker(a): return a.TweetDate def ProfileView(request): tweets= list(Tweet.objects.filter(Owner=user.user_id,IsReplyToTweet__isnull=True).order_by("-TweetDate")) retweets = list(user.Retweeted.all().order_by("-id")) retweetInter=RetweetIntermediate.objects.all().order_by("-tweet_id") for i , j in zip(retweets,retweetInter): i.TweetDate=j.retweetDate tweets=(tweets+retweets) tweets.sort(key=keymaker,reverse=True) I retrieve all the tweets ordered by date. then I retrieve all of retweets and make a list out of them and change the data of tweet to the date saved in intermediate table and merge both lists and sort them by date. I want to know is there a better way or more standard way to do this? Thanks in advance. -
How can I store user ip and warn him if his current ip is different from the previous one on Django?
I'm working on doing a blog on Django for a project and I've created everything about login, registration and forum... The last step is to create a logging system which stores the last Ip accessing the platform for a certain user and shows a warning message if it is different from the the previous one... logger = logging.getLogger(__name__) logging.config.dictConfig({ 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'console': { 'format': '[%(asctime)s] %(name)-12s %(levelname)-8s %(message)s' }, 'file': { 'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s' } }, 'handlers': { 'console': { 'class': 'logging.StreamHandler', 'formatter': 'console' }, 'file': { 'level': 'DEBUG', 'class': 'logging.FileHandler', 'formatter': 'file', 'filename': '/tmp/debug.log' } }, 'loggers': { '': { 'level': 'DEBUG', 'handlers': ['console', 'file'] } } }) def login_page(request): if request.method == 'POST': username = request.POST.get('username') password = request.POST.get('password') user = authenticate(request, username=username, password=password) x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[-0] else: ip = request.META.get('REMOTE_ADDR') if user is not None: logger.info("".join([ip, " : ", username, " logged in"])) login (request, user) return redirect("../") else: messages.error(request, "Username o Password Errati... Riprova!") return render(request, 'login.html') I have added some code to my login view to show information when a user sign in and it works... I don't know how can I continue, I … -
How to make forms and add data for 4 nested one-to-many relationships in Django?
I have 4 models: Corporation, Division, Store and Section. Corporation has one or many divisions, division has one or many stores and store has one or many sections. I need to make a html which will allow adding corporation, then many divisions for that corporation and for every division possibility to add stores and so on. That has to be on the same page. For every model there needs to be add button which will open form for adding desired object and delete button which will remove object if user changes its mind. If user clicks 'add store', form for store will show up inside division in which store needs to be added. I don't know how to manage that and organize forms and how to pack data back through POST nor how to unpack it and save into database. I have tried manually making all fields that I need on html and not bounding it to any django form and packing all data in json, then sending it through ajax, but it's very tiresome and ugly, because I have to pack four level nested json and do the unpacking on the back and again manually save every object. -
Django Async Views, AsyncIO
Is it available to call an async function inside django main view function, and return main before the second is continuing its execution? As video convert is taking too long, I need to return media paths before convert finishes. views.py async def optimize(request): serializer_data = FileUploadSerializer(data=request.FILES).custom_validation() media_paths = {} for data in serializer_data.validated_data: #converting video if data == 'video': media_paths['video'] = [] for file in serializer_data.validated_data['video']: file_path = file.file.name file_name = generate_file_name() new_path = os.path.join(settings.BASE_DIR, 'media') extension = file.name.rsplit('.', 1)[-1] loop = asyncio.get_event_loop() loop.create_task(video_converter.start_convert(file_path, file_name, new_path)) # loop.run_until_complete(video_converter.start_convert(file_path, file_name, new_path)) media_paths['video'].append(request.build_absolute_uri() + "media/video/" + file_name + "." + extension) return JsonResponse(media_paths) video_converter.py clip = VideoFileClip(f"{file_path}") if round(clip.w/clip.h, 2) == 1.78: if clip.h < 720: clip.write_videofile(f"{new_path}\\video\{file_name}.mp4", fps=24) clip.close() else: clip_resized = clip.resize(height=720) clip_resized.write_videofile(f"{new_path}\\video\{file_name}.mp4", fps=24) clip.close() return new_path + file_name + '.mp4' else: clip.close() raise Exception("Uploaded video resolution is not supported") -
How to get the current user time zone? Django
I'm trying to get my Django app work with the current user time zone but I'm not getting any results... In my settings.py file I set: TIME_ZONE = 'UTC' and in my views.py I set at the top of the code: activate(settings.TIME_ZONE) But this is not working, while creating a post, is getting my last time zone that was 'Madrid', instead of my current time zone. Is there a way to make this work? Thank you! -
Double reverse filtering in Django ORM
I am facing one issue while filtering the data . I am having three models ... class Product: size = models.CharField(max_length=200) class Make(models.Model): name = models.ForeignKey(Product, related_name='product_set') class MakeContent(models.Model): make = models.ForeignKey(Make, related_name='make_set') published = models.BooleanField() I can generate a queryset that contains all Makes and each one's related MakeContents where published = True. Make.objects.filter(make_set__published=True) I'd like to know if it's possible (without writing SQL directly) for me to generate a queryset that contains all Product and each one's related MakeContents where published = True. I have tried this Product.objects.filter(product_set__make_set__published=True) But it's not working -
Proper File Structure For Sending E-Mails In Django
I'm sending many e-mails from within my Django views like this if form.is_valid(): form.save() # email contents first_name = form.cleaned_data['first_name'] surname = form.cleaned_data['surname'] full_name = first_name + ' ' + surname from_email = form.cleaned_data['email'] try: html_content = """ <p>HEADING</p> <p>Sent from: """+ full_name +""".</p> <p>Email address: """+ from_email +""".</p> """ email = EmailMessage('TITLE', html_content, 'example@gmail.com', ['example@gmail.com']) email.content_subtype = "html" email.send() except BadHeaderError: return HttpResponse('Invalid header found.') return redirect('example', first_name=first_name) But I'm sure there has to be a standard file structure and way to separate the logic when sending e-mails. If there is, or if anyone has any tidy ways to organise the contents of many emails rather than having them bloating my views, please share :). Thank you. -
django-allauth facebook login issue with facebook accounts that is not connected to any email address
I have a site where users have to login only using facebook. Most of time it works fine. But sometimes, when user logins with facebook, it again asks for email address. But I have a new issue. Those facebook made with mobile number and not any email address connected to it are not able to login. So how can i solve this problem ? I am using django-allauth for social login.