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

pandas not works for django?

I saw the first rocket. from django.http import HttpResponse def index(request): return HttpResponse("Hello, world.") 'Hello, world.' it's ok! also 'python manage.py migrate' ok. But when I import pandas... (import only and no use.) from…
yoshitaka okada
  • 113
  • 1
  • 12
2
votes
1 answer

Google Cloud Platform to AWS migration [PostgreSQL 9.6]

I'm working on a Django (2.1) project that is hosted on Google Cloud Platform with a ~= 7GB size PostgreSQL (9.6) database. The documentation doesn't cover this specific version of PostgreSQL, so I'm stuck in the DMS endpoints configurations to…
2
votes
1 answer

How to Raise DoesNotExist - Django SoftDelete?

I have a Abstract Model SoftDelete like follow. class SoftDeleteManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(is_deleted=False) class SoftDeleteModel(models.Model): is_deleted =…
Hari
  • 1,545
  • 1
  • 22
  • 45
2
votes
1 answer

Convert ratings in stars in Django template

I'm working on a project using Python(3.7) and Django(2.1) in which I want to display an average rating returns from a view inside the Django template. Here's What I have tried so far: From models.py: class Gig(models.Model): CATEGORY_CHOICES =…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
2
votes
2 answers

Method Not Allowed: / (Django-Post Method)

When I submit the form, it says "Method Not Allowed: /" in the console.. Something like that: Method Not Allowed: / [17/Mar/2019 18:31:18] "POST / HTTP/1.1" 405 I'm using this on views.py file.. class UrlAccpt(View): …
suraj sharma
  • 415
  • 4
  • 14
2
votes
1 answer

Django override password_reset_subject.txt does not change subject

I created registration/password_reset_subject.txt to change the subject of my password reset email as suggested here. However, it does not take effect. The email subject remains Subject: Password reset on 127.0.0.1:8000
ohlr
  • 1,839
  • 1
  • 13
  • 29
2
votes
1 answer

Select2 4.0.5 common errors in Django admin

(Disclaimer: this is a self-answered question) I wanted to set up some Select2 to my form fields while in a Django admin panel (specifically in the change_list.html template). So I added the neccesary scripts to the page (not the full version), but…
RompePC
  • 815
  • 1
  • 8
  • 17
2
votes
1 answer

Unable to create instance of Django model

I'm trying to create an instance of this Report model: class Report(models.Model): """ A model for storing credit reports pulled from Equifax. """ user = models.ForeignKey(to=CustomUserModel, on_delete=models.CASCADE, …
Soviero
  • 1,774
  • 2
  • 13
  • 23
2
votes
0 answers

How to create custom ACL functionality in Django 2.x?

I want to create custom ACl functionality in Django2.x Acl project structure below: C->Company R->Role (superuser, admin, manager etc.) U->User C1->r1,r2,r3->u1,u2,u3,u4,u5 C2->r1,r2,r3->u6,u7,u8,u9,u10 C3->r1,r2,r3->u11,u12,u13,u15,u15 How can i…
2
votes
1 answer

How do I extend django's createsuperuser management command?

I extended my user model by adding a mandatory Company field, so that every user belongs to some company. The Company field is a foreign key to another model that defines what a company is. This works great, except for the fact that ./manage…
John
  • 2,551
  • 3
  • 30
  • 55
2
votes
2 answers

.env file in pipenv (django) - ValueError: embedded null character

I got a .env file inside my project SECRET_KEY="vvvvvvvtestvvvvv" I run pipenv shell But I get like a bunch of errors. PS S:\github\fozvi> pipenv shell Loading .env environment variables… Traceback (most recent call last): File…
Sharpless512
  • 3,062
  • 5
  • 35
  • 60
2
votes
0 answers

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet with Django’s user database authentication from Apache

I have created a django project with only one application. I haven't made any changes in the application. Only added the application to the settings and updated static and media urls. Migration is done and super user was created. I have configured…
Binoy
  • 79
  • 1
  • 2
  • 6
2
votes
2 answers

How to set settings.DEBUG == True only for superuser and False for all users

I am using Django 2.1 and my project is ready for production. Is there a way that i can set settings.DEBUG == True only for superuser and show a default 500 internal server error for normal users. I have tried to write a middleware, but it seems not…
Abhimanyu Singh
  • 369
  • 4
  • 20
2
votes
0 answers

DjangoRestFramework - URI with multiple items (cross between a list view and a detail view)

django 2.1, python 3.6. I have a list of items that could contain duplicates. When I pass it to the model and use the in filter, it removes the duplicates . Is there anyway to return a query set with each item in the list instead of each item in the…
Micah Pearce
  • 1,805
  • 3
  • 28
  • 61
2
votes
1 answer

IntegrityError in TestCase runs after updating to Django 2.0

I upgraded from Django 1.11 to Django 2.0 and my tests started failing. I have 7 TestCase classes and all use the setUpTestData provided by Django. When I run them all together one of them fails to set up because of an psycopg2.IntegrityError:…
Ysrninja
  • 129
  • 1
  • 2
  • 9
1 2
3
16 17