Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Deploying Project from VS to App service: Container ***** didn't respond to HTTP pings on port: 8000, failing site start
I'm trying to deploy Django project to Azure App Service through Visual Studio. Once deployed and if I open the app URL an error is displayed ":( Application Error". Same error occurs if deployed from the GitHub Actions CI/CD through service principles. Logs displaying this error "Container **** didn't respond to HTTP pings on port: 8000, failing site start" Unable to find any solution for this. Any help would be appreciated. -
In @app.route('/') , how route function is invoked from app object. like @object.decorator_function(arg)
In Python flask framework app is object and route is function and decorator can anybody tell me what is the mechanism behind it . I mean @app.route('/') , how route function is invoked from app object. e.g. @object.decorator_function(arg) from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello, World!' -
Changing the Django admin site
I wanted to change the "Django administration" text on the default Django admin site. But the docs do not make it that, clear. Is there a way that I can do it once i have collected all the static files? -
Elastic search and Lucene for Django and MongoDB
I'm implementing a search engine in my Django project with MongoDB. But I have some confusion about choosing between Lucene and ElasticSearch. As mentioned, I'm using MongoDB for storing data. Anyone, please give me the technical reason for choosing Lucene over ElasticSearch. Which one is better for indexing and analytics as well. -
Django admin does not show extra fields added in init method of modelform
I found a couple of questions regarding this, but I specifically wonder about how to add a field in the ModelForms __init__() method. This is, because I get the number of fields from a function and need to display them in the admin: class SomeForm(forms.ModelForm): class Meta: model = Product fields = ["name", "price",] def __init__(self, *args, **kwargs): number_of_fields = get_number of fields(kwargs["instance"]) print(number_of_fields) ## e.g. 3, gives output super().__init__(*args, **kwargs) for i in range(number_of_fields): self.fields[i] = forms.CharField("test", required = False) But the fields do not show up in the Template Admin edit page. What did I miss? No error popping up either ... -
django-component - passing string instead of context variable
Having trouble passing context variable to a django-component View: labels = "'January','February','March','April','May','June'" data = "69, 10, 5, 2, 20, 30" colors = "'#3e95cd', '#8e5ea2','#3cba9f','#e8c3b9','#c45850','#a45350'" context = { 'title': title, 'language': langCode, 'clabels':labels, 'cdata':data, 'ccolors':colors} return render(request, "reports/dashboard.html", context) In Template: <div class="col-lg-6">{% component "simplechart" width="980" height="300" chartid="chart1" title="We are testing" clabels='{{ clabels }}' cdata="{{ cdata }}" ccolors="{{ ccolors }}" type="bar" %}</div> Components.py @component.register("simplechart") class SimpleChart(component.Component): # Note that Django will look for templates inside `[your app]/components` dir # To customize which template to use based on context override get_template_name instead template_name = "simplechart/simplechart.html" # This component takes three parameters def get_context_data(self, width, height, chartid, title, clabels,cdata,ccolors, type): print("CHART GET CONTEXT") print(cdata) print(clabels) return { "width": width, "height": height, "chartid": chartid, "title": title, "clabels": clabels, "cdata": cdata, "ccolors": ccolors, "type": type } class Media: css = { 'all': ('css/simplecard.css') } js = 'js/cmx_chart.js' The debug print statements output: CHART GET CONTEXT {{cdata}} {{clabels}} It is passing in the litereal string, not replacing with context variable passed in from the view. Any ideas what I'm doing wrong? -
allauth don't send verification emails django
hi iam useing allauth django but it dont send any email my settings.py : # ALL AUTH SETTINGS ACCOUNT_EMAIL_REQUIRED= True ACCOUNT_EMAIL_VERIFICATION = 'mandatory' ACCOUNT_USERNAME_BLACKLIST = ['test'] ACCOUNT_USERNAME_MIN_LENGTH = 4 ACCOUNT_AUTHENTICATION_METHOD = 'email' ACCOUNT_EMAIL_CONFIRMATION_COOLDOWN =120 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = 'MY EMAIL' EMAIL_HOST_PASSWORD = 'EMAIL PASSWORD' i have trun on less secure apps on my google account i dont know what to do know -
Drf excel renderer not returning proper values?
class UserExportSerializer(ModelSerializer): class Meta: model = User fields = ["email", "phone", "username"] class UserExportViewSet(XLSXFileMixin, ReadOnlyModelViewSet): queryset = User.objects.all() serializer_class = UserExportSerializer renderer_classes = [XLSXRenderer] I have a value of phone +919999999999 in database but while exporting to excel it returns '+919999999999. But if there is not + at first in phone value then it works fine. I am using drf-renderer-xlsx package to export into excel. -
how to pass in slug url in django template
i want to pass in a slug in my django template so i can be able to add a post as favourite but i do not know the right way to pass in the slug this is what i have done href="{% url 'elements:favourite' elements_slug.slug %} <a href="{% url 'elements:favourite' elements_slug.slug %}" class="btn">Favourite</a> views.py def favourite(request, elements_slug): user = request.user elements = Elements.objects.get(slug=elements_slug) profile = Profile.objects.get(user=user) if profile.favourite.filter(slug=elements_slug).exists(): profile.favourite.remove(elements) else: profile.favourite.add(elements) return HttpResponseRedirect(reverse('elements:vector-details', args=[elements_slug])) -
Django - display "loading bar" after form submit until backend result is returned
I have a online pricing webpage where customer can input some data, then submit the form to get the price returned. How to display a "work-in-progress/loading/calculating"kind of thing temporarily before the final result (e.g. price) is calculated/returned. below is the simplified code from my web: Main html (post_list.html) (Note: I am using htmx to help partially update the page result) <html> <body> <form method="POST" hx-post="{% url 'post_list' %}" hx-target="#num_1" hx-target="#num_2" hx-target="#result"> {% csrf_token %} <div> <label>num_1:</label> <input type="text" name="num_1" value="" placeholder="Enter value" /> </div> <div> <label>num_2:</label> <input type="text" name="num_2" value="" placeholder="Enter value" /> </div> <br /> <div id="num_1">{{ num_1 }}</div> <br /> <div id="num_2">{{ num_2 }}</div> <br /> <div id="result">{{ result }}</div> <br> <button type="submit">Submit</button> </form> <script src="https://unpkg.com/htmx.org@1.6.1"></script> </body> </html> post_list_snippet.html <html> <div> <label>first_number:</label> <span id="num_1"> {{ num_1 }} </span> </div> <div> <label>second_number:</label> <span id="num_2"> {{ num_2 }} </span> </div> <div> <label>calculation_result:</label> <span id="result"> {{ result }} </span> </div> </html> view.py def post_list(request): result = "" num1 = "" num2 = "" if request.method == "POST": num1 = request.POST.get('num_1') num2 = request.POST.get('num_2') result = int(num1) + int(num2) if request.headers.get('Hx-Request') == 'true': # return only the result to be replaced return render(request, 'blog/post_list_snippet.html', {'num_1': num1,'num_2': num2,'result': result}) else: return render(request, 'blog/post_list.html', … -
Django Model ImageField default value
I made a model which has an image field and it is allowed to be blank. How can I have a default image for the model when no image is set for it? class Product(models.Model): picture = models.ImageField(blank=True) -
how to access parent object from admin tabularinline in Django admin
I need to access the parent object of an item to be able to filter the dropdown Fk fields inside the inline object based on it is a parent. here is my code : models.py class Match(models.Model): date_time = models.DateTimeField() home_team = models.ForeignKey('teams.Team',related_name="home_team_team",on_delete=models.PROTECT) away_team = models.ForeignKey('teams.Team',related_name="away_team_team",on_delete=models.PROTECT) league = models.ForeignKey(League,on_delete=models.CASCADE,null=True) class Goal(models.Model): match = models.ForeignKey(Match,on_delete=models.CASCADE) date_time = models.DateTimeField() team = models.ForeignKey("teams.Team",on_delete=models.PROTECT,null=True,blank=True) player = models.ForeignKey('players.PlayerProfile',related_name="goal_maker",on_delete=models.PROTECT,null=True,blank=True) assistant = models.ForeignKey('players.PlayerProfile',related_name="goal_assist",on_delete=models.PROTECT,null=True,blank=True) admin.py #this is my inline class class GoalInline(nested_admin.NestedTabularInline): model = Goal fields = ['date_time','team','player','assistant'] extra = 1 show_change_link = True def formfield_for_foreignkey(self, db_field, request, **kwargs): print(f"data {self.model}") if db_field.name == "team": kwargs["queryset"] = Team.objects.filter() #i need to perform filtering here return super().formfield_for_foreignkey(db_field, request, **kwargs) #my parent class @admin.register(Match) class MatchAdmin(nested_admin.NestedModelAdmin): # form = LeagueForm readonly_fields = ['date_time','home_team','away_team','league'] list_display = ["league","home_team","away_team",] search_fields=["home_team","away_team","league"] list_filter=['league','date_time',"home_team","away_team"] inlines=[GoalInline] def get_inlines(self, request, obj=None): if obj: return [GoalInline] else: return [] -
django-tinymce doesn't show up in admin
I can't get the django-tinymce module gui to show up in the admin of my django project. Here's settings.py (tinymce settings are at the end): import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'XXXXXXXXXXXX' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'notices.apps.NoticesConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.gis', 'imagekit', 'leaflet', 'nested_admin', 'tinymce' ] 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', ] ROOT_URLCONF = 'orag.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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', ], }, }, ] WSGI_APPLICATION = 'orag.wsgi.application' # Database # https://docs.djangoproject.com/en/3.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'xxxxxx', 'NAME': 'xxxxxx', 'USER': 'xxxxxx', 'PASSWORD': 'xxxxxx', 'HOST': 'localhost' } } # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', }, { 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject.com/en/3.1/topics/i18n/ LANGUAGE_CODE = 'fr-FR' TIME_ZONE = … -
I want to filter public feeds by the multiple tags (saved in user's preferences)
I have a list of tags (preferenced by the USER). tags_list = ["animals", "city", "chemicals", "Wealth Management", "Crypto", "Stocks"] and a Feed model and Its tags class FeedModel(models.Model): entity_id = models.BigAutoField(primary_key=True) profile = models.ForeignKey(Profile, on_delete=models.CASCADE) title = models.CharField(max_length=250) image_url = models.TextField(null=True) description = models.TextField() created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) # mostly 5 tags per feed class NewsTags(models.Model): id = models.BigAutoField(primary_key=True) feed = models.ForeignKey(FeedModel, on_delete=models.CASCADE, related_name='tags') tag = models.CharField(max_length=100) # animals, city, finance,... I want to filter feeds by the given tags and order by created_at. so that My requirement is filtered feed must be on the top and the remaining feed below the filtered feed also with order_by created_at. q = Q() for tag in tags_list: q |= Q(tags__tag__icontains=tag) q1 = Q(*remaining feed apart from filtered by the tags*) _feeds = FeedModel.objects.filter(q|q1).order_by("created_at") How can I get feed data filtered by tags like Facebook, Instagram feed by the user behavior,... Please answer, how can I do it best? -
How to customize django admin site like this?
Hello, I would like to know how to proceed to have a customization like this with django Anyone know what should i do? -
serialize dictionary with dynamic key
I would like to create a django rest framework serializer, in order to serialize this dict: "series": { "real": "Real", "forecast": "Forecast", "upper_ci": "Upper CI", "lower_ci": "Lower CI" } The problems is that real, forecast, upper_ci, lower_ci are all dynamic keys, and there might be other different keys. -
Implementing a Python file in Django
I'm pretty new to Django and html. I want to import the following code in Django: import csv with open('FILE.csv', newline='') as csvfile: CSVFILE = list(csv.reader(csvfile)) df = pd.DataFrame(CSVFILE, columns= ['A','B','C','D']) while 1>0: select_color = df.loc[df['A'] == input()] print (select_color) What I want to achieve, is a webpage with a form, where you can fill in "A", which would thereafter display 'A','B','C','D'. What is the best way to treat this? -
Associating user id to courses that the user create
My django project basically allows users to create its own courses. So, I am trying to associate a user id to the courses that the user created so that it will display only the courses that the user has created when the user wanted to view all the courses that he/she has created. However, it returns an error saying "Cannot assign "1": "Course.user_id_id" must be a "User" instance.". I have been trying to find the solution for days & could not figure out. models.py class Users(models.Model): user=models.OneToOneField(User,on_delete=models.CASCADE) profile_pic= models.ImageField(upload_to='media/profile_pic',null=True,blank=True) address = models.CharField(max_length=40) mobile = models.CharField(max_length=20,null=False) Country = models.CharField(max_length=20,null=False, blank=True) Company = models.CharField(max_length=20,null=False, blank=True) City = models.CharField(max_length=20,null=False, blank=True) State = models.CharField(max_length=20,null=False, blank=True) Zip_Code = models.IntegerField(blank=True, default="1") Telephone = models.IntegerField(blank=True, default="1") Extension = models.CharField(max_length=20,null=False, blank=True) @property def get_name(self): return self.user.first_name+" "+self.user.last_name @property def get_id(self): return self.user.id def __str__(self): return self.user.first_name class Course(models.Model): CATEGORY = ( ('IT & Software', 'IT & Software'), ('Mathematics', 'Mathematics'), ('Science', 'Science'), ('English', 'English'), ('Bahasa Melayu', 'Bahasa Melayu'), ) LEVEL = ( ('Easy', 'Easy'), ('Intermediate', 'Intermediate'), ('Advanced', 'Advanced'), ) LANGUAGE = ( ('English', 'English'), ('Bahasa Malaysia', 'Bahasa Malaysia'), ('Chineese', 'Chineese'), ) CERTIFICATE = ( ('Yes', 'Yes'), ('No', 'No'), ) user_id_id = models.ForeignKey(User, on_delete = models.CASCADE) media = models.ImageField(upload_to = … -
Django Factory Boy object does not exist
I have an issue regarding factory boy using in the testing of my Lets assume I have this three models: Class Company(models.Model): name = str Class Domain(models.Model): company = ForeignKey(ref=Company) name = str created_at = datetime Class Record(models.Model): domain = ForeignKey(ref=Domain) name = str created_at = datetime CompanyFactory(factory.django.DjangoModelFactory): name = str DomainFactory(factory.django.DjangoModelFactory): company = factory.SubFactory(CompanyFactory) name = str created_at = datetime RecordFactory(factory.django.DjangoModelFactory): domain = factory.SubFactory(DomainFactory) name = str created_at = datetime Having this, when I'm testing the Record views, at the begginning of every view I check that the Domain object is, in fact, related to the Company object such as: try: domain = Domain.objects.get(domain=domain_id, company__id=company_id) except ObjectDoesNotExist: return Response( data={"message": "Domain isn't related to the company provided."}, status=status.HTTP_403_FORBIDDEN ) But this code always returns an ObjectDoesNotExist exception when I make the testing with pytest+factory-boy but when I do manual testing runs fine. Have you experienced something similar? What I'm missing here? Thanks in advance. -
Update plotly graph and text when button is clicked in django
I want to implement a graph manipulation using django. Specifically, I want to be able to update the graph when the update button is clicked, and display the current update count. The following is a simple view of the problem. Thank you. here is my source code If there is any missing information, please point it out. index.html <!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <!-- plotly JS Files --> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> <meta content='width=device-width, initial-scale=1.0, shrink-to-fit=no' name='viewport' /> </head> <body> <div id="update-num">0 update</div> <button type="submit" id="upadate-bt">update</button> <div class="graph" id="scatter-graph">{{ graph| safe }}</div> </body> </html> graphdata.py import numpy as np import plotly.graph_objects as go np.random.seed(2) N = 10 def get_graphdata(): x = np.random.rand(N) y = np.random.rand(N) return x, y def get_scatter_figure(): print('create figure') x, y = get_graphdata() fig = go.Figure() trace = go.Scatter(x=x, y=y, mode='markers') fig.add_trace(trace) fig.update_layout(title='graph title', width=500, height=500) fig.update_xaxes(title='x') fig.update_yaxes(title='y') trace.on_click(show_point) return fig def show_point(trace, points, selector): print('cliked point') views.py from xml.etree.ElementInclude import include from django.shortcuts import render from . import graphdata def index(request): fig = graphdata.get_scatter_figure() plot_fig = fig.to_html(fig, include_plotlyjs=False) return render(request, 'graph/index.html', {'graph':plot_fig}) -
How to Fetch and Publish the latest data and list data in django
I am currently working on django , Need some help how to achive my below goal I need to publish the latest data and list data in a web app . Below is the set of steps i followed Created the Model.py import datetime from statistics import mode from django.db import models Create your models here. class documents(models.Model): author= models.CharField(max_length=30) title=models.CharField(max_length=50) description=models.TextField() creation_date=models.DateTimeField() update_date=models.DateTimeField() View.py from django.shortcuts import render from django.views.generic.list import ListView from .models import documents # Create your views here. class documentlist(ListView): template_name='app/document_list.html' model=documents context_object_name='document' HTML snippet {% extends 'base.html' %} {% block title %} MY HOMEPAGE {% endblock %} {% block css %} <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> {% endblock %} {% block content %} <nav class=" navbar navbar-dark bg-primary"> <a class="navbar-brand mb-0 h1" href="#">MEDICARE</a> </nav> {% for d in document %} <td>{{d.title}}</td> {% endfor %} {% endblock %} How can we render both latest data and list of data from a model class in django?I am clear about rendering the list data using listview . can someone help in understanding how to display the latest data from the list to the listview.html Thanks,Sid -
How to create multiple pages if there were too many for one page?
I'm working on a django project trying to create a forum. Now when a certain number of objects (thread-previews) is reached on one page, I want a second (and then third page etc) page created and some of these objects should go to these next pages (page 2, then page 3 etc.) and the url for the second page should be something like "mysite.com/fourum/topic/2" and so on. And then there have to be some buttons to navigate to page 2, page 3 etc. This would be relevant code: gaming.html {% extends "forum/index.html" %} {% load static %} {% block title %} Gaming {% endblock %} {% block content %} <div class="main-container"> <h1 class="heading">Forum: Gaming</h1> {% for obj in object %} <div class="username">{{obj.username}}</div> <div class="date">{{obj.date}}</div> <div class="topic">{{obj.topic}}</div> <div class="title"><a class="link" href="{{obj.slug_titel}}">{{obj.title}}</a></div> <div class="content">{{obj.content}}</div> {% endfor %} </div> {% endblock %} views.py def gaming(request): obj = Threads.objects.filter(topic="gaming") context = { "object": obj, } return render(request, "forum/gaming.html", context) -
AssertionError: Class RegisterSerializer missing "Meta" attribute
I am getting this error "AssertionError: Class RegisterSerializer missing "Meta" attribute" when using Django Rest API. I did make all migrations but can't figure out how to fix this error. The /register part of this application is where I am getting the error. serializers.py from rest_framework import serializers from rest_framework.validators import UniqueValidator from rest_framework_jwt.serializers import User from .models import Movie class MovieSerializer(serializers.ModelSerializer): class Meta: model = Movie fields = ('pk', 'name', 'description', 'year', 'rating') class RegisterSerializer(serializers.ModelSerializer): email = serializers.EmailField( required=True, validators=[UniqueValidator(queryset=User.objects.all())] ) password = serializers.CharField(write_only=True, required=True, style={'input_type': 'password'}, validators=[validate_password]) password2 = serializers.CharField(write_only=True, style={'input_type': 'password'}, required=True) class Meta: model = User fields = ('username', 'password', 'password2', 'email', 'first_name', 'last_name') extra_kwargs = { 'first_name': {'required': True}, 'last_name': {'required': True} } def validate(self, attrs): if attrs['password'] != attrs['password2']: raise serializers.ValidationError({"password": "Password fields didn't match."}) return attrs def create(self, validated_data): user = User.objects.create( username=validated_data['username'], email=validated_data['email'], first_name=validated_data['first_name'], last_name=validated_data['last_name']) user.set_password(validated_data['password']) user.save() return user urls.py from django.contrib import admin from django.urls import path from django.conf.urls import url from rest_framework_jwt.views import obtain_jwt_token from api import views from api.views import RegisterView urlpatterns = [ path('admin/', admin.site.urls), path('auth/', obtain_jwt_token), path('', views.movie_list), url(r'^api/movies/$', views.movie_list), url(r'^api/movies/(?P<pk>[0-9]+)$', views.getMovie), path('register/', RegisterView.as_view(), name='auth_register'), ] models.py from django.db import models from django.utils import timezone # Create … -
AttributeError at /Addarticle/ 'bool' object has no attribute '_committed'
views.py from django.views.generic.edit import CreateView,UpdateView class ArticleCreatViews(CreateView): model = Article template_name = 'addpost.html' fields = '__all__'**strong text** urls.py from . import views path('Addarticle/', views.ArticleCreatViews.as_view(), name="add_post"), Model.py from django.db import models from django.urls import reverse from django.utils.text import slugify # Create your models here. class Article(models.Model): Title = models.CharField(max_length = 150) Article = models.TextField() slug = models.SlugField(unique=True,null=True) feature_img = models.ImageField(upload_to="images",default=True) Published_date = models.DateField(auto_now=True, auto_now_add=False) def __str__(self): return self.Title def get_absolute_url(self): return reverse('article_detail', kwargs={'slug': self.slug}) def get_absolute_url(self): return reverse('home', args=(str(self.id))) I am facing this AttributeError at /Addarticle/ 'bool' object has no attribute '_committed' How can I resolve this error -
I am not able to migrate mysql database
I connected two databases in my project PostgreSQL and MySQL. In MySQL, I have my all models in the models folder. So I want to migrate them that I can see tables in the MySQL database and put some data in it. When I run the migrate first then there is the table name called django_migrations is created. And whenever check my databases using MySQL Command Line then this is the only table I see. I don't know why I am not able to see my other tables. I want to know what am I doing wrong that my PMS database is not migrating. When I run python manage.py makemigrations pms then this is showing: Migrations for 'pms': pms\migrations\0001_initial.py - Create model Assignment - Create model BankAccount - Create model City - Create model Country - Create model House - Create model HouseOffering - Create model HouseOwnership - Create model Invoice - Create model InvoiceItem - Create model InvoiceParticipation - Create model InvoicePaymentParticipation - Create model Lease - Create model Locality - Create model Payment - Create model PaymentAdjustment - Create model PaymentBill - Create model PmsSubscription - Create model Society - Create model TenantRentPaymentBill - Create model User And …