Questions tagged [django-2.0]

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

Django 2.0 requires Python 3.4, 3.5, or 3.6. It is the first version of Django to support only Python 3.

Here are some of the salient features of Django 2.0:

Django 2.0 was released in December 2017 and was supported until April 2019.

423 questions
0
votes
1 answer

DRF - serializer drops nested serializers

TL;DR: DRF drops the inner serialized object when validating the outermost serializer. I'm using django 2.0, django-rest-framework 3.7.7, python 3. I want to build a REST endpoint that performs a search in the database, using some parameters…
Alberto Chiusole
  • 2,204
  • 2
  • 16
  • 26
0
votes
1 answer

Django calculate 2 values from model

Im fairly new to Django. Im using Django 2. My model: # Create your models here. class Trade(models.Model): quantity = models.IntegerField() open_price = models.FloatField() commision = models.FloatField() exchange_rate_usdsek =…
Sharpless512
  • 3,062
  • 5
  • 35
  • 60
0
votes
2 answers

AttributeError: type object 'BaseCommand' has no attribute 'option_list'

Hello i am trying to create search app in My Django project using Haystack and Solr but i receive this error "AttributeError: type object 'BaseCommand' has no attribute 'option_list'" I am running this command : python manage.py rebuild_index I am…
Ahmad M Ibrahim
  • 289
  • 1
  • 3
  • 9
0
votes
1 answer

Is Django-haystack 2.6.1 compatible with Django 2.0?

My question is simple (as per title). Is the current Django-haystack compatible with the newest Django 2.0? Is anyone using this combination? The requirements in the docs and at PYPI suggest that it…
geckon
  • 8,316
  • 4
  • 35
  • 59
0
votes
1 answer

NoReverseMatch at /blog/ Using Django 2

Hello guys I am receiving this error : This my main URL: urlpatterns = [ path('admin/', admin.site.urls), path('blog/',include('blog.urls',namespace='blog')), ] My blog/url.py: app_name = 'blog' urlpatterns = [ …
Ahmad M Ibrahim
  • 289
  • 1
  • 3
  • 9
0
votes
1 answer

Tango with Django 1.9 on Django 2.0 - "list indices must be integers or slices, not str"

I am, probably stupidly, attempting to go through Tango with Django 1.9 on newly released Django 2.0. I am up to chapter 6 and am getting the following error. The error pertains to my views.py file (below) with the lines, context_dict['pages'] =…
Jamie
  • 277
  • 4
  • 19
0
votes
2 answers

NOT NULL constraint failed: courses_course.owner_id

I'm creating a school, kinda, and I get NOT NULL constraint failed: courses_course.owner_id whenever I try to create a course via the URL http://127.0.0.1:8000/course/create/. Here are my files: models.py from django.db import models from…
Caspian
  • 633
  • 1
  • 10
  • 29
0
votes
0 answers

Changing URLs with multiple ids from Django 1 to Django 2

In Django 1x I can do URLs with two ids in the URL like this: url.py ('^profile/(?P[0-9]+)/env/(?P[0-9]+)/$', views.EnvironmentDetailView.as_view(), name='environment'), HTML template "{% url 'myapp:environment'…
ccsv
  • 8,188
  • 12
  • 53
  • 97
0
votes
0 answers

Django all-auth maybe does not support the latest django version 2.01. In that case, How i can use django all-auth into the latest django version

Django all-auth maybe does not support the latest Django version 2.01. In that case, How i can use Django all-auth into the latest django version. Any idea when they will launch the latest version of Django allauth. TIA
Shohan
  • 11
  • 1
  • 6
0
votes
0 answers

What is the proper regular expression for uid in base64 and token in Python?

In Django 2.0, I deal with uid and token for user email confirmation. 'uid': urlsafe_base64_encode(force_bytes(user.pk)), 'token': PasswordResetTokenGenerator().make_token(user), My urlpatterns is like below, however pattern is not…
namwoo
  • 89
  • 5
0
votes
2 answers

Python - Django 2.0 - URL patterns, passing arguments

I am writing a very basic web page in Python which has a text box where a user can type in a username, then hit the Ok button which submits a form using a GET request. The GET passes the username as an argument and searches the auth_user table in…
DManDev
  • 33
  • 1
  • 5
0
votes
1 answer

Recover GET parameter from PasswordResetConfirmView

I'm trying to recover a GET parameter from the Django template view django.contrib.auth.PasswordResetConfirmView. Basically when a user click on his password reset link (like…
E-Kami
  • 2,529
  • 5
  • 30
  • 50
0
votes
2 answers

I am missing something with Django's url paths

I have an app in django that has a webpage with buttons to travel to another page via a menu and 8 hrefs. When I travel to the first page and try to click on another, I will encounter a 404 error. Page not found…
Sleepy-Z
  • 83
  • 1
  • 12
0
votes
1 answer

Access to model field through connected one

I have two models class Category(models.Model): name = models.CharField("category", max_length=200, null=True) discount = models.PositiveIntegerField(null=True) class Product(models.Model): name = models.CharField("product",…
shmnff
  • 647
  • 2
  • 15
  • 31
0
votes
1 answer

Django: Retrieve POST argument from password reset email

I'm fairly new to django and I'm currently rewriting the django login views so I can move all the authentication process to a dedicated django app where I can redefine the templates. So currently I have an accounts app which url.py looks like…
E-Kami
  • 2,529
  • 5
  • 30
  • 50