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

i am getting an error in django 2.0 Reverse for 'delete' with arguments '('',)' not found. 1 pattern(s) tried: ['delete\\/(?P[^/]+)\\/$']

template
urls.py path('delete//',views.delete,name='delete') views.py def delete(request,city_id): city = get_object_or_404(CityUser,pk=city_id) city.delete() …
Milan Mangar
  • 41
  • 1
  • 9
0
votes
1 answer

Django path() throws 404 when URL ends in Slash

Here is urls.py path('about/', about, name='about'), If I visit /about it gives 404 error, if if change it to path('about', about, name='about'), then if I visit /about works but /about/ gives 404 errors. What am I doing wrong here, this wasn't not…
Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
0
votes
3 answers

Using AppConfig to import signals is not working Django 2.08

I have an app companies. Inside the app there is a file called signals.py with the following code: post_save.connect(update_descendants, sender=Company) Inside companies apps.py I have: class CompaniesConfig(AppConfig): name =…
J Mo
  • 43
  • 6
0
votes
1 answer

unable to get display value of choice field using object.get_FOO_display in template

This is how my model looks like: class FacilityHoursOfOperation(models.Model): DAYS_OF_WEEK = ( (0, 'Monday'), (1, 'Tuesday'), (2, 'Wednesday'), (3, 'Thursday'), (4, 'Friday'), (5, 'Saturday'), …
Asdfg
  • 11,362
  • 24
  • 98
  • 175
0
votes
0 answers

link parameter shows up as HTML instead of just the value

When I construct the URL for a link with parameters, parameter value in link address shows up as HTML form instead of value. This is how I am generating the link in my template:
Asdfg
  • 11,362
  • 24
  • 98
  • 175
0
votes
1 answer

Django2.0 sending and receiving message frame-work

I am new at Django. What framework I can use to send or receive a message from one user to another. What is the framework that is easy to implement?
Riwaj Chalise
  • 637
  • 1
  • 13
  • 27
0
votes
1 answer

Using django-oauth-toolkit with Django 2.x

I've built a web application using django 2.0 and django-rest-framework. In my web app, I've been using django-rest-framework's SessionAuthentication. I'm in the early stages of building out a supporting mobile app and based on my findings so far,…
Daniel Long
  • 1,162
  • 14
  • 30
0
votes
1 answer

unable to display form inside modal dialog

I am having trouble displaying password change from inside modal window. I can see the modal window but I don't see the call happening to def change_password even though I have mentioned it in the action of my modal. Views.py def…
Asdfg
  • 11,362
  • 24
  • 98
  • 175
0
votes
0 answers

Django Model field reference ForeignKey.to_field not working

I'm trying to create a order model that is referencing the non primary-key field rfid of my user model. In order to do that I'm using a foreign-key relationship using the attribute to_field. My user model is inheriting from AbstractUser and I added…
alexanderdavide
  • 1,487
  • 3
  • 14
  • 22
0
votes
1 answer

how can I return to the previous page in Django 2

I'm Prety new in Django. I want to know how to return to the previous page from view to template without taking path or url.
Antu
  • 2,197
  • 3
  • 25
  • 40
0
votes
1 answer

Multiple optional URL arguments in Django 2+

I am trying to implement multiple URL patterns pointing to one Class Based View in my django 2+ app. My urls: path('', views.OfferDetailView.as_view(), name='show'), path('/', views.OfferDetailView.as_view(),…
dease
  • 2,975
  • 13
  • 39
  • 75
0
votes
1 answer

No reverse match error from django.contrib.auth.views.LoginView

This should be simple enough, but after spending multiple hours trying to figure this out, reviewing past code, and searching for answers online, I am out of ideas. Browser Error message: NoReverseMatch at /accounts/login/ Reverse for 'login' not…
0
votes
2 answers

Redirect to previous page after Sign up in view.py : Django 2

I build a signup and login page and I want that user after has been signed up or logged in redirect to the page that was been. this is my views.py : def signup(request): if request.method == 'POST': try: try: …
Ali Akhtari
  • 1,211
  • 2
  • 21
  • 42
0
votes
1 answer

How to make a queryset inside a queryset?

I wan't to make a parent-child app in django. So, let me explain how i want this to work. I got a view where all humans are shown (parents and children). I click on any of them, so it opens a different view, where all of the children and parents are…
0
votes
1 answer

Django 2 migrate error

I have problem with Django 2, the command was working fine but after that I got this Error: python manage.py migrate Traceback (most recent call last): File "manage.py", line 15, in execute_from_command_line(sys.argv) File…