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
2 answers

Customizing Django 2 authentication and authorisation system

I am trying something that I believe must be so simple but nothing has worked. I have added the auth by adding into my urls.py: path('accounts/', include('django.contrib.auth.urls'), {'template_name': 'login.html', 'authentication_form':…
Manza
  • 2,109
  • 1
  • 27
  • 34
0
votes
1 answer

Django minimal queryset of last objects where exactly n records meets condition

I have a model Invoice: class Invoice(Model): datetime = DateTimeField(..) paid = BooleanField(..) I want to get queryset of n latest Invoices where paid = True but I want to include paid = False Invoices if there are some between n latest…
Milano
  • 18,048
  • 37
  • 153
  • 353
0
votes
2 answers

TemplateDoesNotExist at /music/1/favourite/ music/details.html

I am new to Django and i am using it's version 2.0.7. I have already created template named as details.html but it's still not showing The video tutorial which i am referring is…
0
votes
2 answers

Exception Type: ValueError at /music/1/favourite/ Exception Value: invalid literal for int() with base 10: 'on'

I am new to Django and I am using it's latest version 2. I am referring to this particular tutorial https://www.youtube.com/watch?v=irH98-4eKmQ&list=PL6gx4Cwl9DGBlmzzFcLgDhKTTfNLfX1IK&index=24 I am getting this error. I tried a lot but couldn't fix…
0
votes
1 answer

Django2 forms nothing happend when submit post article

I have forms to Post Article in my blog Django2. When I run django server there is no error, but when I Post and submit Article in my frontEnd apps nothing happens and doesn't save any data. Any help on this would be highly appreciated! Template…
0
votes
0 answers

Django 2.0 and decorator_include - problems with reverse urls

I use django 2.0.7 in my project with django-decorator-include app (version 2.0). My urls.py: from django.conf import settings from django.contrib import admin from django.urls import path, re_path, include from django.conf.urls.static import…
dease
  • 2,975
  • 13
  • 39
  • 75
0
votes
1 answer

How to add user authentication in generic delete view in django2.0.6

I have a page which displays posts of all user and user can only delete his posts. Heres the code: class PostDelete(generic.DeleteView): model = Post template_name = 'dashboard/post_delete.html' success_url =…
manjy
  • 109
  • 1
  • 2
  • 12
0
votes
1 answer

Custom serializer with django 2

I would like to create a serializer that given an input JSON object select certain attributes. There is an legacy system that sends an object, for example: { "a": { "b": "test" } } I need to keep certain properties of the object.…
Diego
  • 304
  • 1
  • 8
0
votes
1 answer

Field from database showing up as the word "None" on frontend template but exist in the database

I've encountered the weirdest thing while developing a django-python web app. I have a field in my database that I want to display on the frontend. The field is a MultiSelectField and the list is populated from a list models.py # Other service…
0
votes
1 answer

how do I allow django admin user to make money transfer which will deduct the sender account and credit the receiver account?

I have two tables -one for bank accounts and the other for transactions. When a user makes a transaction( transfers money from his/her own account to another account): first I save the sender's account number, the receiver's account number, the…
0
votes
1 answer

django - return clear (empty) image

I want to clear the image from a profile model instance. I'm trying to accomplish this in the clean data function. The function works to resize the image but when I submit the form with 'clear' checkbox checked the picture is still there. class…
Mint
  • 1,013
  • 1
  • 12
  • 29
0
votes
1 answer

How to fix the field error issue in django?

I try to navigate from list page to detail page, when i tried with the below code. I got error stating that field error. For that I've tried with adding a empty Slug field in models, it shows an page not found error. #urls.py from django.urls…
0
votes
0 answers

How I can post my four kind of post with prioritizing it.

I'm working on a project, using Django 2.06. I have four model to maintain four kinds of posts from users and have to show it on one page. class QuickWordView(ListView): template_name = "index.html" queryset = QuickWord.objects.all() …
Shohan
  • 11
  • 1
  • 6
0
votes
1 answer

How can I code the query set in order that the users can see only their own post in profile section

I'm working on a project by using Django 2.06. I have multiple users and they can post and other people can read their post which is very normal. At the user profile page User should see their own post. this is where I'm stuck, How i can code the…
Shohan
  • 11
  • 1
  • 6
0
votes
1 answer

Django returning bad help text in my signup page

As you can see the help text is not being rendered as UL instead its just plain text Here is my code Forms.py: class CustomUserCreationForm(UserCreationForm): class Meta(UserCreationForm.Meta): model = CustomUser now =…
manjy
  • 109
  • 1
  • 2
  • 12