Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Autocomplete Light create_field Not Working
I really want to be able to use the django-autocomplete-light to enable users to create new Franchise names when they use the autocomplete box. I have set this up, but I don't get the option to create. I can see in the documentation about adding permissions, but I don't quite understand where it is done and also if I run in the shell, I get errors as below: >>> from user.models import User >>> user = User.objects.get(username="joeuser") >>> permission = Permission.objects.get(name='Can add franchise') >>> user.user_permissions.add(permission >>> user.user_permissions.add(permission) AttributeError: 'User' object has no attribute 'user_permissions' The form which uses it looks as below: franchisename = forms.ModelChoiceField(queryset=allfranchises,widget=autocomplete.ModelSelect2(url='/seasons/franchisesautocomplete/'),required=True) The url looks like: url(r'^franchisesautocomplete/', views.FranchiseAutocomplete.as_view(create_field='name'), name='franchiseautocomplete'), The view looks like: class FranchiseAutocomplete(autocomplete.Select2QuerySetView): def get_queryset(self, *args, **kwargs): user = getuser(self.request) if user == None: #Set a blank queryset if the user is not logged in qs = Franchise.objects.none() else: qs = Franchise.objects.all() return qs The autcomplete works in terms of returning the result set to the choice box, just can't get the create to work. Please can someone help. -
"TypeError: fs.existsSync is not a function" React
Started receiving this error when opening my react project: TypeError: fs.existsSync is not a function Traceback in browser: Now I believe that this is nodejs code trying to execute in the browser, but how is this happening? Uncaught TypeError: fs.existsSync is not a function at Object.hasBinary (extensions.js:405) at push../node_modules/node-sass/lib/binding.js.module.exports (binding.js:11) at Object.<anonymous> (index.js:14) at Object../node_modules/node-sass/lib/index.js (index.js:471) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Module../src/App.js (lib sync:9) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Module../src/index.js (index.css?f3f6:45) at __webpack_require__ (bootstrap:784) at fn (bootstrap:150) at Object.1 (utility.js:6) at __webpack_require__ (bootstrap:784) at checkDeferredModules (bootstrap:45) at Array.webpackJsonpCallback [as push] (bootstrap:32) at main.chunk.js:1 -
Mailchimp object not found django ('module' object has no attribute 'Mailchimp')
I wanted to use mailchimp in my Django app. so I did the following: pip install mailchimp and in my view.py I'm doing this def testtemplates(request): API_KEY = settings.MAILCHIMP_API_KEY LIST_ID = settings.MAILCHIMP_LIST api = mailchimp.Mailchimp(API_KEY) return HttpResponse(escape(repr(api))) l = api.lists.subscribe(LIST_ID, {'email': 'test@mail.com'}) While I can see the class Mailchimp in venv/lib/python2.7/site-packages/mailchimp.py I'm getting this error when I simply the URL 'module' object has no attribute 'Mailchimp' I believe I'm using the package correctly there must be some small stupid error or something which is out of my sight. Let me know if there's anything else to add Any help appreciated, Thanks -
How to add Thousand Separator to number in Javascript / Python / Django
I wanted to ask how to add thousand separator to the number when I type the number and also to the output. For example 10 000 becomes 10,000. I tried to use Django intcomma but it's not working. Really appreciate if you guys can help me with this. Below is my code : HTML <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <br /> <br /> <div class="form-group"> <form name="add_price" id="add_price"> <div class="table-responsive"> <table class="table table-bordered" id="price"> {{ priceformset.management_form }} {% for price in priceformset %} <tr> <td>{{ product.product_price }}</td> <td>{{ product.product_quantity }}</td> <td>{{ product.product_total_price }}</td> </tr> {% endfor %} </table> <input type="button" name="submit" id="submit" class="btn btn-info" value="Submit" /> </div> </form> </div> </div> </body Javascript $('.textInput').on('change keyup', function() { product_total_price=0; var product_price= Number($('#id_Product-0-price').val()); var product_quantity= Number($('#id_Product-0-quantity').val()); product_total_price= product_price * product_quantity; $('#id_Product-0-total_price').val(product_total_price); }); Models.py class Price (models.Model): product_price = models.CharField(max_length=512,null=True,blank=True) product_quantity = models.CharField(max_length=512,null=True,blank=True) product_total_price= models.CharField(max_length=512,null=True,blank=True) Forms.py class PriceForm(forms.ModelForm): product_price =forms.CharField(required=False,label=('Price'),widget=forms.TextInput( attrs= { "class":"textInput form-control", "placeholder" : "Price" })) product_quantity =forms.CharField(required=False,label=('Quantity'),widget=forms.TextInput( attrs= { "class":"textInput form-control", "placeholder" : "Quantity" })) product_total_price =forms.CharField(required=False,label=('Total Price'),widget=forms.TextInput( attrs= { "class":"textInput form-control", "placeholder" : "Total Price" })) class Meta: model = Price fields = ('__all__') -
Django: Send API Key in response on successful authentication
I have created a Django(1.8) API to authenticate a user and on successful authentication create an API key and send it back as a response. The tricky part is that on successful authentication i would also need to redirect the user to another HTML page. I came across an answer where the api key is included in the context and then used in a hidden input field inside the HTML but this wont be secure. So what would be a secure way to send the API key and at the same time redirect to another HTML page My View: class LoginView(View): """On successful authentication return the api key.Authentication only if valid api identifier found in the request""" def post(self, request): try: username = request.POST['username'] password = request.POST['password'] app_id = request.GET['app_identifier'] context={} try: ConsumingAppInfo.objects.get(app_identifier=app_id) except Exception: raise Exception('Invalid app identifier found in the request') user = authenticate(username=username,password=password) if user is None: return HttpResponse('Invalid user credentials provided', status=400) request.session['user_id'] = user.id # Create API Key on first time login for the consuming user and return the same on any other subsequent # requests app_credentials,created = ConsumingAppAuth.objects.get_or_create(consuming_app_id=app_id, defaults={ 'api_key': str(uuid.uuid4())+'_'+str(datetime.now()), 'created_on': datetime.now(), 'consuming_app_id': app_id}) context['api_key'] = app_credentials.api_key return render(request,'response.html',context) except Exception as e: … -
Input field mask in Django
I am trying to create a mask for an input field for my Django field ex: (000) 000 000. I can't seem to get it working. Has anyone found a way to do this yet? -
How to prevent flushing data in test database after every test case in Django
I am currently writing my first Django application and writing selenium test cases for testing the UI. I am using the Django test case class for testing the app. This is the configuration for running test cases: "configurations": [ { "name": "test", "type": "python", "request": "launch", "program": "${workspaceFolder}\\manage.py", "args": [ "test", "review.tests.test_selenium.ReviewTests.test_app", "--keepdb" ], "django": true } This configuration uses the existing test database and I have to add data in the tables each time I run a new test case. Is there any way to preserve data after running test-cases? Thanks In Advance. -
Django: Send API Key back to the user on successful authentication
I have a requirement to create Django(1.8) API for authenticating end users of an external consuming app. The user along with the username and password would need to provide a valid app identifier as part of the URL.This app identifier would already be mapped to the consuming app in the database.The user would be authenticated only on providing a valid app identifier.My understanding is that this can be achieved using a hidden input form field which would then be appended to the URL My View: class LoginView(View): """On successful authentication return the api key.Authentication only if valid api identifier found in the request""" def post(self, request): try: username = request.POST['username'] password = request.POST['password'] app_id = request.GET['app_identifier'] try: ConsumingAppInfo.objects.get(app_identifier=app_id) except Exception: raise Exception('Invalid app identifier found in the request') user = authenticate(username=username,password=password) if user is None: return HttpResponse('Invalid user credentials provided', status=400) request.session['user_id'] = user.id # Create API Key on first time login for the consuming user and return the same on any other subsequent # requests app_credentials,created = ConsumingAppAuth.objects.get_or_create(consuming_app_id=app_id, defaults={ 'api_key': str(uuid.uuid4())+'_'+str(datetime.now()), 'created_on': datetime.now(), 'consuming_app_id': app_id}) return JsonResponse({'api-key': app_credentials.api_key}) except Exception as e: return HttpResponse("Invalid request.Please verify the request parameters.Error Message: "+str(e), status=400) My Form: <form method="POST" action="/login"> <div class="form-group"> … -
How can I add dynamic background in a <div> tag?
I am a very beginner for coding please kindly let me know how can i load a photos to my template slide show? accoding to my template i have to load pictures as braground pictures. when they are sliding appeared an Image title and discription with a link My template is this . you can see clickin this [enter link description here][1][1]: https://colorlib.com/wp/template/eatery/ if i show you the html code which is behind {% for gallery in galleries %} <div class="slider-item " style=" background-image:url{{gallery.image.url}}"> <div class="container"> <div class="row slider-text align-items-center justify-content-center"> <div class="col-md-8 text-center col-sm-12 element-animate"> <h1>{{gallery.image_title}}</h1> <p class="mb-5"> {{gallery.image_description}} </p> <p> <a href="#" class="btn btn-white btn-outline-white">Get Started</a> </p> </div> </div> </div> </div> {% endfor %} if i loade the image with tag. {% for gallery in galleries %} <div class="slider-item "> <img class="image" src="{{gallery.image.url}}" /> <div class="container"> <div class="row slider-text align-items-center justify-content-center"> <div class="col-md-8 text-center col-sm-12 element-animate"> <h1>{{gallery.image_title}}</h1> <p class="mb-5"> {{gallery.image_description}} </p> <p> <a href="#" class="btn btn-white btn-outline-white">Get Started</a> </p> </div> </div> </div> </div> {% endfor %} then i can see only the image .othe details will desappear.. please help me with a solition. thank you -
Django chat application
I'm trying to make a chat application with Django channels. I've successfully build a one-to-one chat app but I'm not getting the idea for extending it to multiple one-to-one chat. Like, right now there's only two users logged in, but what if multiple users are chatting with one another. I'm stuck on how to prepare the model for that and inserting data in the database. So if anyone can help I'd appreciate that. -
Django Aggregate Query Include Zero Count
In my Django application, I'm trying to get a Count of all Student submitted Papers, including students who have submitted NO papers (represented as count=0). models.py class Student(models.Model): idstudent = models.AutoField(primary_key=True) student_name = models.CharField(max_length=250, null=False, blank=False, verbose_name='Student Name') class Paper(models.Model): idpaper = models.AutoField(primary_key=True) student = models.ForeignKey(Student, on_delete=models.PROTECT, null=False, blank=False) Query Attempt 1: Returns only Students who have submitted Papers papers = Paper.objects.order_by('submission_date') result = papers.values('student', student_name=F('student__student_name')).annotate(count=Count('student')).distinct().order_by('-count') print(result) <QuerySet [{'idstudent': 1, 'student_name': '\nMichael Jordan\n', 'count': 4}, {'idstudent': 2, 'student_name': '\nSteve White\n', 'count': 2}, {'idstudent': 3, 'student_name': '\nHillary Clinton\n', 'count': 1}]> Query Attempt 2: Returns Students who have submitted 0 Papers, but the Count for every other Student is 1 result = Student.objects.values('pk', student_name=F('student_name')) .annotate( count=Count( 'pk', filter=Q(pk__in=Paper.objects.values('student') ) ) ) ).order_by('-count') print(result) <QuerySet [{'idstudent': 1, 'student_name': '\nMichael Jordan\n', 'count': 1}, {'idstudent': 2, 'student_name': '\nSteve White\n', 'count': 1}, {'idstudent': 3, 'student_name': '\nHillary Clinton\n', 'count': 1}, , {'idstudent': 4, 'student_name': '\nDoug Funny\n', 'count': 0}, , {'idstudent': 5, 'student_name': '\nSkeeter Valentine\n', 'count': 0}]> Along the same lines as Attempt 2, I also tried the following using Sum(Case( which yielded the same result, as I recognized that the Attempt 2 raw SQL actually utilizes Case(When, but seems to only count when Student.pk is present in … -
How to design page with collapsing menu using Django
I want to design a web page similar to below page using Django framework. Please help with my project, enter image description here -
Django Template to PDF in Django version 3
Is there any module available to handle Djnago template to PDF conversion without any visual compromise? Note: I have used only Inline and Internal CSS in the template. My website will be hosted on heroku, a OS independent solution will be preferred. Thanks in advance. -
Django application in Docker gives FileNotFoundError: [Errno 2] No such file or directory: '/tmp/
I'm using Docker with python:3.7.6-slim image to dockerize the Django application. I'm using django-import-export plugin to import data in the admin panel which stores the uploaded file in temporary directory to read while importing. But on import it gives an error FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmppk01nf3d' Same is working when not using docker. -
Saleor error with elastic-search : **Found different types with the same name in the schema: JSONString, JSONString**
I am new on GraphQL, I am using saleor for e-Commerce with elastic-search (https://pypi.org/project/graphene-elastic/). import graphene from graphene_elastic import ( ElasticsearchObjectType, ElasticsearchConnectionField, ) from graphene_elastic.filter_backends import ( FilteringFilterBackend, SearchFilterBackend, HighlightFilterBackend, OrderingFilterBackend, DefaultOrderingFilterBackend, ) from graphene_elastic.constants import ( LOOKUP_FILTER_PREFIX, LOOKUP_FILTER_TERM, LOOKUP_FILTER_TERMS, LOOKUP_FILTER_WILDCARD, LOOKUP_QUERY_EXCLUDE, LOOKUP_QUERY_IN, ) # Object type definition class Post(ElasticsearchObjectType): class Meta(object): document = PostDocument interfaces = (Node,) filter_backends = [ FilteringFilterBackend, ] # For `FilteringFilterBackend` backend filter_fields = {. 'title': { 'field': 'title.raw', # Available lookups 'lookups': [ LOOKUP_FILTER_TERM, ], # Default lookup 'default_lookup': LOOKUP_FILTER_TERM, }, 'category': 'category.raw', } # For `OrderingFilterBackend` backend ordering_fields = { 'title': 'title.raw', 'created_at': 'created_at', } # For `DefaultOrderingFilterBackend` backend ordering_defaults = ( '-num_views', # Field name in the Elasticsearch document 'title.raw', # Field name in the Elasticsearch document ) # For `HighlightFilterBackend` backend highlight_fields = { 'title': { 'enabled': True, 'options': { 'pre_tags': ["<b>"], 'post_tags': ["</b>"], } }, 'content': { 'options': { 'fragment_size': 50, 'number_of_fragments': 3 } }, 'category': {}, } # Query definition class ElasticQuery(graphene.ObjectType): all_post_documents = ElasticsearchConnectionField(Post) This is working fine but when I combine the normal Query with ElasticQuery then give me error AssertionError: Found different types with the same name in the schema: JSONString, JSONString.: class Query( AccountQueries, AppQueries, … -
Django can't load javascript but load css (please)
Please your help.. I spent hours to understand it I started a very basic template with Django, and it can't find my js files, while it can find the css file - when both of them in static folder Thanks a lot! [11/Jun/2020 00:21:18] "GET /js/init.js HTTP/1.1" 404 2134 Not Found: /js/materialize.js [11/Jun/2020 00:21:18] "GET /js/materialize.js HTTP/1.1" 404 2155 Not Found: /js/init.js In Setting.py I have these settings: BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ] STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') STATIC_ROOT = 'staticfiles' My Page index.html: This is my Project Dictionary: 3 folders - (1) home [the app] (2) project_folder (3) static - contain css, js, images -
Password reset not redirecting to template html file in django
I am trying to use a template html file for my password reset form. But it is not redirecting to my template file rather it is redirecting ti Django administration page. I don't want to use django administration page for resetting the password change link. password_reset_form.html: <!DOCTYPE html> {% load static %} <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous"> <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"> <link rel="stylesheet" href="{% static 'employeeregistration/css/master.css' %}"> </head> <body> {% load bootstrap4 %} <div class="container title"> <h2 style="text-align:center; padding-top:100px;">Reset your password</h2> </div> <div class="container"> <form method="POST" action="{% url 'password_reset' %}"> {% csrf_token %} {{ form.as_p }} {% buttons %} <button type="submit" class="btn btn-primary">Send confirmation mail</button> {% endbuttons %} </form> </div> </body> </html> urls.py: from django.urls import path from django.contrib.auth import views as auth_views from . import views app_name = 'registration' urlpatterns = [ path('login/', auth_views.LoginView.as_view(template_name="registration/login.html"), name='login'), path('password_reset/', auth_views.PasswordResetView.as_view(template_name="registration/password_reset_form.html"), name='password_reset'), # path('password_reset/password_reset_done/', auth_views.PasswordResetView.as_view(template_name="registration/password_reset_done.html"), name='password_reset_done'), path('logout/', auth_views.LogoutView.as_view(), name='logout'), path('signup/', views.EmployeeSignUp.as_view(), name='signup'), ] views.py: from django.contrib.auth import login, logout from django.contrib.auth.mixins import(LoginRequiredMixin, PermissionRequiredMixin) from django.views.generic import (TemplateView,ListView, DetailView,CreateView, UpdateView,DeleteView) from django.urls import reverse_lazy from django.views import generic from django.views.generic import CreateView from . import forms class EmployeeSignUp(CreateView): """ Views for employee sign up """ form_class = forms.NewEmployeeRegistrationForm … -
How to test a customized clean method in Django ModelForm
I have the following ModelForm forms.py class MyModelForm(forms.ModelForm): my_file = forms.FileField() class Meta: model = MyModel def clean(self): form_file = self.cleaned_data['my_file'] file_name = form_file.name if MyModel.objects.filter(my_file_name=file_name).exists(): raise forms.ValidationError("This file already exists") Actually works but I need to add some unit tests to the customized clean method. Could you help me with that? Im using Django 2.0. Thanks in advance. -
How to disable auto reload django with deployed by IIS
I deployed a django project on IIS ,like this https://docs.microsoft.com/en-us/visualstudio/python/configure-web-apps-for-iis-windows?view=vs-2019 . But I found that the project start 2 sessions,the frontend request can receive by the 2 sessions,and it will cause something wrong.I think one of the session only for auto reload,and it can also receive request? When I start the project in cmd python manage.py runserver --noreload ,it is ok. How I can add this --noreload parameter in IIS settings? -
How to access html button values in django views
I am working on a django web application. The application has a few buttons inside a form. These buttons act like toggle switches. When a user submits the form, I want to access the values of the button in the django views. Take a look at the image below for better understanding. I designed the form with Bootstrap. this is the code to the HTML form. <form> {% csrf_token %} ... <p class='details-scrape'>Select the items you want to add to the list</p> <button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> Tomato </button> <button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> Eggs </button> <button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> Bread </button> <button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> Beans </button> <button type="button" class="btn btn-outline-primary" data-toggle="button" aria-pressed="false" autocomplete="off"> Cheese </button> <button type="submit" class="btn btn-primary btn-block btn-lg mt-5">Submit</button> </form> Here is my views.py code def index(request): if request.method == 'POST': # ------------- New code will come here ----------------- #access the values of the clicked buttons here... return redirect(index) else: return render(request, 'index.html') -
django- password reset link from email doesn't load templates but redirect to homepage
I'm using dj-rest-auth for the password reset I was able to receive an email with the link: mysite.com/password/reset/confirm/NTg/5h7-172d3be6f550a332e590/ Upon clicking the link, it would redirect to my frontend's (reactjs) home page when it should load the templates. This is my urls.py file: from django.urls import include, path, re_path from django.views.generic import TemplateView urlpatterns = [ path("auth/registration/", include("dj_rest_auth.registration.urls")), re_path(r"^password/reset/$", TemplateView.as_view(template_name = "password_reset.html"), name = 'password-reset'), re_path(r"^password/reset/confirm/$", TemplateView.as_view(template_name="password_reset_confirm.html"), name='password-reset-confirm'), re_path(r"^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$", TemplateView.as_view(template_name="password_reset_confirm.html"), name='password_reset_confirm'), path("auth/", include("dj_rest_auth.urls")), # User path("user/", UserDetailView.as_view()), path('accounts/', include('allauth.urls')), re_path(r"", TemplateView.as_view(template_name="index.html")), ] I have placed the templates in this directory: templates/account/password_reset.html templates/account/password_reset_confirm.html I have placed the templates in this manner because I also had a custom template for confirm email with allauth and putting the templates outside /account directory will cause conflict. I also called the templates in settings.py TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", "DIRS": [ os.path.join(BASE_DIR, 'templates'), os.path.join(FRONTEND_DIR, "build"), ], # Added for "hybrid" architecture, to find front's index.html "APP_DIRS": True, "OPTIONS": { "context_processors": [ "django.template.context_processors.debug", "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", ], }, }, ] I noticed that the link has the domain name as base URL mysite.com instead of 127.0.0.1:8000 Any idea what I'm missing here? Thanks -
How to update django database after deploying it on heroku?
I have deployed my Django quiz app on Heroku by connecting with GitHub. The link of the site is . Now I want to add new questions into the quiz? How to do this? (I have tried to change from the admin panel but after 30-40 minutes default questions are shown only.) -
Pickled model instance's Django version 3.0.3 does not match the current version 3.0.7
When upgrading Django version from Django 3.0.3 to 3.0.7. I get this error. RuntimeWarning: Pickled model instance's Django version 3.0.3 does not match the current version 3.0.7. value = pickle.loads(value) Is there any way to solve this issue to continue deployment without downtime -
TypeError: expected string or bytes-like object error for date range in Django
I am trying to filter CartItem objects based on their delivery dates. I define a startfilterdate and an endfilterdate that i format as a string in the same way my delivery_date's are formatted. Not sure what i am doing wrong. models.py class CartItems(models.Model): restaurant = models.ForeignKey(Restaurant, related_name='restaurant', on_delete=models.CASCADE) delivery_date = models.DateField(auto_now_add=False) views.py class RestaurantOrders(generics.ListAPIView): serializer_class = RestaurantOrderSerializer def get_queryset(self): restaurant_id = self.kwargs['pk'] startfilterdate = date.today() startfilterdate = startfilterdate.strftime("%Y-%m-%d") endfilterdate = date.today()+timedelta(days=9) endfilterdate = endfilterdate.strftime("%Y-%m-%d") orders = CartItems.objects.filter(restaurant_id = restaurant_id, delivery_date=[startfilterdate,endfilterdate]) Error: TypeError: expected string or bytes-like object -
Django Google Login setup without django.contrib.admin and django.contrib.auth
I am working as a newbie backend-engineer where the company requires you to follow this guideline where you comment out django.contrib.admin and django.contrib.auth in settings.py. Below is part of my settings.py INSTALLED_APPS = [ # 'django.contrib.admin', # 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'allauth', 'allauth.account', 'allauth.socialaccount', 'allauth.socialaccount.providers.google', 'account', 'pin', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', #'django.middleware.csrf.CsrfViewMiddleware', #'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'corsheaders.middleware.CorsMiddleware', ] They asked me to build a google social login function so I have been referring to a blog posting about setting up the google login. This is the blog: https://medium.com/@whizzoe/in-5-mins-set-up-google-login-to-sign-up-users-on-django-e71d5c38f5d5 Thankfully, there is no need for me to do anything about Django templates since I have front-engineers on it. However, all the google social login set-up tutorials I have found on google requires me to use django.contrib.admin or django.contrib.auth, which my boss has stipulated me not to use(again, this is our company rule). Thus, I am not able to proceed to chapter 8 of the above-mentioned blog tutorial. Is there any way to circumvent the usage of Django-admin and still be able to build the Google social login functionality? Thanks a lot in advance!