Questions tagged [django-2.1]

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

Django 2.1 works with Python 3.5, 3.6, and 3.7. Django 2.0 is thus the last version that worked with Python 3.4.

release notes

245 questions
4
votes
1 answer

Django rest framework cache response in list method based on query_params

I am using django rest framework to model api views. I have an API ModelViewSet class which has two action methods: list() and retrieve() retrieve() method example: @method_decorator(never_cache) def retrieve(self, request, *args, **kwargs): #…
4
votes
4 answers

NoReverseMatch at /accounts/password_reset/

I'm working on authentication for a Django project I'm working on. For some reasons, I'm getting the error Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid view function or pattern name. I put everything…
Caspian
  • 633
  • 1
  • 10
  • 29
4
votes
2 answers

template_name in LogoutView not working on django2.1 python3.7

Below is default setting in django.contrib.auth.views.LogoutViews, template_name = 'registration/logged_out.html' i configurate my app's urls.py like this: from django.urls import path from . import views from django.conf import settings from…
Leon Li
  • 95
  • 1
  • 7
3
votes
2 answers

ModuleNotFoundError: No module named 'polls'

I am following the official Django tutorial on https://docs.djangoproject.com/en/2.2/intro/tutorial01/ but somehow I am not able to run the server as I have created the polls app and added the required urls. When I use the command "py…
BlockeeR
  • 221
  • 1
  • 4
  • 16
3
votes
3 answers

Django check_password() always returning False

I have an existing database that is used with NodeJs application, now same database will be used for new application that is built with Django. I have an user_account table, which stores user login credentials, and for password encryption bcrypt…
Khurshid
  • 458
  • 1
  • 5
  • 20
3
votes
2 answers

how to save foreign keys using django-rest-framework

I'm new to Django and I'm trying to save Unit and current_user foreign keys in the database based pk obtained but every time I try doing so but run into two types of error serializers.is_valid() raises an exception error or the serializer returns…
toel
  • 155
  • 2
  • 15
3
votes
5 answers

Django Rest Framework Custom Permission's Message Not Shown

I'm writing an application with the Django Rest Framework. I created a custom permission. I provided a message attribute to the custom permission, but still the default detail gets returned. Let me give you my code. permissions.py: from…
3
votes
1 answer

Django unique together constrain with relations

I'm writing a REST API using Django and Django Rest Framework. I'm currently writing the models. I have a model for students, a model for questions and a model for answers. class Question(models.Model): question_text = models.CharField() class…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
3
votes
1 answer

How to include DRF 3.8 router url patterns in Django 2.1

from app_listing import views from django.urls import path, include from rest_framework import routers router = routers.DefaultRouter() router.register(r'category', views.CategoryViewSet) urlpatterns = [ path('api/',…
Milan
  • 434
  • 1
  • 4
  • 9
3
votes
1 answer

Object_list does not show correct data in template

I've a strange problem in Django template. It is a template for show a list of the articles and for everyone of they I show a list of keyword that I've called key concepts. The stranger thing is that instead of a list of key concepts it is shown a…
MaxDragonheart
  • 1,117
  • 13
  • 34
3
votes
1 answer

Adding command arguments to the Django runserver command and handle() method setup for local secure HTTP server

I'll keep this as vague as possible - as it's quite a broad question. I'm building a payment system within my Django project - and it would be amazing to be able to run my project over a secure server connections. And now were moving into a more…
user10261970
3
votes
2 answers

Saving Nested data in using django serializer class

I have a json data to save to a django model. When i try to save it, i get all sorts of errors and i have tried to work around it, all to no avail. Please help me i am new to django rest framework. This are the models i am inserting into: class…
3
votes
2 answers

Django 2.1 SQL Server 17 error - isn't an available database backend. Try using 'django.db.backends.XXX'

django.core.exceptions.ImproperlyConfigured: 'django-pyodbc-azure' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', 'postgresql', 'sqlite3' I have tried switching to the following…
2
votes
2 answers

Cannot resolve keyword 'model' into field. Django filters

I tried to rewrite filters, written on Django 1.1 to 2.1 I have a complex model, called Apartment that includes a Location model. Location includes the District model. So, there my models code: class District(models.Model): district_number =…
2
votes
1 answer

Django-Bootstrap4 Javascript, Jquery, CSS not working properly

I'm trying to use the django-boostrap4 in my project, so I did the following: My home_base.html {% load static %} {% load bootstrap4 %} {% block head %}
C. S. F. Junior
  • 341
  • 1
  • 3
  • 20
1
2
3
16 17