Questions tagged [django-2.2]

Django 2.2 is a version of the Django framework, released April 2019. It is a Long Term Support (LTS) release, and will be supported until at least April 2022. Please only use this tag if your question relates specifically to this version.

Django 2.2 works with Python 3.5, 3.6, 3.7, 3.8, and 3.9.

release notes

261 questions
0
votes
1 answer

Django 2.2 Time and Date Localization Specifics

I am learning Django's ways of doing internationalization and localization. To do so, I am following this tutorial: http://www.marinamele.com/taskbuster-django-tutorial/internationalization-localization-languages-time-zones The issue I have…
MadPhysicist
  • 5,401
  • 11
  • 42
  • 107
0
votes
1 answer

Exclude certain fields for the users who are superusers

I'm trying to make a custom User Model and have parameters like Date of Birth, current level and other such parameters. When I run python manage.py createsuperuser, it gives an error saying these values cannot be null. I don't want these parameters…
0
votes
0 answers

Django filter/update model form SQLite database is being ignored when passing a variable

I am trying to update the first name of the record with a user input value for id. If I hardcode the id, the change happens. But, if I pass the user input variable to it, it just ignores it. No errors, but no change. THIS CODE WORKS FINE: def…
0
votes
1 answer

Create personnel code in django profile model

I want to create unique Personnel code for my users. I should consider this pattern in this code: Code length : 7 digit. first char from left side: get from USER_TYPE : user_type_code The next two char: current year example- 19 for 2019: year_code…
rahnama7m
  • 865
  • 10
  • 38
0
votes
1 answer

Need to search user based on email and then deactivate his profile

I am trying to create a search form, Where admin can search users and then deactivate their profiles, if it is the right account. tried function based views and then class based views. It shows the profile in function based views but doesn't update…
0
votes
0 answers

django views loop not working in html template

I have created loop in views.py file then through dictionary . I have connected that loop in html file in django project. And it is not working. views.py def count(request): data= request.GET['fulltextarea'] text=data.split() …
0
votes
1 answer

Django Aggregation: How I can get Max value only?

First of all, I'm using Django 2.2 and Python 3.7 I have this in my models.py class Test(models.Model): session = models.IntegerField() x_pos = models.IntegerField() y_pos = models.IntegerField() What am trying to do is to get the max…
0
votes
1 answer

django 2.2 "user-defined aggregate's 'finalize' method raised error"

//Django 2.2.2 //sqlite3 I am passing various statistical values ​​to Django template with Django Aggregate. Avg, Count are working well. But Variance is not working and gives me OperationError. Traceback (most recent call last): File…
Miguel
  • 377
  • 1
  • 17
0
votes
1 answer

View not rendering template from POST

Got a simple Django app, for some reason GET renders template as expected, but POST with exactly the same code does not error but also does not render either: I've spent a lot of time looking for a reason for this and assume either I'm missing…
Zach Cleary
  • 458
  • 1
  • 4
  • 17
-1
votes
1 answer

Using related models with conditional expression

Goal: use a related model attribute as a filter inside a conditional expression for an annotation. I'm currently adding some functionality to an old Django app, this app has some design issues and i have nothing to do with it. After some research I…
-1
votes
1 answer

Getting TypeError: byte indices must be integers or slices, not str

I have a model table by the name of Branches which is to be filed automatically from the CSV file hosted online. But, I keep getting the error How I can resolve this? Thanks from django.db import models class Branches(models.Model): ifsc …
Manish Gupta
  • 31
  • 1
  • 5
-1
votes
1 answer

Conditional checks not working while processing form in Django

I have a ModelForm (EditGoalForm) which I use to edit an instance of a model (Goal). Some conditions must be met before saving form data. I used if statements to check these conditions and it still saves, instead of giving an error - like the if…
Caspian
  • 633
  • 1
  • 10
  • 29
-1
votes
1 answer

django 2.2.3-Django 404 error ('Page not found') after runserver

My project is named 'tweetme', and when I runserver I get this error. Using the URLconf defined in tweetme.urls, Django tried these URL patterns, in this order: ^admin/ ^static/(?P.*)$ The empty path didn't match any of…
G.DjaF
  • 1
  • 1
-1
votes
1 answer

How can i solve problem of playing video in django?

When i am writing the video tag in single html page with same video path then it works in browser and video is played. But when i work with django video is not played. Please help me out in this.
-1
votes
2 answers

Is it possible to register views to the django admin console like model.?

I tried to register the views in Django 2.2 admin interface, But I am not sure how to add it or can we able to add it.? When I tried I am getting the below error. admin.site.register(TargetView) File…
1 2 3
17
18