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
2
votes
1 answer

Connecting Vertica as Django backend

I want to connect Vertica as the database backend for my Django application. Officially no support is provided by Django to it. I googled this problem and found this: https://github.com/rutube/django_vertica_backend The code which is written in this…
Rishabh K Sharma
  • 239
  • 4
  • 15
1
vote
2 answers

How to calculate the difference of two values in a tag in another tag in HTML

I have a table in HTML which is rendered and it is like, {% for element in combined_list %} element.first element.second javascript
surya raj
  • 195
  • 13
1
vote
3 answers

Unable to access django app on other android devices on my hotspot network

I created the django app and hosted the same on my laptop which was connected to my android mobile hotspot. Then I got the IP of my machine, using ipconfig Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : Link-local IPv6 Address…
Himanshu Poddar
  • 7,112
  • 10
  • 47
  • 93
1
vote
1 answer

Local variable referenced before assignment - Django 2.1

I´ve been looking for ways to authenticate an user without password in Django, but that is not my doubt. I´ve seen this answer which has 24 upvotes. The answer says I have do that in my views.py: user =…
Antonio Sanchez
  • 381
  • 1
  • 3
  • 11
1
vote
1 answer

django-summernote is not editable on Django admin page

Currently I am trying to implement django-summernote to my Django project. I could pip-install it, set up the urls.py, setting.py, admin.py but it is not working properly on the admin page. If I go to the page, the information is displayed but it is…
taty
  • 11
  • 1
1
vote
0 answers

How to display image in modelformset_factory in Django

I have following model where Im using image field: from django.db import models class ActiveManager(models.Manager): def active(self): return self.filter(active=True) class Offer(models.Model): name =…
Rajat Jog
  • 197
  • 1
  • 10
1
vote
1 answer

email field not saving in admin site

When I try the following code in django 2.1 the email field is not saving in the admin site.only the username is saving.I can create emailfield in Custom form.So can anyone help me to sort out this problem. Thanks in advance views.py ''' from…
kanz
  • 11
  • 1
1
vote
1 answer

Error while switching the database from sqllite to postgre django

I changed the values of the DATABASE variable in the file settings.py to DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'password', …
baisbdhfug
  • 548
  • 1
  • 4
  • 14
1
vote
1 answer

Django 2.0.13 -> 2.1 upgrade causes std library function to not find module (AttributeError)

Upgrading Django 2.0.13 -> 2.1.0 (or greater) causes the following error when calling runserver, migrate etc. On Django 2.0.13 (and any lower) does not throw this error. Traceback (most recent call last): File…
Levi
  • 141
  • 1
  • 9
1
vote
1 answer

User Authentication always fails after upgrading django from 2.0.13 to 2.1.0, including manage.py changepassword

I have a website written in Django, and I recently upgraded from Django 1.11.28 to 2.2.12. Since the upgrade, all user authentication fails. There are no error messages displayed in the log; it is as if everyone's passwords have changed. The users…
1
vote
0 answers

"Method not Allowed" in Django 2.1

I'm trying to access a public API made with Django Rest Framework. It's working but, for a reason that I didn't find out yet, I get the following message on Apache error.log: HTTP Error 400: Bad Request and Method Not Allowed:…
1
vote
1 answer

How to prevent creating new object for existing ones when editing in inlineformset?

While editing a record in inline formset, after the submission new objects is created for existing ones also(duplicates). How to prevent that? I deleted the all objects in the model and reinserted it after checking is_valid(). Everything works…
Saran Prasad
  • 125
  • 2
  • 13
1
vote
1 answer

Get pk_id using function based view

I'm having a problem in getting the pk in my template. When I select a record it always returns the last pk ID. Btw, I'am using functional base view. Here's my collection.html:
{%…
N.Omugs
  • 321
  • 4
  • 17
1
vote
2 answers

Remove the selected option from the choice field in admin panel

I want to reduce the choice option in the admin panel if it is selected once. admin.py class MyModelForm(forms.ModelForm): LOC = [('op1', 'op1'), ('op2', 'op2'),...] location = forms.ChoiceField(choices=LOC) class…
pranjal0819
  • 270
  • 2
  • 17
1
vote
1 answer

HSTS and HTTPS settings Invalid

I set several settings as django document said, but i got two problem: SecurityMiddleware didn't work once SECURE_SSL_REDIRECT = True website will can't be visited SecurityMiddleware supposed to set Strict-Transport-Security: max-age=31536000;…
mark
  • 103
  • 9