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
1
vote
1 answer

Django 3.1 serving static files on deployment

STATIC_ROOT = BASE_DIR / "static" STATIC_URL = '/static/' MEDIA_URL = '/images/' STATICFILES_DIRS = [] I have my static paths in settings.py file like this and it works fine on local machine but when i try to runserver on server it can't load…
tealy
  • 132
  • 1
  • 12
1
vote
1 answer

Django request.user not showing correct user in frontend

When user updates profile with username which is already in use ,message appear of "A user with that username already exists." but username on profile is changed to which user requested. for example: if user with username test001 update profile with…
1
vote
1 answer

Django renders a template that does not exist in specified directory

I have model 'Video' and I have a list view for this model, then in another app I'm trying to create a view 'UserVideosListView' that is viewable to the dedicated user. when I open the page in the browser before making any templates for this view…
Kurosh Ghanizadeh
  • 539
  • 1
  • 4
  • 16
1
vote
1 answer

How to get selected value in clean form?

I want to validate a field based on a seleted field. However when I put the prints on the form the select field appears as None (but in the view I can get the value without problems). models.py class NyModel1(models.Model): field1 =…
Beto
  • 579
  • 1
  • 5
  • 15
1
vote
1 answer

Django UpdateView Method Not Allowed (POST)

When I click "save" on the Update page (http://127.0.0.1:8000/account/15/update) I get [19/Mar/2021 13:47:18] "GET /account/15/update HTTP/1.1" 200 2311 Method Not Allowed (POST): /account/15/ Method Not Allowed: /account/15/ [19/Mar/2021 13:47:24]…
andyabel
  • 335
  • 4
  • 15
1
vote
3 answers

Django3 ValidationError does not display

I am trying to create user registration in Django but When I enter 2 wrong passwords I can't display a validation error message. Actually, I checked Django documents everything seems good. I just checked the original source and I couldn't find an…
berkay
  • 11
  • 2
1
vote
1 answer

Static images are not loading in django 3.1.7

I'm trying to display images in my web app but for some reason, it is not showing and giving a 404 error. I think in urls.py I added static correctly and even if change it to STATIC_ROOT still no sense. At the same time IDE not giving any error…
1
vote
0 answers

render() got an unexpected keyword argument 'renderer' - DateTimePicker - Django 1.11 -> 3.1 migration

I have the following issue with the form forms.py class PublicHolidayForm(forms.ModelForm): date = forms.DateField(label='Date', required=True, widget=DateTimePicker(options={"format": "YYYY-MM-DD"}),input_formats=["%Y-%m-%d"]) …
Axil
  • 3,606
  • 10
  • 62
  • 136
1
vote
0 answers

I need to access a foreign Key element for populating a ModelForm

I'm building a forum with comment and Reply capabilities. While populating the form I'm facing a issue of Cannot assign "": "Reply.comment" must be a "Comment" instance. I can understand the problem but don't know how to…
1
vote
1 answer

django-microsoft-auth : The provided value for the input parameter 'redirect_uri' is not valid

I am creating a Single Sign-On(SSO) with the help of Azure AD and Django. I am using Python==3.8 Django==3.1 django-microsoft-auth==2.4.0 I followed the tutorial on https://django-microsoft-auth.readthedocs.io/en/latest/usage.html but I am…
1
vote
1 answer

Url Pattern not matching in Routers | Django Restframewok

I have configured a viewset inheriting viewsets.ModelViewSet in views.py. And updated the urls.py to use Routers as follows router = DefaultRouter() router.register(r'snippets/', SnippetViewSet) urlpatterns = [ path('',…
Abhijith Konnayil
  • 4,067
  • 6
  • 23
  • 49
1
vote
1 answer

Django blog not displaying images

I followed this tutorial on adding images to my django blog (tutorial link: https://www.youtube.com/watch?v=ygzGr51dbsY&list=PLCC34OHNcOtr025c1kHSPrnP18YPB-NFi&index=26) But when I post a blog post the image doesn't get displayed But the image gets…
Rashaad
  • 77
  • 1
  • 11
1
vote
1 answer

What should I use Django Non-Global Middlewares or Django triggers

My problem is basically that I am currently making a customized management system based on Django(3.1) Python(v3.7.9) in which I am pulling the data from a third-party tool. The tool is not giving me the webhooks of every data that I want for…
1
vote
1 answer

How to add custom view in django adminlte?

I created an environment using pycharm & installed adminlte by git clone from https://github.com/app-generator/django-dashboard-adminlte.git. And installed adminlte3 , django3.1 & all requirements. Then run python manage.py runserver and registered…
Adithya
  • 1,687
  • 3
  • 19
  • 34
1
vote
1 answer

How to show the total count of online friends in the template (django)?

This is my user model- class CustomUser(AbstractUser): user_id = models.UUIDField(default=uuid.uuid4,editable=False,primary_key=True) username = models.CharField(max_length = 100,unique = True) friends =…
1 2
3
8 9