Questions tagged [django-1.11]

Django 1.11 is a version of the Django framework, released April 2017. It is a Long Term Support (LTS) release, and will be supported until at least April 2020. Please only use this tag if your question relates specifically to this version.

Django 1.11 requires Python 3.4, 3.5, or 3.6. It is the last version of Django to support Python 2.

Here are some of the salient features of Django 1.11:

Django-1.11 was released in April 2017 as a long-term support release and will be supported until April 2020.

324 questions
1
vote
2 answers

importError: cannot import model name

I am upgrading my django application from django1.5 to django1.11. I know its a huge jump. So I am getting so many errors and try to get it fixed. This is my project structure. I think I have made mistakes in appconfig. I couldn't figure it…
Akhi
  • 221
  • 1
  • 3
  • 14
1
vote
1 answer

Django admin filter foreign key combobox

I'm a django beginner, so the code might be basic or wrong, but anyway... I have the following models: from django.db import models from django.conf import settings GRADE_CHOICES = ( ('1', '1'), ('2', '2'), ('3',…
1
vote
1 answer

Django 1.11 on passenger_wsgi not routing POST request

I'm trying to setup python on A2 shared hosting via passenger_wsgi. The app is working fine when I run it via 'runserver'. I tested this both in my local PC, and via SSH tunnel. However, when I try to set this up on passenger_wsgi, it can't seem…
Zen
  • 11
  • 3
1
vote
1 answer

How to compare float variable in django template?

Attendances is a list of float variables. Even when the value is less than 75, the first case is executed. I know that by default the django template see's a variable as a string. I know how to convert the variable to integer by making it {%…
Aasif Faizal
  • 19
  • 1
  • 7
1
vote
1 answer

Model missing all fields in Django Admin

I have a model with a bunch of fields, and after deploying to production, the django admin shows no fields for that specific model, like at all. I see the top title "Change MODELNAME", and the bottom toolbar with the save buttons. But when i click…
Moulde
  • 3,438
  • 4
  • 29
  • 38
1
vote
0 answers

Specify a select widget for a field in a formset

I am building a form which has a nested model formset for holding multiple addresses for a subscriber. I want to specify dropdown for region and city fields. So I added widgets property to the formset definition. AddressFormSet =…
Animesh
  • 4,926
  • 14
  • 68
  • 110
1
vote
2 answers

Unable to save related object

I have my models like this. class Subscriber(models.Model): skillset = models.TextField(verbose_name='Skill Set') slug = models.SlugField(unique=True, default='') class SoloDeveloper(models.Model): first_name =…
Animesh
  • 4,926
  • 14
  • 68
  • 110
1
vote
1 answer

creating user through admin panel password is not hashing

I have logged in to admin panel as superuser, I want to create new user through admin panel , After creating new user with raw password is not hashing in admin panel. Its showing raw password. How to hash the password while creating user through…
pbms
  • 586
  • 1
  • 10
  • 32
1
vote
2 answers

Custom save method for images/avatars in Django - how to use

So, I'm trying to do a little bit of compression of images as well as some other operations. I had a few questions...I have the following save() method for my user class: class User(AbstractBaseUser, PermissionsMixin): ... avatar =…
GCien
  • 2,221
  • 6
  • 30
  • 56
1
vote
1 answer

Django & algolia - conditional statements using hogan + {% verbatim %} tag

I'm hoping this isn't too obscure a question - I'm integrating the Algolia search platform into one of my projects to be able to search seamlessly and effortlessly yadda yadda. Essentially, I'm looking for a mixture of layouts for premium and low…
user7179686
1
vote
2 answers

Django accessing CHOICES = () from Model

Just wondering, I have the following model schema: class Location(models.Model): SERVICE_CHOICES = ( ('bus_station', 'Bus Station'), ('cafe', 'Café'), ('cinema', 'Cinema'), ('gardens', 'Public Gardens'), …
user7179686
1
vote
1 answer

url resolvers inside if statements Django

Just wondering what the correct syntax is for checking if the current path is equal to some url: {% if request.path == url "app_namespace:route_name" %} Above doesn't work - but hoping someone knows a way or method for doing this lookup...
GCien
  • 2,221
  • 6
  • 30
  • 56
1
vote
1 answer

Django Foreign Key select in admin dashboard

Not quite sure how to accomplish this. I have a Post model which references a foreign key to the Category model. class Post(models.Model): STATUS_CHOICES = ( ('draft', 'Draft'), ('published', 'Published'), ) title =…
GCien
  • 2,221
  • 6
  • 30
  • 56
1
vote
1 answer

Django: Intervention when raising errors when creating User via social authentication

I'm setting up social authentication with the package social-auth-app-django. I have the below ValueError raised when attempting to create a user when an email isn't supplied. users.py if not email: message = "Ooops, it doesn\'t look…
user7179686
1
vote
1 answer

Django: Cross referencing Model objects within a model - best practise?

I'm currently going around in a bit of a "QuerySet' object has no attribute '' <> app.models.DoesNotExist: Messages matching query does not exist loop. Essentially, I'm trying to define "last_activity" on a Room model that is referencing the time…
GCien
  • 2,221
  • 6
  • 30
  • 56