Questions tagged [django-4.0]

Django 4.0 is a version of the Django framework, released in December 2021. Please only use this tag if your question relates specifically to this version.

Django 4.0 works with Python 3.8, 3.9, and 3.10.

Here are some of the salient features of Django 4.0:

Django 4.0 was released in December 2021 and was supported until April 2023.

88 questions
0
votes
1 answer

Get parents by filtering two date range in childs table with Django ORM

I have two tables with this informations: Room id room name 1 room 1 2 room 2 and a child table with this information: Reservation id room id (reserved_rooms) from date to…
Amirhossein Azhdari
  • 170
  • 1
  • 3
  • 20
0
votes
0 answers

Save django Models in different script and run that script with HTML button

I have model.py as class Fruit(models.Model): name = models.CharField(max_length=16) weight = models.IntegerField(max_length=16) color = models.CharField(max_length=16) class Veg(models.Model): name =…
0
votes
1 answer

django Model got an unexpected keyword argument 'auto_id'

I am trying to create a page with formset in it. So far I've gotten the following: forms.py class ContractorForm(forms.ModelForm): class Meta: model = Contractor fields = [ 'first_name', 'last_name', 'email',…
OMY
  • 402
  • 1
  • 8
  • 18
0
votes
1 answer

Django Reverse for ' ' with arguments '('',)' not found

I have a problem while using Django. I was trying to create a learning_log web application from my book and came across this error: NoReverseMatch at /edit_entry/8/ Reverse for 'topic' with arguments '('',)' not found. 1 pattern(s) tried:…
0
votes
2 answers

Class-Based View of 'User' model auto-authenticates user

I've made a class-based view (DetailView) of app user's profile and for some reason anyone who visits the view is automatically considered authenticated even without entering any credentials. This happens without adding any extra logic in neither…
0
votes
1 answer

When i am deploying on heroku i get Page not found (404)

When I go to the homepage, I get the following error: Page not found (404)`` Request Method: GET Request URL: https://blogapp85.herokuapp.com/ Using the URLconf defined in blog.urls, Django tried these URL patterns, in this…
0
votes
1 answer

URL issues with Django 4

I've been using Django since Django 1, and I've always used the same URL patterns (except when we switched from url to path). Now I'm having an issue with 404 errors. I'll give you my Project URLS, and App URLS, and you tell me what am I doing…
Kaiss B.
  • 249
  • 1
  • 12
0
votes
0 answers

TemplateSyntaxError at /blogapp/author/1/ Could not parse the remainder: '==user.username' from 'request.user==user.username'

what can we use inside {% %} ? Template error: In template C:\Users\SHAFQUET NAGHMI\blog\blogapp\templates\blogapp\authorview.html, error at line 7 Could not parse the remainder: '==user.username' from 'request.user==user.username' 1 : {% include…
0
votes
0 answers

Django template link with Django include

is it possible to open a html link form in a Django html include? So, I don't want the link in the html to open in the browser address bar so that it can be seen. So I was wondering if you can somehow open it in the same template. But that didn't…
0
votes
0 answers

Django password reset not sending mail

when i am resetting my password in django everything goes well but i am not getting any mail . urls.py path('password_reset/',auth_views.PasswordResetView.as_view(success_url=reverse_lazy('blogapp:password_reset_done')),name='password_reset'), …
0
votes
1 answer

Django 4.0.1 cannot import name 'SortedDict' from 'django.utils.datastructures'

My project isn't working! I need help! I'm just fill in the forms. And click login button. Error: Traceback (most recent call last): File "/home/pc/.local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner …
Nurjalol N
  • 21
  • 1
  • 8
0
votes
0 answers

django 4 recent issue

Django has recently released a new version and I'm trying to work with it. But the problem that I have is that one I say pip install Django no matter in the cmd or visual studio's cmd, it installs Django 4.0, but once I put the file in the code…
0
votes
0 answers

Forms dont populate with data on edit with Django 4

I have make an override on my User class, i have add fields. I have make a template for update the fields of the User class. But the problem is i have only some fields having a data. "Firstname, Lastname" This is my views for editing an user: # Vue…
Créatux
  • 9
  • 5
0
votes
1 answer

How to serialize an already existing image to save in a models.ImageField param?

I want to create Note object which one of the fields of the model is an ImageField using Django Rest Framework. I can already create objects and update all different fields using my API, except for images. My code: models.py class Note(OwnedModel): …
Manuhito
  • 45
  • 8
0
votes
0 answers

Why pip not installing latest ersion of django

I tried to install django4.0.1 in ubuntu20.14 with virtual environment. pip install Django==4.0.1 It showing error as No matching distribution found for Django==4.0.1 Previously in the same OS django4.0.1 was installed, but why its not installing…
krocks
  • 25
  • 1
  • 6