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

Django many-to-many: Get a list of categories from a list of articles

For the sake of simplicity let's say I only have 3 models: Articles, Categories, Author. class Author(models.Model): name = models.CharField(max_length='100') ... class Categories(models.Model): name =…
Jackie
  • 307
  • 2
  • 14
1
vote
2 answers

NoReverseMatch error for combined form and model_formset

I have been trying to create a for that combines parent and child models using model_formsets by following use case three in this tutorial. Models class Shoppinglist(models.Model): name = models.CharField(max_length=50) description =…
RBDB_01
  • 15
  • 4
1
vote
2 answers

Django admin changelist - link to related model change page

Is there a built-in way to tell Django to show links to related models in changelist? If we have models School and Student, I want display School in Student changelist as a link to School object change page. I can do that old way: class…
Milano
  • 18,048
  • 37
  • 153
  • 353
1
vote
1 answer

get_object_or_404 returns get() missing 2 required positional arguments: 'self' and 'request'

When I call get_object_or_404() to get the object for my DetailView, I get the following error message: get() missing 2 required positional arguments: 'self' and 'request' I think I'm missing something conceptually that is preventing me from…
ecdnj
  • 21
  • 6
1
vote
1 answer

How to set path in app's urls.py to show localhost:8000/xxx(with django2.1.8)

I want to show topics.html through visiting localhost:8000/topics start a project named learning_log start an app namede learning_logs this is url.py in learning_logs(app) from django.urls import path from . import views urlpatterns=[ …
Eric2009
  • 23
  • 4
1
vote
0 answers

AttributeError: 'NoneType' object has no attribute 'split' during serving video file

I have read several questions similar to this. However, their problem was broken pipe, which is not applicable to my question. I would appreciate your help. I am trying to serve a video file in html template, using django. The model looks like this:…
Mohammed
  • 1,364
  • 5
  • 16
  • 32
1
vote
0 answers

How to show same message on each site page using middleware

I am new to django and programming. I'm trying to make an ecommerce web site and I am stuck on the custom middleware. I am trying set up a message which will appear on each page of site. I think the code is working because if I enter…
1
vote
0 answers

How to Load multiple Model to single template in Django 2

How to load multiple models in one template in Django 2? i've read Django Pass Multiple Models to one Template but, i'm lost in the answer and there is no specific answer there to get that view into the template, Im trying to pass 3 models in views…
1
vote
0 answers

User Registration: Creating user accounts Django 2.1.5

I'm having some trouble creating new accounts and then authenticating. I enter all the credentials in (username, password), and select "submit", and it successfully redirects me back to the 'account successfully created page'. However i can't find…
1
vote
1 answer

Accessing Lists in Django request.POST

I am having difficulty accessing all the data returned by my forms in my post function. I notice a significant discrepancy between what is displayed when I print request.POST vs. when my code accesses this data. Hopefully someone can explain this…
RyanM
  • 2,199
  • 2
  • 18
  • 25
1
vote
1 answer

TypeError: __init__() got multiple values for argument 'instance'

I was tring to keep ckeditor and markdown at same time in a edit/(add new post) in blog web backend, so i modifid __init__,after that,i can still open edit page .but,once I click save button, this error came out:TypeError: __init__() got multiple…
mark233
  • 21
  • 1
  • 4
1
vote
0 answers

django-widget-tweaks error while rendering in Django 2.1

While trying to use OSMField from django-osm-field and rending it with with django-widget-tweaks I am getting this error: File "/usr/local/lib/python3.7/site-packages/django/forms/boundfield.py", line 93, in as_widget …
ketimaBU
  • 901
  • 4
  • 15
  • 35
1
vote
1 answer

Use django-filters on multiple models

I'm trying to create a search capability in my Django project that will filter multiple models (currently 3) and return a value from the surveys model. It works for a single model and an additional model tied by a foreign key. But, when I added a…
Evan
  • 1,960
  • 4
  • 26
  • 54
1
vote
1 answer

Django - model mixin doesn't work as expected

In PipedriveSync model I use GenericForeignKey so any model can have PipedriveSync object related. class PipedriveSync(TimeStampedModel): ... content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id =…
Milano
  • 18,048
  • 37
  • 153
  • 353
1
vote
0 answers

Django - Signal.disconnect does not disconnect the signal

I can't figure out why disconnect of post_save signal does not work in my project. When I call PipedriveSync.objects.first().sync_with_pipedrive(), it does something and then tries to save some information to the object. Then, the…
Milano
  • 18,048
  • 37
  • 153
  • 353