Questions tagged [django-3.1]

Django 3.1 is a version of the Django framework, released in August 2020. Please only use this tag if your question relates specifically to this version.

Django 3.1 works with Python 3.6, 3.7, 3.8, and 3.9.

Here are some of the salient features of Django 3.1:

Django 3.1 was released in August 2020 and was supported until August 2022.

126 questions
0
votes
0 answers

Django ListView Multiple Pagination in Same Page

I was trying to make multiple pagination in the same page with out using any library. I followed this Multiple Pagination Method and successfully implemented it. However, one issue in this is say if I'm on page 3 on model_one, I click on next for…
Arpan
  • 124
  • 6
0
votes
1 answer

Access manyTomany field (Label) from category class via subclass(Products) Category-> Products -> Labels

Here is the code of my models file: from django.db import models # Create your models here. class Category(models.Model): name = models.CharField(max_length=255) def __str__(self): return self.name class Product(models.Model): …
Rajat Jog
  • 197
  • 1
  • 10
0
votes
1 answer

I am not able submit the form django

RuntimeError at /home You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/home/ (note the…
0
votes
1 answer

Page not found when trying to use Django url routing

So I've been trying to use django dynamic url routing but when I try to open the link, Django shows me that the page was not found (error 404). Here's my urls.py: from django.urls import path from pages.views import home_view, contact_view from…
0
votes
1 answer

how to add a method to a class template view

happy new year everyone...I am new to django and i am working on a project a resume page i need help with the contact me section, i want to do something i seen in a video https://www.youtube.com/watch?v=w4ilq6Zk-08. The book i used to learn only…
0
votes
2 answers

modules cannot load in a new Django project

I made 2 projects with django so far and everything smooth. using python 3.6 and conda env with django 3.1.4 I am following the tutorial to kick off my new project as I did for my previous one :…
0
votes
0 answers

Template loader not looking at directories defined in DIRS

I'm trying to add a base template for use in different apps in my Django project. I've created a base.html file at "myapp/templates/base.html" Here is the relevant info in my settings.py: BASE_DIR = Path(__file__).resolve().parent.parent TEMPLATES…
Jon-taib
  • 17
  • 5
0
votes
1 answer

can't do migration with AbstractBaseUser in django 3

I need to create multiple types of users with different permissions and hierarchy. All users are Employee, and there is an exploitation administrator type who is a kind of superuser, a Supervisor who has multiple Drivers under his control and there…
E.Mohammed
  • 163
  • 1
  • 4
  • 13
0
votes
1 answer

Django / MySQL / Python Programming Error ( 1064)

when I run python manage.py migrate I keep getting the following error. django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near…
0
votes
2 answers

Restricting the url parameter values in Django URL

I have a Django web app that has 2 types of users, say customers, and business. I need to get the type of user trying to login. So I defined a url pattern as folows: path('login//', LoginView.as_view(), name='login'), But how can I restrict…
Abhijith Konnayil
  • 4,067
  • 6
  • 23
  • 49
0
votes
1 answer

Django: How to add the last added date to a query set using ListView

I don't know how to create the queryset so that the last URLusage table entry is picked up for each URL in the RedirectURL table dateaccessed field and appends it to the query results similar to what I did with the num_links field. The end result…
David
  • 9
  • 1
  • 4
0
votes
1 answer

Problem with Django startproject: TypeError: '_sre.SRE_Match' object is not subscriptable

Trying to run django-admin startproject mysite and there occurs such problem Traceback (most recent call last): File "/Users/username/Desktop/test/venv/bin/django-admin", line 10, in sys.exit(execute_from_command_line()) File…
Mil
  • 1
0
votes
1 answer

How I create a cookie in Django to keep a view of a list using vanilla Javascript?

I have a Django view, where the user can choose between 2 different "views" of a list through a toggle button. The map view where a map is displayed with markers and some information and a list view where a list is displayed with the same…
0
votes
1 answer

Django -> Registering New User -> Check if the user is already authenticated by email and username

I have the following code in my register_view function. When I register a new user it updates in the database, but I want to check whether a user has already been authenticated by email or user. I have tried request.user.is_authenticated but this…
0
votes
1 answer

Django version 3.1.3 form not saving to model

I am following this tutorial I have gone back and written the code to match exactly. I have another form that works called category_add which is exactly the same as this form. But for the life of me I cannot figure out why bookmark_add doesn't…
Edwin Carra
  • 97
  • 1
  • 7
1 2 3
8 9