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

admin specific app in django

I'm using Django 1.11 I want to create an admin specific app which is only accessible by admin interface. I want to create an app to add country and state records which can be added or edited only by Admin from /admin. Also, these records can be…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
2 answers

Unit test in Django dont see correct redirect url for successfull login?

In my Django project I create custom admin page (NOT admin from Django). I have 2 login pages. One for admin, second for other users. Here below you can see urls.py file for admin. I test it and it works fine. After successful login Django redirect…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
2 answers

Django - Time aggregates of DatetimeField across queryset

(using django 1.11.2, python 2.7.10, mysql 5.7.18) If we imagine a simple model: class Event(models.Model): happened_datetime = DateTimeField() value = IntegerField() What would be the most elegant (and quickest) way to run something…
Hal
  • 537
  • 4
  • 13
1
vote
1 answer

Create a separate user type

I am working on an intranet web application which needs two types of users. Normal users that can be setup from django admin and specific type of users - Employees. I have the following model for Employee type user. class Employee(models.Model): …
Animesh
  • 4,926
  • 14
  • 68
  • 110
1
vote
3 answers

POST method of FormView in Django?

Edit: just used a new listing for when user submits the user to search on though I am not sure how to get what user was submitted still in my QueryUser class (the id of 24 is just a test, oh and I tried to add pagination but ripped it out because it…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
1 answer

Django manage.py command hangs

What worked perfectly normally before, has just given up on me. When using any type of manage.py command like below, I see Performing system checks... python manage.py runserver or python manage.py makemigrations After about a 30-60 seconds of…
pymat
  • 1,090
  • 1
  • 23
  • 45
1
vote
2 answers

How use gettext in JS code correctly?

In my Django project I have JS file with text with I need to translate. I use next code below. With the help of makemessages and compilemessages commands I created djangojs.po and djangojs.mo files. The problem is JS code dont work correctly after…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
1
vote
1 answer

Is Django multiple unique_together wrongly mapped in PostgreSQL?

When I add multiple unique_together tuples in my django model, the PostgreSQL DB mapping appears wrong (also according to a previous SO answer on the subject). An example follows. This is my migration: migrations.CreateModel( …
clapas
  • 1,768
  • 3
  • 16
  • 29
1
vote
1 answer

upgrade Django to 1.11 - formset changes

I have problem with my app. After upgrading Django to latest version - 1.11.4, I am getting the same error for three of my tests. AssertionError: False is not true : The formset 'formset' in context 0 does not contain the non-form error 'Musi być…
Grzegorz Redlicki
  • 269
  • 1
  • 6
  • 15
1
vote
2 answers

Django ModelForm ManyToManyField initial value

I'm using Django 1.11.2 to develop a website. I use ModelForms to edit my model instances on my website. Every field of the form gets the fitting value of the instance I want to edit via 'initial' in my view. It works fine for all fields except…
Nkls155
  • 273
  • 1
  • 4
  • 13
1
vote
2 answers

Django send welcome email after User created using signals

I have a create_user_profile signal and I'd like to use same signal to send a welcome email to the user. This is what I wrote so far in my signals.py: @receiver(post_save, sender=User) def update_user_profile(sender, instance, created, **kwargs): …
davideghz
  • 3,596
  • 5
  • 26
  • 50
1
vote
1 answer

MultiValueField does not work with ModelChoiceField

The code: (where AddressInput is a MultiWidget) class AddressInput(widgets.MultiWidget): def __init__(self, attrs=None): self.widgets = widgets.HiddenInput(attrs), widgets.TextInput(attrs) # note that the second widget would be…
Adam
  • 1,724
  • 4
  • 21
  • 31
1
vote
1 answer

Django, Pillow, NotImplementedError - absolute paths

I'm uploading a user avatar to S3 after resizing. My ModelForm is as follow: class UserAvatarForm(forms.ModelForm): x = forms.FloatField(widget=forms.HiddenInput()) y = forms.FloatField(widget=forms.HiddenInput()) width =…
davideghz
  • 3,596
  • 5
  • 26
  • 50
1
vote
1 answer

django-tables2 LinkColumn show Date correctly

I'm currently working on a project using Django 1.11.2 with django-tables2. I use a table to display my model. The model has a DateTimeField, which is displayed correctly in a normal column but when I use a LinkColumn with this DateTimeField, the…
Nkls155
  • 273
  • 1
  • 4
  • 13
1
vote
2 answers

Is it safe to grant "auth | User | Can change user" permissions without the "is staff" flag?

I need certain users to edit django.contrib.auth.models.User objects. My first thought was to grant them the auth | User | Can change user permission and flag them as is staff, so they can log into the Django Admin site. The problem is though, that…
Daniel
  • 3,092
  • 3
  • 32
  • 49