Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to route the value of editable table cell to another method using Django
I am using Django framework. Currently I have a table row whose cells are editable and the code is as follows: <td><p align="center" contenteditable='true'>ABC</p><button>Edit</button></td> Now my need is to edit the value of this cell to (say) "XYZ" from "ABC" and click on the button "Edit" and then it should redirect me to an api in the views.py file with the value of "XYZ". So how can I achieve that ? Please help me as I am not much thorough with Django. Should we use any javascript method or directly can I route the value "XYZ" to the api in views.py file? -
Python Django Ajax get request not working in def function
I'm trying to pass a variable from my JQuery Ajax object via get method to my views.py file (in django) I was using a class before and it was working just fine.. views.py working code: class AjaxHandlerView(View): def get(self, request): text = request.GET.get('button_text') print() print(text) print() if request.is_ajax(): return JsonResponse({'test': 'blah'}) return render(request,'home.html' , {'name': 'Handled by AHV'} ) app urls.py from django.urls import path from . import views from .views import * urlpatterns = [ path('', AjaxHandlerView.as_view() ), path('ajaxg' , views.ajaxgtest, name="ajaxg" ) ] jquery ajax functions (ignore the post method) var test_str = "[0,0]"; $(document).ready(function(){ var csrf = $('input[name=csrfmiddlewaretoken]').val() $('#jq_btn').click(function(){ $.ajax({ url: '', type: 'get', data: { button_text: test_str }, success: function(response) { $("#jq_btn").text(response.test + test_str); console.log(test_str); } }); }); $('#post_btn').click(function() { $.ajax({ url: '', type: 'post', data: { text: test_str, csrfmiddlewaretoken: csrf }, success: function(reponse) { test_str = reponse.postdata console.log(test_str); } }) }); }); However I wanted to use a specific function for specific methods.. so I tried using a def.. views.py that is not working: def ajaxgtest(self, request): text = request.GET.get('button_text') print(text + "deffer") if request.is_ajax(): return JsonResponse({'test': 'blah'}) return render(request,'home.html' , {'name': 'Handled by AHV'} ) As for the Jquery code, all I did was … -
showing results as 'Undefined', instead of expected output in text field
I want to populate values into 4 text fields based on the value given in the input field. when control comes out of the input field, a function getcredentials() is called which in turn calls a python code. python code retrieves the 4 required values from an excel sheet and returns the result as a dictionary. I have tried to set those 4 values from the result dictionary in the following way. please correct me. script : <script> function getcredentials() { var x = document.index.AWSID.value; console.log(x) var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.index.APPUSERNAME.value = this.responseText['AppUsername']; document.index.APPPASSWORD.value = this.responseText['AppPassword']; document.index.RDPUSERNAME.value = this.responseText['RdpUsername']; document.index.RDPPASSWORD.value = this.responseText['RdpPassword']; } }; xhttp.open('POST', 'getcredentials', true); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); /*xhttp.send(x);*/ xhttp.send("x="+encodeURIComponent(x)); } </script> python code : def getCredentials(request): AwsId = request.POST.get('x') result = {'RdpUsername' : 'Opsadmin', 'RdpPassword' : '--C0nt@1ns^Ph3n%l@l@n1n3--', 'AppUsername' : 'Admin', 'AppPassword' : 'M@St3r..CRM'} result['RdpPassword'] = result['RdpPassword'] + AwsId[-5:] result['AppPassword'] = result['AppPassword'] + AwsId[0:3] response = HttpResponse(result) return response -
Django rest framework social oauth2 causing unexpected error with Djongo for mongoDB conversion of django app
I am using Django rest framework social oauth2 for authentication in one Django app. For development purposes, I have used this package with Sqlite3 (SQL database) and it works perfectly. However, now I want to migrate this Django app to MongoDB (NoSQL database) via using [Djongo][1]. After implementing all the required changes it is showing this bizarre error. I have seen everywhere couldn't find a relevant solution python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, oauth2_provider, sessions, social_django Running migrations: Not implemented alter command for SQL ALTER TABLE "oauth2_provider_accesstoken" ADD COLUMN "source_refresh_token_id" long NULL UNIQUE Applying oauth2_provider.0001_initial...Traceback (most recent call last): File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/cursor.py", line 51, in execute self.result = Query( File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 783, in _init_ self._query = self.parse() File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 875, in parse raise e File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 856, in parse return handler(self, statement) File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 888, in _alter query = AlterQuery(self.db, self.connection_properties, sm, self._params) File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 425, in _init_ super().__init__(*args) File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 84, in _init_ super().__init__(*args) File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 62, in _init_ self.parse() File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 435, in parse self._add(statement) File "/home/anakin/virtual_envs/js_backend/lib/python3.8/site-packages/djongo/sql2mongo/query.py", line 598, in _add raise SQLDecodeError(err_key=tok.value, djongo.exceptions.SQLDecodeError: Keyword: long Sub SQL: ALTER TABLE "oauth2_provider_accesstoken" ADD COLUMN "source_refresh_token_id" long … -
No Post matches the given query in django
So i have a project called star social project this project is similar to a socail media that you can post and create group but this project you can only post when you are in a group. So i get an error message that is not familiar to me which is on the title, i tried to search on google and get some result but when i implement it to my project it does not work. So why im getting this error is because i'm trying to create a comment section and when i click the add comment that's when i get the error message. So i'm here to ask someone to help me because i'm not really familiar on this error and i'm just learning django for about 2 months now. models.py ########################## ## POSTS MODELS.PY FILE ## ########################## from django.contrib.auth import get_user_model from django.db import models from groups.models import Group from misaka import html from django.urls import reverse from django.utils import timezone User = get_user_model() class Post(models.Model): user = models.ForeignKey(User, related_name='posts', on_delete=models.CASCADE) created_at = models.DateTimeField(auto_now=True) message = models.TextField() message_html = models.TextField(editable=False) group = models.ForeignKey(Group, related_name='posts', null=True, blank=True, on_delete=models.CASCADE) def __str__(self): return self.message def save(self, *args, **kwargs): self.message_html = … -
Django Product object has no attribute author
hi i am not new to django but i can not find the error . may be a new pair of eyes can saw that i just import usertestmixin and wrote the function test_func() but it is not working i do not know why it gave me the error 'Product' object has no attribute 'author' my models for product is: class Product(models.Model): title = models.CharField(max_length=110) slug = models.SlugField(blank=True, unique=True) price = models.DecimalField(decimal_places=2, max_digits=6) discount_price=models.FloatField(blank=True, null=True) size = models.CharField(choices=SIZE_CHOICES, max_length=20) color = models.CharField(max_length=20, blank=True, null=True) image = models.ImageField(upload_to=upload_image_path) description = models.CharField(max_length=1000) featured = models.BooleanField(default=False) time_stamp = models.DateTimeField(auto_now_add=True) and my models.py for user is: class User(AbstractBaseUser): email = models.EmailField(max_length=255 ,unique=True) full_name = models.CharField(max_length=255, blank=True, null=True) active = models.BooleanField(default=True) #can login staff = models.BooleanField(default=False) #staff user non super user admin = models.BooleanField(default=False) #superuser time_stamp = models.DateTimeField(auto_now_add=True) and my views.py is: class ProductUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView): model = Product template_name = 'product-form.html' fields = ['title', 'price' , 'size' , 'color', 'image' , 'description'] def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form) def test_func(self): self.object = self.get_object() return self.request.user == self.object.author it gave me the error:enter image description here -
Getting 401 HTTP error during deployment only
I made a website using Django and Angular. I deployed the app using the instructions from this link: https://medium.com/saarthi-ai/ec2apachedjango-838e3f6014ab Problem When I ran the app locally it works fine. But, during deployment I am getting 401 error, I don't understand why. The deployment is done in the Amazon AWS EC2 instance using an Apache webserver. The authentication used is django-rest-knox P.S: I also checked the admin panel and the token of the user is added. -
Happy new year Stackoverflow
Happy new year everyone! Thanks for all the support you give to noobs! happy new year Does anyone know where django-channels store channel_name? -
AWS Elastic Beanstalk Django website won't show up
I have set Elastic Beanstalk of Python3.6/Amazon Linux with Django 1.11. The application has been successfully uploaded via EB CLI and installed. INFO Deploying new version to instance(s). INFO New application version was deployed to running EC2 instances. INFO Environment update completed successfully. set .config files without errors: option_settings: aws:elasticbeanstalk:application:environment: DJANGO_SETTINGS_MODULE: myproject.settings SECRET_KEY: TempKey aws:elasticbeanstalk:container:python: WSGIPath: myproject/wsgi.py The EB parses wsgi.py well. I have included the current EB address(like projectname.us-west-1.elasticbeanstalk.com) in ALLOWED_HOSTS. After all these 'no-error' processes, however, the actual website does not show up. (while, the EB sample application was working) There is even no 400, 500 error message page at all. No Django error message no matter what DEBUG=True or False. Just browser shows a blank timed out page. When I run Django in local environment with python manage.py runserver, it works nicely. ------------------------------------- /var/log/httpd/error_log ------------------------------------- [mpm_prefork:notice] [pid 3150] AH00169: caught SIGTERM, shutting down [suexec:notice] [pid 20456] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [so:warn] [pid 20456] AH01574: module wsgi_module is already loaded, skipping [http2:warn] [pid 20456] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm … -
use jenkins to run cron job that queries a database used by django rest app and store results in file in django app or back in database
I have a django rest app with a view that is dependent on the performance of each user in a category within my app. I don't want to have the query this view requires be to done every time the view is called, because I want this view to be an example of a snapshot in time every 4 hours. Additionally I have learned from various reading that we can use jenkins to do cron jobs with ( I tried the unix os way, and its a mess, functionality is a lot nicer with jenkins) I want to use jenkins to query my database for the information I need, then store that information back in my database in another table, or even better a file in my django project if possible, to then be used with my view. Thing is I have no idea how to start doing this. Can someone walk me through a bit. All the tutorials are on pipelines. -
I made a login page ,After I put in the login credentials, the page is not moving to the next page
when I try to login to the page, it is not moving onto the next page. The project is linked to a db and the db stores the superuser data, but the login is not moving further login_page.html : <div class="card"> <div class="card-body login-card-body"> <p class="login-box-msg">Sign in to Student Management System</p> <form action="/doLogin" method="POST"> {% csrf_token %} <div class="input-group mb-3"> <input type="email" class="form-control" placeholder="Email" name="email"> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-envelope"></span> </div> </div> </div> <div class="input-group mb-3"> <input type="password" class="form-control" placeholder="Password" name="password"> <div class="input-group-append"> <div class="input-group-text"> <span class="fas fa-lock"></span> </div> </div> </div> <div class="row"> urls.py : from django.conf.urls import url from django.contrib import admin from django.conf.urls.static import static from student_management_app import views from student_management_system import settings urlpatterns = [ url('demo',views.showDemoPage), url(r'^admin/', admin.site.urls), url('',views.ShowLoginPage), url('doLogin',views.doLogin), ]+static(settings.MEDIA_URL,document_root=settings.MEDIA_ROOT)+static(settings.STATIC_URL,document_root=settings.STATIC_ROOT) The doLogin function is supposed to output the login credentials entered in the login page, but it is not going to the output part of it views.py : import datetime from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render def showDemoPage(request): return render(request,"demo.html") def ShowLoginPage(request): return render(request,"login_page.html") def doLogin(request): if request.method != "POST": return HttpResponse("<h2>Method not Allowed</h2>") else: return HttpResponse("Email : "+request.POST.get("email")+" Password : "+request.POST.get("password")) -
How do I setup django on Linode with domain name?
I have created Linode and domain name on Linode now I want to deploy my local Django app to Linode. How can I do Please suggest to me. -
Page not found (404) in Django, whenever I tried adding <int:pk> in urls.py
What I wanted to achieve is for the product's id to be shown in the url, whenever a user clicks it. So I tried putting int:pk in the url, but it says, Page Not Found (404) Request Method: GET Request URL: http://127.0.0.1:8000/book-details/ Below is my code homepage.html {% for book in random %} <a type="submit" href="{{% url 'book-details' %}}"> <img src="{{book.cover.url}}" height="300px" width="200px"> </a> {% endfor %} views.py def book_details(request,pk): return render(request, 'book-details.html') urls.py urlpatterns = [ path('admin/', admin.site.urls), path('', homepage, name='home'), path('fiction', fiction, name='fiction'), path('nonfiction', nonfiction, name='nonfiction'), path('book-details/<int:pk>/', book_details, name='book-details'), path('search-result', search_result, name='search-result') -
Elastic Beanstalk Django error when running eb create
I'm trying to upload my Django based Python server to AWS Elastic Beanstalk. It all works fine until eb create. Here, in the error logs, I get the error: An error occurred during execution of command [app-deploy] - [StageApplication]. Stop running the command. Error: chown /var/app/staging/include/python3.7m: no such file or directory This is the layout of my folder in which I initialized eb: This is the layout of my folder inside src, which is the Django Application: All of the folders have been uploaded to my git repository. I realize this may not be enough information, so please ask me for more and I'll reply ASAP. -
Django Admin Create Child Item Directly From Parent
I have two models basically the category and the product (having a foreign field related to the category). Several categories have been created through the admin page and next would be creating the products under each category. I would like to know in Django Admin, if there is a way I could click on the individual category and create a product directly under the category I selected. Note that I understand I can create a product and select the category directy, but I just want to know if I can do it from the category side. Thank you. # my models class Category(models.Model): code = models.CharField(max_length=45, unique=True) name = models.CharField(max_length=45) class Product(models.Model): part_number = models.CharField(max_length=45, unique=True) category = models.ForeignKey(Category, on_delete=models.RESTRICT) brand = models.CharField(max_length=45, blank=True, null=True) specification = models.CharField(max_length=45) Currently I have -
django crontab not execution function
i installed crontab and I am on a 2020 macbook pro pip installed pip install django-crontab added cron to my installed apps INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_crontab', 'corsheaders', ... added my cronjobs setting and set the interval for every minute CRONJOBS = [ ('*/1 * * * *', 'shofidecksite.cron.testcron') ] made a cron.py file in my app directory added the testcron function from users.models import ContentCreatorUsers def testcron(): users = ContentCreatorUsers.objects.all() for user in users: user.delete() ran the cron add command python manage.py crontab add removing cronjob: (a590457763fe7584cac7e45a045d5955) -> ('*/1 * * * *', 'shofidecksite.cron.testcron') adding cronjob: (a590457763fe7584cac7e45a045d5955) -> ('*/1 * * * *', 'shofidecksite.cron.testcron') then ran python manage.py runserver I started with 30554 test ContentCreatorUsers 2 minutes later I still have the same, none where deleted. Did I do something wrong? -
Django-Channels: How to get channel_name from user_id?
Below code prints the channel_name of a client class ChatConsumer(WebsocketConsumer): def connect(self): self.room_name = self.scope['url_route']['kwargs']['room_name'] self.room_group_name = 'chat_%s' % self.room_name print(self.channel_name) How to get the channel_name from user_id (user.id) for an authenticated user (It needs to be accessed outside the consumer)? Something like below import foo channel_name=foo.get_channel_name_from_user_id(user_id) print(channel_name) Thanks! Happy new year! -
Django: Channels and Web Socket, how to make group chats exclusive
Eg i have a chat application, however, i realised that for my application, as long as you have the link to the chat, you can enter. how do I prevent that, and make it such that only members of the group chat can access the chat. Something like password protected the url to the chat, or perhaps something like whatsapp. Does anyone have any suggestion and reference material as to how I should build this and implement the function? Thank you! -
Error Could not deserialize key data when Using RSA Algorithm Django Rest Framework Simple JWT
I got an Error when using django rest framework simple jwt authentication when i'm using algorithm RSA in [ SIMPLE_JWT ] when i'm using RS Algorithm my the code work very well but when i'm change the Algorithm to RS the error has raised like this: Could not deserialize key data. The data may be in an incorrect format or it may be encrypted with an unsupported algorithm. My Settings SIMPLE_JWT = { 'ALGORITHM': 'RS512', 'SIGNING_KEY' : 'ssh-rsa MIIBPAIBAAJBALZ+WuuTIol2cwEALcqn+/d0AER+sX269KVZt7sdl9C0QcspNHvHGYBWLoYIV5i72fsINX4V5IvkqsIn83O4jQMCAwEAAQJBAJ8E/Y73GAo2V8IQeNZ1iH646x7EUz9e8J1Az3PSNp7ZZ4tNjEhyA817qQGT9nfvRPXqIKkKFVe0THfmWmbK5cECIQD4M/qhoT2n99iIJwJq2DhbVvqx74hal+ocuboSwDZuIwIhALw58q4+YZlg79fGc2PyK8MUQLIx/i+O3bK7moMCf6OhAiEA04E/15IWf1clzsgnODMuuy9AjHaJJGIGHxpppObkuy8CIGqjwhRqD02gmAH90x5K8/RAIy9SF5rGLGC43R9gaQRBAiEAoLxLZuvXosXy6XR67ODCgZI7yB1XXVIwB73LxWXrnkk=', 'VERIFYING_KEY' : 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALZ+WuuTIol2cwEALcqn+/d0AER+sX269KVZt7sdl9C0QcspNHvHGYBWLoYIV5i72fsINX4V5IvkqsIn83O4jQMCAwEAAQ==' } REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework_simplejwt.authentication.JWTAuthentication', ), 'DEFAULT_PERMISSION_CLASSES': [ 'rest_framework.permissions.IsAuthenticated', ] } Views and Other Using Djoser Package Request POST | http://localhost:8000/api/jwt/create/ username : userExample, password : ********** Note : Using Postman for testing -
How to save a python list object in Django into Redis hash using hset after getting model id's using values_list
I am trying to set a list object from Django values list inside my Redis hash using json.dumps() however, I get the error: the JSON object must be str, bytes or bytearray, not list Currently, I am getting the id's of a model using values_list: ids = list( Product.objects .filter(...) .values_list("id", flat=True) ) then I do: redis_client.hset('my-hash','subhashid',json.dumps(ids)) But I get that error. How can I save an array to a Redis hash? What would be the fastest way to encode/decode that array, I was trying to do it using json, but I get this error. -
Beginner question: Filtering dates to match the date of another model in Django
Beginner in Django here, I have been trying to work this out on-and-off for the last few days and have tried reading the docs and googling for solutions, but to no avail. My django project has two apps - blog and weather, each with a model. blog.models import datetime from django.db import models class BlogEntry(models.Model): date = models.DateField('Date') blog_name = models.CharField('Name',max_length = 255, null=True) weather.models import datetime from django.db import models class WeatherEntry(models.Model): date = models.DateField('Date') weather = models.CharField('Weather',max_length = 255, null=True) The weather app is meant to be filled in once daily, but the blog app is only to be filled in occasionally. Now, I want to produce a DetailView for my BlogEntry model which would also show the weather on the day the blog was created. My plan was to override get_context_data() but I could not filter the Weather queryset according to the date. In the view import datetime from django.views.generic.detail import DetailView from blog.models import BlogEntry from weather.models import WeatherEntry class BlogDetailView(DetailView): model = BlogEntry template_name = 'Blog/blog_detail.html' def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context['weather'] = WeatherEntry.objects.filter(date__=date) return context I would get the error NameError: name 'date' is not defined. I've using F expressions too and they … -
Show person list based on group selection list in django
I'm pretty new in django/ Python and any help will be appreciated I'm trying to populate a list of person based on click on another list (Group) Model: class Grupo(models.Model): Nome = models.CharField(max_length=20) View class GruposListView(ListView): model = Grupo template_name = 'reports/relatorio_form.html' context_object_name = 'Grupo' HTML <h4 class="mb-3">Select a group:</h4> <select id="Group" name="Group" size="5"> {% for Grupo in Grupo %} <option value="Grupo">{{Grupo.Nome}}</option> {% endfor %} </select><br><br> -
How to save user when saving a form using post within Class-Based Views in Django
Currently the form instance is being saved but the user who filled out the information isn't being saved when I save this form. I am wondering how to grab the user and have it be added to the creation of the new form object. class ObjectListView(LoginRequiredMixin, FormMixin, ListView): model = Object template_name = 'ui/home.html' context_object_name = 'objects' form_class = OrderForm def post(self, request, *args, **kwargs): form = self.get_form() if form.is_valid(): form.save() order_type = form.cleaned_data.get('order_type') price = form.cleaned_data.get('price') **user = request.user** messages.success(request, f'Your order has been placed.') return redirect('account') -
Multiple-select form and query django
One of my fields in my model has a choice field: STATUS = Choices( ('first', _('car')), ('second', _('motorcycle')), ('third', _('bicycle')), ) My filter function looks like this: choice = request.GET.get('choice') vehicles = vehicles.filter(status=choice).order_by('-date_posted') The filter works, when I select only one choice, but when I am trying to select more than one choice it only catches the last one selected. The query looks like that: ?choice=first&choice=second Any idea how to make it, so it would display items, based on more than one choice? -
Why am I getting "No module named 'django_celery_beat'" after installing django_celery_beat to my virtual env and putting it in INSTALLED_APPS?
I am working on a Django project, and need to run cron tasks periodically to go through and delete all outdated files. I tried this same method with django_extensions and crontab, but I keep getting this same error. Within settings.py, I have: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'Data_Science_Web_App', 'django_celery_beat', ] in my INSTALLED_APPS section. 'Data_Science_Web_App' is the name of my application. When I used pip3 install django_celery_beat, it worked fine. However, when I try to migrate changes, I get this message: (djangoenv) Daeyongs-Air:Data_Science_Project daeyong$ python3 manage.py migrate Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/django/core/management/__init__.py", line 401, in execute_from_command_line utility.execute() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/django/core/management/__init__.py", line 377, in execute django.setup() File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site- packages/django/apps/config.py", line 90, in create module = import_module(entry) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'django_celery_beat' When I check using pip freeze, it is evident that …