Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How can I make the queryset filter `or` conditions dynamically from the array?
I have array and try to use this as filter key for database I want to make this dynamically from the array = [AC" ,"BC"] queryset = queryset.filter(Q(username__icontains="AC")| Q(username__icontains="BC")) For example, I try like this below but it is obviously wrong. array = ["AC","BC"] qs = [] for k in array: qs.append(Q(username__icontains=k)) queryset = queryset.filter(qs.join('|')) How can I do this ? -
Django + Celery + Redis
I have this settings in my social_media.settings: CELERY_BROKER_URL = "redis://0.0.0.0:6379/0" CELERY_ACCEPT_CONTENT = ["application/json"] CELERY_RESULT_SERIALIZER = "json" CELERY_TASK_SERIALIZER = "json" CELERY_RESULT_BACKEND = "redis://0.0.0.0:6379/0" CELERY_TIMEZONE = "Europe/Kiev" Also I register in my social_media.init: from .celery import app as celery_app __all__ = ("celery_app", ) Also I have this celery.py file: import os from celery import Celery os.environ.setdefault("DJANGO_SETTINGS_MODULE", "social_media.settings") app = Celery("social_media") app.config_from_object("django.conf:settings", namespace="CELERY") app.autodiscover_tasks() And I run redis with docker command: docker run -d -p 6379:6379 redis So after I run my django project and my docker, I want to run celery with this command: celery -A social_media worker -l info I get this error: Traceback (most recent call last): File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\projects\social-media-api\venv\Scripts\celery.exe\__main__.py", line 7, in <module> File "d:\projects\social-media-api\venv\lib\site-packages\celery\__main__.py", line 15, in main sys.exit(_main()) File "d:\projects\social-media-api\venv\lib\site-packages\celery\bin\celery.py", line 236, in main return celery(auto_envvar_prefix="CELERY") File "d:\projects\social-media-api\venv\lib\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "d:\projects\social-media-api\venv\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "d:\projects\social-media-api\venv\lib\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "d:\projects\social-media-api\venv\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "d:\projects\social-media-api\venv\lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) File "d:\projects\social-media-api\venv\lib\site-packages\click\decorators.py", line 33, in new_func return f(get_current_context(), *args, **kwargs) … -
Deleting image related to a product from static folder when deleting product. Django
I have a model: class Product(models.Model): name = models.CharField(max_length=200, null=True) price = models.FloatField() is_digital = models.BooleanField(default=False, null=True, blank=False) image = models.ImageField(null=True, blank=True) def __str__(self) -> str: return self.name @property def imageURL(self): try: url = self.image.url except: url = '' return url I want to delete the related image to this product when product deleted(for example from admin page). I searched and found out that overriding del or delete functions are not the correct way to do that. Can you please help me. And I also wonder if it's even good logic to deleting unecessery files from static folder. -
'Settings' object has no attribute 'EMAIL_HOST_USESR'
I wanna send email by django and gmail smtp and I see this error. the code below is my email setting EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'MY EMAIL' EMAIL_HOST_PASSWORD = 'MY PASSWORD' EMAIL_PORT = 587 i expect to send email without any problems -
Django Query: Annotating queryset list with Sum of fields Values
I have 3 simple models: from django_better_admin_arrayfield.models.fields import ArrayField class Skill(BaseModel): value = models.IntegerField() item = models.ForeignKey(Item, on_delete=models.CASCADE related_name="skills") class Item(BaseModel): name = models.CharField(max_length=100) class BuildItem(models.Model): base = models.ForeignKey(Item, on_delete=models.CASCADE) mandatory_skills = ArrayField(models.IntegerField(null=True, blank=True), default=list) I would like to have a list of BuildItem annotated with the sums of the value field of the Skill table, only if the Skill id is contained in the mandatory_skills field. To annotate the list of BuildItem I have the following query which works: q = BuildItem.objects.annotate(sum_skill=Coalesce(Sum("base__skills__value"), 0)) I would also like to add up the Skills having an id present in mandatory_skills. I tried many things but without success, does anyone have a solution? -
Django admin page showing PATH module not found
I am trying to access: http://127.0.0.1:8000/admin/login/?next=/admin/ but I am shown with this error: ''' ModuleNotFoundError at /admin/login/ No module named 'path' Request Method: GET Request URL: http://127.0.0.1:8000/admin/login/?next=/admin/ Django Version: 4.2.5 Exception Type: ModuleNotFoundError Exception Value: No module named 'path' Exception Location: , line 1004, in _find_and_load_unlocked Raised during: django.contrib.admin.sites.login Python Executable: C:\Program Files\Python310\python.exe Python Version: 3.10.6 Python Path: ['C:\Users\ROHIT\Documents\Project\hospital2\hospital_project', 'C:\Program Files\Python310\python310.zip', 'C:\Program Files\Python310\DLLs', 'C:\Program Files\Python310\lib', 'C:\Program Files\Python310', 'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages', 'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32', 'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32\lib', 'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\Pythonwin', 'C:\Program Files\Python310\lib\site-packages'] Server time: Sun, 10 Sep 2023 08:21:55 +0000 ''' I have included from django.urls import path in all the urls.py -
How can I get the data used as key for group by
id num tuser 1 2 user1 2 2 user2 3 3 user2 4 1 user4 5 1 user4 For example I have table like this . Now I want to get the unique data appeared in tuser so, the result should be user1,user2,user4 I guess it should be related with group by. So, I made this sentence. p = m.MyTables.objects.all().values('tuser') However how can I get the user1,user2,user4 ? -
vscode's testing interface does not work properly with django
unittest does not create a test database and runs on the production database. `"python.testing.unittestEnabled": true,` pytest creates a test database but fails with psycopg2.errors.DuplicateDatabase, if the database was not manually deleted. `"python.testing.pytestEnabled": false,` Both also don't seem to run django manage.py command since: the test runner does not execute TEST_RUNNER = 'test.test.test'. the overridden test Command class does not run either. "python.testing.pytestArgs": [ "-v", "./app1/tests.py", "./app2/tests.py", ], "python.testing.unittestArgs": [ "-v", "-s", ".", "-p", "tests.py" ], Note that the following launch command in launch.json works 100% properly (test runner and command execute) and all tests run and pass correctly but I would like to use the vscode testing interface. { "name": "Test", "type": "python", "request": "launch", "program": "${workspaceFolder}/manage.py", "args": [ "test", "-v" ], "envFile": "${workspaceFolder}/.env", "django": true, "justMyCode": false, }, -
Install django-ads-txt causing ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
Hi I trying to Install django-ads-txt to my Django Project. My first step was to pip install django-ads-txt then I added in the urls path('ads.txt', include('ads_txt.urls')), when I tried to python manage.py migrate I got the following error: from django.utils.encoding import python_2_unicode_compatible ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' I tried to pip install six but the same error kept showing My question: How to fix this error to install django-ads-txt? -
it shows OS error if i try to open the links
i am making a webpage which looks like this using django : the webpage while opening the links , it shows OS error : [Errno 22] Invalid argument: 'C:\Users\Lenovo\Desktop\django projects\env\Lib\site-packages\django\contrib\admin\templates\home\ran_num_gen.html' i am unable to find out the cause of it. help me understand more about it . following is the relevant code and screenshots : DIRECTORIES **views.py **: from django.shortcuts import render from django.template.context import Context # Create your views here. def home(request): return render(request , 'home\home.html' ) def num_guess_game(request): return render (request ,'home\num_guess_game.html') def ran_num_gen(request): return render (request ,'home\ran_num_gen.html') def ran_pwd_gen(request): return render (request ,'home\ran_pwd_gen.html') urls.py : """ URL configuration for core project. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path from home.views import * urlpatterns = [ path('admin/', admin.site.urls), path('', home ,name='home'), path('ran_num_gen/', ran_num_gen … -
ModuleNotFoundError: No module named 'django' (deploying on Heroku)
I ran into an error when running the command: heroku run python manage.py migrate. When I run it it raises en error: ModuleNotFoundError: No module named 'django'. My app runs fine locally. Django is installed. I tried to search the internet but I see the answers for the errors with the module "django-heroku", not just "django". If anyone has any suggestions, I would be grateful! -
TypeError "Cannot filter a query once a slice has been taken." while running self.client.get(reverse()) function in django
I'm currently learning some basics of django using tutorials in documentation (https://docs.djangoproject.com/en/4.2/intro/tutorial05/) and have a problem with chapter about testing. class QuestionDetailViewTests(TestCase): def test_past_question(self): question = create_question('text', -30) response = self.client.get(reverse('polls:detail', args=(question.id,))) self.assertContains(response, question.question_text) create_question is just a shortcut for creating Question(models.Model) object with second argument meaning offset in days for publication date, which is set relatively to current date. 'polls:detail' is the name of path to this concrete view, which takes number of question as argument. Running of py manage.py test app results in following error: Traceback (most recent call last): File "C:\web\django\project1\mysite\polls\tests.py", line 59, in test_past_question response = self.client.get(reverse('polls:detail', args=(question.id,))) File "C:\web\django\project1\lib\site-packages\django\test\client.py", line 927, in get response = super().get(path, data=data, secure=secure, headers=headers, **extra) File "C:\web\django\project1\lib\site-packages\django\test\client.py", line 457, in get return self.generic( File "C:\web\django\project1\lib\site-packages\django\test\client.py", line 609, in generic return self.request(**r) File "C:\web\django\project1\lib\site-packages\django\test\client.py", line 891, in request self.check_exception(response) File "C:\web\django\project1\lib\site-packages\django\test\client.py", line 738, in check_exception raise exc_value File "C:\web\django\project1\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\web\django\project1\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\web\django\project1\lib\site-packages\django\views\generic\base.py", line 104, in view return self.dispatch(request, *args, **kwargs) File "C:\web\django\project1\lib\site-packages\django\views\generic\base.py", line 143, in dispatch return handler(request, *args, **kwargs) File "C:\web\django\project1\lib\site-packages\django\views\generic\detail.py", line 108, in get self.object = self.get_object() File "C:\web\django\project1\lib\site-packages\django\views\generic\detail.py", line 37, in … -
Django's Success messages displayed like error messages
I'm working on a Django project and I'm using Django's built-in messaging framework to display success and error messages to the user. However, I'm encountering an issue where success messages are being displayed in a way that makes them look like error messages.error messages displyed like success messages here is my Html code: {% if messages %} {% for message in messages %} {% if message.tags == 'success' %} <div class="rounded border-s-4 mb-1 border-green-500 bg-emerald-50 p-4"> <strong class="block font-medium text-green-800"> Successfully </strong> <p class="mt-2 text-sm text-green-700"> {{ message }} </p> </div> {% else%} <div class="rounded border-s-4 mb-1 border-red-500 bg-red-50 p-4"> <strong class="block font-medium text-red-800"> Something went wrong </strong> <p class="mt-2 text-sm text-red-700"> {{ message }} </p> </div> {% endif %} {% endfor %} {% endif %} here is example enter image description here -
python django linebot can receive http response but the code did not work
I'm building a game linebot, using ngrok to build the server. I've tried echo linebot, and it worked well. Now, i'm trying to put a game code on it, but it does not work. Below it's my code. Any advise or keyword would be helpful. If needing more information, please comment below. Thanks all!!! Btw, this game is that guessing a 4 digit number. If a number in "guess" is right and at the right place, you will get 1A. If a number in "guess" is right but not the right place, you will get 1B. For example, if the answer is '1234'. When guessing 5678, the code will response '0A0B'. When guessing 1567, the code will response '1A0B'. When guessing 5167, you will get '0A1B' module version: django 4.1 line-bot-sdk 3.4.0 python 3.11.4 # views.py from django.shortcuts import render # Create your views here. from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from linebot import LineBotApi, WebhookHandler from linebot.exceptions import InvalidSignatureError from linebot.models import MessageEvent, TextMessage import random line_bot_api = LineBotApi('YOUR_CHANNEL_ACCESS_TOKEN') handler = WebhookHandler('YOUR_CHANNEL_SECRET') @csrf_exempt def callback(request): if request.method == 'POST': signature = request.headers['X-Line-Signature'] body = request.body.decode('utf-8') try: handler.handle(body, signature) except InvalidSignatureError: return JsonResponse({'status': 'error', 'message': 'Invalid signature'}) return … -
What are you doing
Because someone asked me what yo do for living I am doing as software engineer but i gols are not in path so give me suggestions for python Django Devloper please ping me when you are free give me some career in python Django Devloper please drop me a massage therapy for the next time hai be bahot hi hai ki nhi hot mnun tu hi to hai na tera -
Wagtail: custom URLs for blog page categories?
My blog pages have a type and a subtype. I want blog page URLs to look like mysite.com/pages/<blog_type>/<blog_subtype>/<blog_title> By default, they are just mysite.com/pages/<blog_title> I can't think of a way to do this (I'm new to Wagtail). Can anyone help? Thanks in advance -
Django Deployment with Gunicorn
Sep 9 05:57:41 PM [2023-09-09 22:57:41 +0000] [52] [INFO] Starting gunicorn 20.1.0 Sep 9 05:57:41 PM [2023-09-09 22:57:41 +0000] [52] [INFO] Listening at: http://0.0.0.0:10000 (52) Sep 9 05:57:42 PM [2023-09-09 22:57:42 +0000] [52] [INFO] Using worker: sync Sep 9 05:57:42 PM [2023-09-09 22:57:42 +0000] [53] [INFO] Booting worker with pid: 53 Sep 9 05:57:42 PM [2023-09-09 22:57:42 +0000] [54] [INFO] Booting worker with pid: 54 Sep 9 05:57:42 PM [2023-09-09 22:57:42 +0000] [55] [INFO] Booting worker with pid: 55 Sep 9 05:57:42 PM [2023-09-09 22:57:42 +0000] [56] [INFO] Booting worker with pid: 56 Sep 9 06:08:06 PM [2023-09-09 23:08:06 +0000] [52] [INFO] Handling signal: term Sep 9 06:08:06 PM [2023-09-09 23:08:06 +0000] [53] [INFO] Worker exiting (pid: 53) Sep 9 06:08:06 PM [2023-09-09 23:08:06 +0000] [54] [INFO] Worker exiting (pid: 54) Sep 9 06:08:06 PM [2023-09-09 23:08:06 +0000] [55] [INFO] Worker exiting (pid: 55) Sep 9 06:08:06 PM [2023-09-09 23:08:06 +0000] [56] [INFO] Worker exiting (pid: 56) Sep 9 06:08:12 PM [2023-09-09 23:08:12 +0000] [52] [INFO] Shutting down: Master Worker keeps exitting without logs. gunicorn wsgi:application is my build command. The app is in the root of the directory, where gunicorn launches from Attempted debugging by adding flags to gunicorn, … -
Django - Product title not showing in cart page
I'm having trouble getting the product title to show in the cart page after its added to cart. It shows everything except the Title of the product. cart.py def __len__(self): return sum(item["qty"] for item in self.cart.values()) def __iter__(self): product_ids = self.cart.keys() products = Product.objects.filter(id__in=product_ids) cart = self.cart.copy() for product in products: cart[str(product.id)]["product"] = product for item in cart.values(): item["price"] = Decimal(item["price"]) item["total_price"] = item["price"] * item["qty"] yield item cart.py def front_page(request): cart = Cart(request) return render(request, 'cart/front_page.html', { 'cart':cart }) cart_details.html This is all the issue starts, it shows everything else like qty and price for each added item but not the product name. {% for item in cart %} {% with product=item.product %} <div class="" data-index="{{product.id}}"> <div class="row g-0"> <div class="col-md-2 d-none d-md-block"> {% for image in product.product_image.all %} {% if image.is_feature%} <img class="img-fluid" alt="Responsive image" src="{{ image.image.url }}" alt="{{ image.image.alt_text }}"> {% endif %} {% endfor %} </div> <div class="col-md-10 ps-md-3"> <div class="card-body p-1"> <a class="" href="{{item.product.get_absolute_url}}"> <p class="card-text pb-3">{{product.title}}</p> </a> <label for="select">Qty</label> <select id="select{{product.id}}" style="width:50px;height:31px;"> <option value="" selected disabled hidden>{{item.qty}}</option> <option value="">1</option> <option value="">2</option> <option value="">3</option> <option value="">4</option> </select> <a type="button" id="update-button" data-index="{{product.id}}" class="update-button text-decoration-none small ps-3">Update</a> <a type="button" id="delete-button" data-index="{{product.id}}" class="delete-button text-decoration-none small">Delete</a> </div> </div> </div> … -
How to add a bullet point in a form in Javascript?
I have a javascript code inside a form, This javascript is supposed to put a bullet point to the previous line, every time that I press the 'enter' key. However, when I do press the enter key it does put the bullet point, but when I press the enter key again, an additional bullet appears. For instance, I have line 1, line 2, and line 3. When I type line one and press enter, a bullet appears behind line one, but when I type line 2 and press enter, line one suddenly has 2 bullets behind it and line 2 has a bullet added to it. This is the code: // Function to format the "roles" textarea into bullet points document.addEventListener('keydown', function (e) { if (e.target.id === 'id_form-0-roles' && e.keyCode === 13) { formatRoles(e.target); e.preventDefault(); } }); function formatRoles(textarea) { let lines = textarea.value.split('\n'); let formattedText = ''; lines.forEach(function (line) { if (line.trim() !== '') { formattedText += '• ' + line.trim() + '\n'; } else { formattedText += '\n'; // Add a new line for empty lines } }); textarea.value = formattedText; } </script> I expect the javascript to put just one bullet point in the preceding line after … -
Is there a best practice to avoid Django's "Found another file with the destination path" during collectstatic on production?
So I'm using Django 4.2, with Django-JET admin package via Django-jet-reboot fork; it enhances Admin with nice functionality and UX. Each time I deploy my app on production, it feels its taking much longer when it reach collectstatic command cause it throws Found another file with the destination path warnings. Now it seems it's related to Django-Jet's css & js files that needs to override django.contrib.admin ones, so my two questions are: Is this harmless and working as designed for my use-case? or there is a better practice to handle this? (like specifically configuring not looking for those django files? or add them to local static folder?) Will adding additional UI-changing package(s) be ok with this? For example I'm looking at creative tims' Black Dashboard Django - I just manage on it's priority in INSTALLED_APPS and let it be? = after jet so it doesn't override that package but takes the additional ones. Issue Details Found another file with the destination path 'admin/css/base.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path. Found another file with the destination path 'admin/css/changelists.css'. It … -
error in vercel deployment of django project
Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt ERROR: Could not find a version that satisfies the requirement pywin32 (from versions: none) ERROR: No matching distribution found for pywin32 where i am going wrong -
How can I create a Django Model for Funds Transfer in a Banking Application
I'm a Django developer with a project to create a banking application. One of the biggest problems is fund transfers between users. To achieve this, I need to design a Django model that includes both a sender and a receiver for fund transfers so that when the sender sends the funds, it will update the receiver's 'account_balance' field in the 'account' model. How can I create a 'Transfer' model that includes a sender and a receiver in one model, and how can I differentiate between the sender and receiver when making fund transfers in the 'views.py' file? my models: class Account(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) account_number = models.IntegerField() account_balance = models.DecimalField(max_digits=12, decimal_places=6) class CustomUser(AbstractUser): username = models.CharField(max_length=30) full_name = models.CharField(max_length=100) phone_number = models.CharField(max_length=16) address = models.CharField(max_length=200) date_of_birth = models.DateField(blank=True, null=True) gender = models.CharField(max_length=20, choices=GENDER) email = models.EmailField(_("email address"), unique=True) USERNAME_FIELD = "email" REQUIRED_FIELDS = ['username'] objects = CustomUserManager() def __str__(self): return str(self.username) Can you please provide a detailed breakdown of the key components this model should have, including fields, relationships, and any security measures or transaction management techniques I should implement? -
Django page not found although everything seems okay
I am new to Django and I am doing everything that is indicated in Django documentation but I can not figure out why it keeps saying Page Not Found I tried changing the path or Debug=True to Debug=False but nothing interesting happened. It once worked but now it keeps saying Page Not Found. from django.urls import path from . import views urlpatterns = [ path("mainpage/", views.index, name="index"), ] this is urls.py mainpage from django.shortcuts import render from django.http import HttpResponse def index(request): return HttpResponse("My first page") this is views.py mainpage from django.contrib import admin from django.urls import path from django.contrib import admin from django.urls import include, path urlpatterns = [ path("mainpage/", include("mainpage.urls")), path('admin/', admin.site.urls), ] ```and this one is urls.py mysite this is the result: Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: mainpage/ mainpage/ [name='mainpage'] admin/ The current path, mainpage/, didn’t match any of these. You’re seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. http://127.0.0.1:8000/mainpage/ -
Django and docker-compose serving with NGINX: file not found
I've been trying to set up my django project with gunicorn and nginx. The server runs, but I've been struggling to get the admin page to serve static files (I haven't created any other static files for the project, so I'm just starting with admin). I bit the bullet and just copied the original django admin static file into my own project, but when I load the admin page, there are no static files. My docker "web" image shows: web_image_name | Not Found: /static/admin/js/... web_image_name | Not Found: /static/admin/css/... ... This error is interesting, since when I go into that image's terminal and do "ls", I can see the static directory. Is this problem related to nginx, docker, or both? Code: nginx.conf: # nginx.conf events { worker_connections 1024; } http { server { listen 80; server_name your_domain.com; # Change to your domain or IP address location / { proxy_pass http://web:8000; # Points to your Gunicorn service proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /static/ { alias /app/static/; } } } docker-compose.yml (truncated): version: "3" services: web: container_name: newspigeon_web build: context: . dockerfile: Dockerfile command: > bash -c "python manage.py migrate && gunicorn --workers=4 --bind=0.0.0.0:8000 newspigeon.wsgi:application" ports: … -
django allauth github organizations restriction
i have created a Django webapp, and i want to use allauth to create a sso for github. I have set it up, and it works fine. But now all github users can login to my webapp. I want to restrict it only to my github organization. So that all users of my organization can login to the web app and users which are not in the organization cant login. Is there any option from allauth to realize this? i have checked the allauth documentation, but i can't find any option for that. Or is there any other way which i can use to realize my requirement?