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
2
votes
2 answers

Django Migrations removing field

So I have a model in my Django project (for arguments sake called 'app'), for example; class ModelA(models.Model): fieldA = models.IntegerField(default=0) and I can run python manage.py makemigrations app; which gives me Migrations for 'app': …
cgt_mky
  • 196
  • 1
  • 2
  • 7
2
votes
1 answer

How to convert custom id field to normal integer field?

I am desperately trying to get along with Django migrations, please help! This is what I have: class ReceiptNumber(models.Model): id = models.AutoField(primary_key=True, unique=True) This is what I need: class ReceiptNumber(models.Model): …
2
votes
0 answers

cPickle.dumps of a django model object throws TypeError: can't pickle function objects

I am trying to pickle a django model object in django 1.11 and it is throwing an error - "TypeError: can't pickle function objects" I am using cPickle.dumps(obj) I understand we cannot pickle function objects. But same object when I try to pickle in…
mukul
  • 111
  • 8
2
votes
1 answer

Django 1.11 Template not rendering MultipleChoiceField correctly which is working with django 1.4

I'm trying to upgrade existing application from version 1.4 to 1.11. I have an issue where MultipleChoiceField is getting stored in database but template does not render those as being checked. models.py class TestModel(models.Model): test =…
bijalscm
  • 445
  • 3
  • 5
  • 14
1
vote
2 answers

Unable to install Django Version 1.11.22 with python 2.7 installed on windows 10

I have python 2.7 installed on my machine globally and the pip version is pip 20.3.4. I want to install Django version 1.11.22. When I am trying to do so with pip install Django==1.11.22, I am getting the error as mentioned in the picture. This is…
Adii_Mathur
  • 307
  • 2
  • 7
1
vote
1 answer

Hide all records in Django admin unless a search query is entered

We have a Python-2.7 and Django project (version 1.11) that has lots of models registered on it (Users app, Invitations app, Profiles app, etc...) First thing I'm trying to do is create a group for some users that will have only "View" permissions…
1
vote
1 answer

How to remove a content type in a migration in Django 1.11?

I have a model (let's name it Material) that was originally created in a monolithic app (let's call it A). In order to divide this monolith into separate apps according to the business domain logic, we created a model with the same name in a new app…
1
vote
1 answer

Django can't import app from apps' folder, ImportError

I have old project made on Django 1.11.10 and Python 2.7 Imports like below aren't working from apps.configuration.utils import HrefModel Traceback from apps.configuration.utils import HrefModel ImportError: No module named…
ysur67
  • 33
  • 2
  • 4
1
vote
0 answers

render() got an unexpected keyword argument 'renderer' - DateTimePicker - Django 1.11 -> 3.1 migration

I have the following issue with the form forms.py class PublicHolidayForm(forms.ModelForm): date = forms.DateField(label='Date', required=True, widget=DateTimePicker(options={"format": "YYYY-MM-DD"}),input_formats=["%Y-%m-%d"]) …
Axil
  • 3,606
  • 10
  • 62
  • 136
1
vote
1 answer

Django set default empty url

I'm trying to learn Django and I'm following Corey Shafer's tutorials (https://www.youtube.com/watch?v=a48xeeo5Vnk), but when I try to make two different pages, I get automatically directed to the one with an "empty address": In…
Santeau
  • 839
  • 3
  • 13
  • 23
1
vote
0 answers

Django API calls returning 404 error sometimes and many times as 200 ok . URL is present in the application

I am using DJango based API server calls. We had a URL in main project folder as urlpatterns = [ url(r'^api/', include('api.urls')), ] and then in project folder as urlpatterns = [ url(r'^widgets', views.index,…
1
vote
2 answers

Django Admin - Include field of a model A when adding a record of model B

I'm working on legacy code which is in Django (1.11) I have a model A, with attributes: Model_A: Name (NOT NULL) City (NOT NULL) FieldX (Nullable) - CharField And a model B, with attributes: Model_B: Name (NOT NULL) City (NOT NULL) …
Naman Chikara
  • 164
  • 14
1
vote
0 answers

Does django migration's AlterField cause issue if the constraint already exists in database?

I'm working on Django 1.11, Python 2.7 and Postgres 10.7. We have different environments dev and prod. And in one lower environment dev, the id column for a Model is not primary key. In the upper environment prod, it is made PrimaryKey. I'm not…
1
vote
0 answers

Unable to access instance variable by name in Django model

I am trying to save the value of a field in an instance variable on my Video model and then use this instance variable in a post_save signal receiver to see if the value of the field has changed. I am going off of this Stack Overflow…
t-payne
  • 3,514
  • 1
  • 6
  • 9
1
vote
2 answers

Django 1.11 - convert a datetime string with timezone 2018-01-01T00:00:00+03:00 into datetime object to be used for queryset

I am using Django 1.11 and Postgres 9.4. How can I convert this 2018-01-01T00:00:00+03:00 into a datetime object that can be used for queryset like below Tracking.objects.filter(created_at__gte=input_datetime) for Z time I can use…
Axil
  • 3,606
  • 10
  • 62
  • 136