Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to get form values in template before submit the form?
I created a form with Django. In this form I have a filefield. How can I find out if the user has filled in this field before the form is submitted? I want to pop up a warning screen if the file didn't load like "Are you sure?". How can I do that? This is an example form: <form method="post" enctype="multipart/form-data" > {% csrf_token %} {{ form|crispy }} <button type="submit" class="btn btn-warning">Submitbutton> </form> **model: ** class Pdf(models.Model): id = models.AutoField(primary_key=True) title = models.CharField(max_length=200) pdf = models.FileField(upload_to=customer_directory_path, null=True, blank=True) document_type = models.CharField(max_length=200, default='Select', choices=CHOICES) ... -
How to Display Category name of Product in Django?
I have a relation between category, subcategory, and sub-child category, and the product is related to the sub-child category, but I want to display the name of Category. Please let me know how I can do it. here is my models.py file... class Category(models.Model): name=models.CharField(max_length=225) slug=models.SlugField(max_length=225, unique=True) class SubCategory(models.Model): name=models.CharField(max_length=225) slug=models.SlugField(max_length=225, unique=True) category = models.ForeignKey('Category', related_name='subcategoryies', on_delete=models.CASCADE, blank=True, null=True) class SubChildCategory(models.Model): subcategory=models.ForeignKey(SubCategory, related_name='SubChildRelated', on_delete=models.CASCADE, default=None, verbose_name='Sub Category') name=models.CharField(max_length=50, default=None) slug=models.SlugField(unique=True, max_length=50) here is my product models.py file... class Product(models.Model): name=models.CharField(max_length=225) slug=models.SlugField(max_length=225, unique=True) subcategory=models.ManyToManyField(SubChildCategory, related_name='pro_subchild', verbose_name='Select Category') here is my views.py file... def home(request): allProds=[] catprods= Product.objects.values('subcategory__subcategory__category', 'slug') cats= {item["subcategory__subcategory__category"] for item in catprods} for cat in cats: prod=Product.objects.filter(subcategory__subcategory__category=cat) n = len(prod) nSlides = n // 10 + math.ceil((n / 10) - (n // 10)) allProds.append([prod, range(1, nSlides), nSlides]) return render(request, 'main/index.html',{'allProds':allProds} here is my index.html file... {% for product, range, nSlides in allProds %} <div class="section small_pt pb-0"> <div class="custom-container"> <div class="row"> <div class="col-xl-3 d-none d-xl-block"> <div class="sale-banner"> <a class="hover_effect1" href="javascript:void()"> <img src="{% static 'front/assets/images/shop_banner_img6.jpg' %}" alt="shop_banner_img6"> </a> </div> </div> <div class="col-xl-9"> <div class="row"> <div class="col-12"> <div class="heading_tab_header"> <div class="heading_s2"> <h4>{{product.subcategory.SubChildRelated.subcategoryies.name}}</h4> </div> <div class="view_all"> <a href="{{obj.cat_slug}}" class="text_default"><i class="linearicons-power"></i> <span>View All</span></a> </div> </div> </div> </div> <div class="row"> <div class="col-12"> <div class="tab_slider"> … -
My point annotation in Chart.js 3.3.2 won't render in my Django template. Making a realtime graph of temperature for my wood-fired pizza oven
The goal and problem: I'm having trouble getting an annotation to render in Chart.js. My project is a Django/Chart.js-run graph that shows the temperature of my wood fire pizza oven. I would like to see the temperature graphed over time and be able to submit a model form indicating when I have shut the door, and to have that annotated on the graph. Specific issue The issue is that I can't get the annotation to render on my graph, partly because I am unsure what x/y coordinate to put in. This can be seen in the const options variable in my index.html. In order, have attached my base.html, index.html, view.py, and forms.py. I also included a link to a screen shot of the graph so far and of my pizza oven in case you're curious. :P Versions I'm using Python 3.9.5, Chartjs 3.3.2, and Django 3.2.4. Would be grateful for some help! -Mike <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="styles.css"> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css" integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous"> <!--Chartjs CDN--> <!--<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.4/dist/Chart.min.js"></script>--> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <title>{% block title %}{% endblock %}</title> </head> <body> {% block content %} {% … -
How do I exclude values based on one model's queryset to in another model
I'm having two models, bike and BikeRentHistory. All I want to do is I want to search for the bikes which are available and not on rent on selected from_date, from_time, to_date, and to_time. I'm trying to filter all the bikes' IDs from the BikeRentHistory model which are on rent on the selected from date and time, to date and time and then excluding those IDs from the bike model so that I can get available bikes. Can anyone help me on how do I filter in this? models.py class bike(models.Model): BIKE_STATUS_CHOICES = [('A', 'Available'), ('R', 'On Rent')] operatorid = models.ForeignKey(Customer, on_delete=models.CASCADE, null=True, help_text='Enter operator id') bikename = models.CharField(max_length=50, help_text='Enter bike name', verbose_name='Name of Bike') brandname = models.CharField(max_length=50, help_text='Enter bike brand name', verbose_name='Brand Name') price_hr = models.IntegerField(help_text='Enter bike price per hour', verbose_name='Price Per Hour') price_day = models.IntegerField(help_text='Enter bike price per day', null=True, verbose_name='Price Per Day') registered_no = models.CharField(max_length=50, help_text='Enter bike registered number', verbose_name='Bike Registration Number') bike_image=models.ImageField(upload_to='bike_image', help_text='Add bike image', null=True) bike_manufactured_date=models.DateField(help_text='Add Manufactured date of bike') bikecolor = models.CharField(max_length=50, help_text='Enter bike color', verbose_name='Bike Color') bikestatus = models.CharField(choices=BIKE_STATUS_CHOICES, max_length=1, default='A', verbose_name='Select Bike Status') station_id = models.ForeignKey(Station, on_delete=models.CASCADE, verbose_name='Select Station Location') class BikeRentHistory(models.Model): customer = models.ForeignKey(Customer, on_delete=models.PROTECT, null=True, related_name='customer+') operator = models.ForeignKey(Customer, on_delete=models.PROTECT, … -
Django and Linux users
I'll send it through the translator, so I'm sorry for the mistakes ;) I have a webservice ( nginx gunicorn dhango). I connected django users and linux users using django_pam . Now I need to create a widget in the admin panel that will allow me to create new users. But the widget must also create a user in the operating system . The web service does not have a sudo. What should I do ? P.s. I can't get away from such a trick-the production of the authorities -
How to validate email before send mail and finding whether the mail send - django
I use - is_valid = validate_email(e) for validating email. It can detect if @ is not present or some more but not providing whether the email entered is active now. AND I used sendmail for sending email. I used try except block. Mail is sending but sometimes try code running and someother times except block is running. How to avoid this abnormal behaviour. -
Validating uploaded csv file with django forms
I've just created a simple admin template with such a form: class UploadProductForm(forms.Form): file = forms.FileField(widget=forms.FileInput(attrs={"accept": ".csv"})) Here is how it works: def open_upload_form(self, request): user = request.user if not user.is_superuser: return redirect(reverse("admin:index")) if request.method == "POST": form = UploadProductForm(request.POST, request.FILES) if form.is_valid(): self.generate_objects_from_csv(request.FILES["file"]) [...] else: form = UploadProductForm() context = {"form": form} [...] def generate_objects_from_csv(self, uploaded_file: InMemoryUploadedFile): dataframe = pd.read_csv(uploaded_file, index_col=0) df_records = dataframe.to_dict("records") model_instances = tuple(self.model(**record).to_mongo() for record in df_records) try: self.model._get_collection()\ .insert_many(model_instances, ordered=False) except BulkWriteError: pass Well... Users have a possibility to get the CSV's template to fill it but everyone knows that there's a possibility to change something - the column name or type or whatever and then they'll get a 500 error instead of the Django admin's error. Any ideas on how to make a validation? I would like to achieve this by using a self.model's clean() method or something similar. -
Allow HTML characters in Django Rest Framework serializers
I am returning HTML text from Django Rest Framework, but special characters are rewritten as "HTML safe" text. How do I prevent this behaviour? I know there is a mark_safe() function in Django, but that would require me to rewrite the serializer. Is there an easy way to do this offered by DRF? Here is my serializer: class MySerializer(serializers.ModelSerializer): class Meta: model = MyModel fields = ("html_text",) Note that the text is safe and only input by admins, not by end users. -
TemplateSyntaxError at GET in Django template
I'm working on Django template and setting Conditional branching whether there is a "query" or not. {% if {{ request.GET.query }} == "" %} <td><a href="/detail/{{item.id}}/{{item.item_hs6}}">detail</a></td> {% else %} <td><a href="/detail/{{item.id}}/{{item.item_hs6}}/{{ request.GET.query }}">detail</a></td> {% endif %} When I execute the above code, the error occurs here. Exception Type: TemplateSyntaxError Exception Value: Could not parse the remainder: '{{' from '{{' I know the code below is something wrong {% if {{ request.GET.query }} == "" %} How should I judge whether there is a query or not in Template? I just mentioned the above settings in this question but still if more code is required then tell me I'll update my question with that information. Thank you -
Why my form shows a blank date field to be filled manually, instead of providing me a calendar to choose a specific date?
I created a model which has two date fields. When I use the form in the admin panel, I get to choose the dates from the attached calendar, but when I render the same form on the web-page, it gives me a blank field. There is no calendar. Below are my codes: models.py: from django.db import models from django.core.validators import RegexValidator from django.db.models.deletion import CASCADE # Create your models here. class Diagnosis(models.Model): diagnosis=models.CharField(max_length=30, blank=True) class InitialData(models.Model): pattern = RegexValidator(r'RT\/[0-9]{4}\/[0-9]{2}\/[0-9]{4}', 'Enter RT Number properly!') pattern1 = RegexValidator(r'OOPL\/D\/00[0-9]', 'Enter Case Number properly!') case_number=models.CharField(max_length=10, primary_key=True, unique=True, validators=[pattern1], blank=True) date_of_admission=models.DateField(default=None) date_of_discharge=models.DateField(default=None) name=models.CharField(max_length=100, default=None) mr_uid=models.IntegerField(default=None) rt_number=models.CharField(max_length=15, blank=False, validators=[pattern], default=None) diagnosis=models.ForeignKey(Diagnosis, on_delete=CASCADE) forms.py: class TrackReportForm(ModelForm): class Meta: model=InitialData fields=('case_number', 'date_of_admission', 'date_of_discharge', 'name', 'mr_uid', 'rt_number', 'diagnosis') class DiagnosisForm(ModelForm): class Meta: model=Diagnosis fields=('diagnosis',) views.py: def initialview(request): if request.method=='POST': fm_diagnosis=DiagnosisForm(request.POST) fm_initialdata=TrackReportForm(request.POST) if fm_diagnosis.is_valid() and fm_initialdata.is_valid: diagnosis=fm_diagnosis.save() initial=fm_initialdata.save(False) initial.diagnosis=diagnosis initial.save() fm_diagnosis=DiagnosisForm() fm_initialdata=TrackReportForm() return render(request, 'account/database.html', {'form1':fm_diagnosis, 'form2':fm_initialdata}) else: fm_diagnosis=DiagnosisForm() fm_initialdata=TrackReportForm() return render(request, 'account/database.html', {'form1':fm_diagnosis, 'form2':fm_initialdata}) URLs: from account import views urlpatterns = [ path('admin/', admin.site.urls), path('data/', views.initialview), ] template: <body> <form action="" method="post" novalidate> {% csrf_token %} {{form1.as_p}} {{form2.as_p}} <button type="submit">Save</button> </form> </body> Any suggestions? -
django upload files using class based view
I am facing this problem when I try to upload files it doesn't work from the html page but from the admin panel it works. my model is: class contrat(models.Model): contrtID = models.CharField(max_length=25,unique=True) SHRPath = models.FileField(upload_to='contrats/') post_date = models.DateTimeField(default=timezone.now) author = models.ForeignKey(User,on_delete=models.CASCADE) def __str__(self): return self.contrtID def delete(self, *args, **kwargs): self.SHRPath.delete() super().delete(*args, **kwargs) def get_absolute_url(self): return reverse('Scheduling') class Meta: ordering = ('-post_date',) The form is: class contrat_F(forms.ModelForm): contrtID = forms.CharField(label='Code',max_length=25) class Meta: model= contrat fields=('contrtID','SHRPath') The Views.py is: class Contratadd(LoginRequiredMixin, CreateView): model = contrat template_name = 'Home/Scheduling/Add_contract.html' form_class= contrat_F def form_valid(self, form): form =contrat_F(request.POST, request.FILES) form.instance.author = self.request.user return super().form_valid(form) the urls.py is: path('Add_Contrat/', views.Contratadd.as_view(), name='Add_Contrat'), the page html code is: <form method="POST"> {% csrf_token %} <div class="border p-2 mb-3 mt-3 border-secondary"> <div class="form-row"> <div class="form-group col-md-12 mb-0"> {{ form.contrtID|as_crispy_field }} </div> <div class="form-row"> <div class="form-group col-md-12 mb-0"> {{form.SHRPath}} </div> </div> </div> <input class="btn btn-success mb-4" type="submit" value="ADD Contrat"> </form> THIS IS IN THE PAGE BUT IT DOESN'T UPLOAD THE FILE! where is my mistake please? -
Different number of columns needed for last page of paginated Django template
My question concerns needing to style the last page of a paginated Django template so that it displays as only one column if there are fewer than the maximum 6 entries on the page (the other pages of the template are displaying in two columns). I am using Django 3.1.7 I have a Django template that uses the following view: Django View: class SoundSeedView(generic.ListView): model = SoundFile fields = ['sound_file'] template_name = 'seed_history.html' paginate_by = 6 I am using two columns on my template as given below: CSS: #columns { columns: 2; } Django template: <h1>Sound file list</h1> <button id="comments-button" onclick="displayComments()">View Comments</button> <div id="blackbackground"> </div> <div class="container" id="columns"> {% for document in object_list%} <div id= "entryContainer"> <h2 id = 'ttitle'> {{ document.sound_file.name }} </h2> <p> Created on: {{ document.created_on}} </p> <div id = "nameTrunc"> <p> Created by: {{ document.user }} </p> </div> <div id="nc" class = "new-comments"> <audio controls class="thisAudio" id="player"> <source src="{{ document.sound_file.url }}"> </audio> {% if user.is_authenticated %} <a id = 'downloadbutton' class = 'dwnld-button' href="{{ document.sound_file.url }}" download >Download</a> {% endif %} <p class = "comments-text"> Comments: {{ document.comments }}</p> </div> </div> {% endfor %} </div> My problem is that if there are fewer than the maximum … -
running some codes after return response in python
My main question is how can i do something after return response. I have some codes like this : async def get(self, request): #do something here return Response(status=status.HTTP_200_OK) #do something after response... I used thread but it didn't work -
Django ReactJS: Pass array from JavaScript frontend to Django Python backend
I've made a website with Django and React JS. I'm trying to pass an array pict from my JavaScript frontend to Django, the Python backend. let pict = []; pictureEl.addEventListener(`click`, function () { console.log(`Take Pic`); pict += webcam.snap(); console.log(pict); }); pict is an array of images taken by the camera. How would I pass it to the backend? -
Configuring nginx to drop requests with no HTTP HOST header
The docs suggest that the following server block will drop all requests without a HTTP HOST header: server { listen 80; server_name ""; return 444; } However, when I make a request without a header, curl -I https://example.com/ -H "Host:" -v --http1.0 --insecure I'm getting an alert from Django, so it seems to be getting past nginx: Invalid HTTP_HOST header: '/run/gunicorn.sock:'. The domain name provided is not valid according to RFC 1034/1035. I've also tried to implement this solution, but still get the same results. I'm wondering whether this has something to do with the extra server blocks automatically created by Certbot. Stopping the emails from Django isn't my desired solution, I'd rather nginx drops these requests before they hit the app. The nginx config file is being read correctly, because I can add a return 444; to the main server block and it'll block everything. Here's the entire /etc/nginx/sites-available/<name> config, with attempts at both solutions included: server { listen 80; server_name ""; return 444; } server { server_name example.com; if ($host !~* ^(example.com)$ ) { return 444; } location / { include proxy_params; proxy_pass http://unix:/run/gunicorn.sock; } listen 443 ssl; # managed by Certbot ssl certificate /path/to/cert ssl_certificate_key /path_to_key include … -
Celery/Django worker detect when there are no jobs left
I have a Celery/Django worker connected via RabbitMQ to the server. When the worker finishes a job I want it to terminate if there are no jobs left - how can I achieve this? -
comment added by the logging in user didn't properly save
I have been currently working on an easy Django website. An error came up when I tried to implement a function that users can add comments to blogs. I succeeded to show the form where users can write their comments, but even if I pressed the add button, didn't save properly. I don't even know where I made a mistake coz I knew how to post and save information to the database. so, I ask you to help!! # add_comment.html {% extends 'base.html' %} {% block title %}|コメント追加{% endblock %} {% block content %} <div class="header-bar"> <a href="{% url 'blog' blog.id %}">&#8592; 戻る</a> </div> <div class="body-container blog"> <div class="body-header"> <h1>コメント追加</h1> </div> <form method="post"> {% csrf_token %} {{ form.as_p }} <button class='button' type="submit">追加</button> </form> </div> </div> {% endblock %} # views.py @login_required def add_comment(request, pk): blog = get_object_or_404(Blog, pk=pk) if request.method == 'post': form = CommentForm(request.POST) if form.is_valid(): comment = form.save(commit=False) comment.blog = blog comment.save() return redirect('blog', pk=blog.pk) else: form = CommentForm() context = { 'form': form, } return render(request, 'blog/add_comment.html', context) # urls.py from django.urls import path from . import views from .views import BlogCreate, BlogUpdate, BlogDelete, BlogList # blogs urlpatterns = [ path('', views.index, name='latest_blogs'), path('my_blogs/', views.my_blogs, name='my_blogs'), path('my_blogs/my_blog_search', … -
django configuration and conda error message
This error keeps showing up in my django configuration, and ends the server. I used the same config for the past year with django and conda, never had an issue and (as far as I know) I haven't made any change. Does anyone know what is going on here ? This error keeps showing up in my django configuration, and ends the server. I used the same config for the past year with django and conda, never had an issue and (as far as I know) I haven't made any change. Does anyone know what is going on here ? This is the error message I receive Traceback (most recent call last): File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute super().execute(*args, **options) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\core\management\base.py", line 369, in execute output = self.handle(*args, **options) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle self.run(**options) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run autoreload.run_with_reloader(self.inner_run, **options) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 599, in run_with_reloader start_django(reloader, main_func, *args, **kwargs) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 584, in start_django reloader.run(django_main_thread) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 299, in run self.run_loop() File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 305, in run_loop next(ticker) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 353, in tick self.notify_file_changed(filepath) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", line 328, in notify_file_changed trigger_reload(path) File "C:\Users\marcd\.conda\envs\mydjangoenv\lib\site-packages\django\utils\autoreload.py", … -
Confusion on choosing a language/framework, hosting provider and domain registrar to create a website for my Online Learning Platform
I have multiple questions on the same topic! I am thinking of making an online course website (a big project) with my friends by coding, for this, I have chosen Django as a backend (can suggest me other languages/frameworks). Before starting the project I want to finalize my plans, like which hosting provider to choose, what domain(.com, .net, or so on) to choose, after all, I have a low budget for this. My website will not have subdomains for the first 6 months, but according to my plans, I will add some sub-domains for forums and blogs. So for this, could anyone help me to choose a hosting provider and domain registrar? Hosting/domain Providers from Nepal would be more preferable as I am from Nepal, but will this even matter in choosing a hosting service? At least answer me: Which language/framework to choose Which hosting provider to choose What domain to choose -
how to develop a calendar feature through django rest framework? [closed]
I am working on a project to create timesheet for employees to fill their work hours. For that I need to show a calendar somewhere on a page. I have gone through videos where I got to know how to achieve the objective through Django. However, I am looking for a solution through Djangorestframework. I did come across a module called django-events-rest-framework, here is its pypi online document. I have tried using it through POSTMAN, but I do not think its the thing that I am looking for . Can somebody suggest please? Thank you. -
Django: Python check to see if a string contains only whitespaces not working using isspace method [closed]
I have many student profiles which are represented by a string. It was formed by the concatenation of various fields. However, if a student has not provided any detail, this string shall be having only whitespaces as I left spaces during fields when concatenating them together. I want to make a check first. I used the isspace method but it aint working Here is the code snippet: for id, profile in student_profiles: // it is giving me all the ids and profiles even if blank if not profile.isspace(): print(id) The output is like this: 3 I am an accomplished coder 6 7 8 JAVA SOFTWARE DEVELOPMENT ENGINEER 9 -
How to check if the file is uploaded to form in Javascript?
I created a form with Django. What I want is A warning popup appears when a user does not upload files to the system. I try to write a code bu it is not working. It works whether the file is uploaded or not. How can I fixed it? my code: <form method="post" enctype="multipart/form-data" > {% csrf_token %} {{ form|crispy }} <button type="submit" class="btn btn-warning" name="is-file" onclick="return confirm_submit()" id="isEmpty">Make Non-report Analysis</button> </form> ... <script type="text/javascript"> function confirm_submit() { var x = document.getElementById("isEmpty").value; window.alert(x) if (!x){ return confirm('are you sure?'); } } </script> forms.py class PdfForm(forms.ModelForm): class Meta: model = Pdf fields = ['title', 'pdf', 'document_type', 'year', 'payment_behavior'] labels = { "payment_behavior": "Please Select the Payment Behavior of the Customer: ", "document_type": "Document Type", "title": "Document Name", "pdf": "Please Select a File to Upload", "year": "Financial Table Year" } models.py class Pdf(models.Model): id = models.AutoField(primary_key=True) title = models.CharField(max_length=200) pdf = models.FileField(upload_to=customer_directory_path, null=True, blank=True) document_type = models.CharField(max_length=200, default='Select', choices=CHOICES) ... -
how to show calendar through django rest framework?
I am working on a project to create timesheet for employees to fill their work hours. For that I need to show a calendar somewhere on a page. I have gone through videos where I got to know how to achieve the objective through Django. However, I am looking for a solution through Djangorestframework. I did come across a module called django-events-rest-framework, here is its pypi online document. I have tried using it through POSTMAN, but I do not think its the thing that I am looking for . Can somebody suggest please? Thank you. -
django: issue navigating from one page to another
I'm trying to run a django project on my system. my landing page url is localhost/landing_page/ To navigate from landing_page to another_page, in the <landing_page>.html i'm using: <a href='xxx/another_page.html'> click here </a> it's getting redirected to 'localhost/landing_page/xxx/another_page.html' and throwing an error instead of getting redirected to 'localhost/xxx/another_page.html'. how do i direct it to 'localhost/xxx/another_page.html' ? -
Djongo fails to migrate contenttypes migrations
I am using djongo for MongoDB connection in my project. I have cleaned all previous migrations, deleted the sqlite database and made migrations for the app again. Here are all the migrations that need to be run python3 manage.py showmigrations admin [X] 0001_initial [X] 0002_logentry_remove_auto_add [X] 0003_logentry_add_action_flag_choices admin_interface [X] 0001_initial [X] 0002_add_related_modal [X] 0003_add_logo_color [X] 0004_rename_title_color [X] 0005_add_recent_actions_visible [X] 0006_bytes_to_str [X] 0007_add_favicon [X] 0008_change_related_modal_background_opacity_type [X] 0009_add_enviroment [X] 0010_add_localization [X] 0011_add_environment_options [X] 0012_update_verbose_names [X] 0013_add_related_modal_close_button [X] 0014_name_unique [X] 0015_add_language_chooser_active [X] 0016_add_language_chooser_display [X] 0017_change_list_filter_dropdown [X] 0018_theme_list_filter_sticky [X] 0019_add_form_sticky app [X] 0001_initial auth [X] 0001_initial [X] 0002_alter_permission_name_max_length [X] 0003_alter_user_email_max_length [X] 0004_alter_user_username_opts [X] 0005_alter_user_last_login_null [X] 0006_require_contenttypes_0002 [X] 0007_alter_validators_add_error_messages [X] 0008_alter_user_username_max_length [X] 0009_alter_user_last_name_max_length [X] 0010_alter_group_name_max_length [X] 0011_update_proxy_permissions [X] 0012_alter_user_first_name_max_length contenttypes [X] 0001_initial [X] 0002_remove_content_type_name sessions [X] 0001_initial It runs all migrations except the contenttypes migrations. Here is the output from python3 manage.py migrate Applying contenttypes.0001_initial...This version of djongo does not support "schema validation using CONSTRAINT" fully. Visit https://nesdis.github.io/djongo/support/ OK Applying auth.0001_initial...This version of djongo does not support "NULL, NOT NULL column validation check" fully. Visit https://nesdis.github.io/djongo/support/ This version of djongo does not support "schema validation using KEY" fully. Visit https://nesdis.github.io/djongo/support/ This version of djongo does not support "schema validation using REFERENCES" fully. Visit https://nesdis.github.io/djongo/support/ OK …