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

Run LiveServerTestCase from Docker Selenium with Django 1.11

Since Django 1.11, the option --liveserver was removed from the manage.py test command. I was using this option to allow the liveserver to be reach from the ip address of the machine rather than the localhost with the following command: ./manage.py…
VivienCormier
  • 1,133
  • 1
  • 11
  • 16
3
votes
2 answers

Django 1.11 - How can I ensure TruncYear to produce Zulu time

I am using Django 1.11 and Postgres 9.4. How can I ensure TruncYear to produce Zulu time (2019-10-01T00:00:00Z). I notice it creates datetime with timezone like this (2017-01-01T00:00:00+03:00) Here is my code for the TruncYear queryset: from…
Axil
  • 3,606
  • 10
  • 62
  • 136
3
votes
1 answer

Sending files as an attachment Django

I have created an XLS file and want to send it as an attachment to an email. The following code is working fine and I receive an email with the XLS file (status code is 200 OK). # This is working code import xlwt import StringIO import zipfile from…
Ersain
  • 1,466
  • 1
  • 9
  • 20
3
votes
0 answers

Empty Queryset when using a Polymorphic Model from django-polymorphic and querying against the proxy model

I am using the django-polymorphic package: https://pypi.org/project/django_polymorphic/ I was looking at the documentation for Proxy Models in the docs: https://docs.djangoproject.com/en/1.11/topics/db/models/#proxy-models Initial Setup - I tried…
Aero Chocolate
  • 1,477
  • 6
  • 23
  • 39
3
votes
1 answer

How to set username as ForeignKey in Django

How to set username as ForeignKey in Django module. is bellow method is correct? user = models.ForeignKey(User, db_column="user") i cannot use ID as ForeignKey because my old db have username as ForeignKey.(I need to migrate the the old Data)
Kombuwa
  • 1,613
  • 4
  • 20
  • 35
3
votes
2 answers

How to run python script inside django project?

I am unable to run python script inside my django project. I have create a directory with mkdir scripts Then I use touch scripts/__init__.py Then I create my python script using touch scripts/update_keyword.py here is the code of my script def…
Mr.Robot
  • 133
  • 2
  • 3
  • 10
3
votes
1 answer

How do I filter based on instance type when using Django-Polymorphic package?

I'm a bit stuck on having to create a Django query to filter based on instance type when using django-polymorphic. from polymorphic.models import PolymorphicModel class ClassA(models.Model): project = select2.fields.ForeignKey(Project,…
Aero Chocolate
  • 1,477
  • 6
  • 23
  • 39
3
votes
0 answers

Changing "choices" for children classes in Django-Polymorphic package

Is it possible to use django-polymorphic package and have a CharField in the parent class and change the "choices" depending on the children classes? Ex) class Shape(PolymorphicModel): name = models.CharField(max_length=255) status =…
Aero Chocolate
  • 1,477
  • 6
  • 23
  • 39
3
votes
2 answers

Celery tasks through view (Django) returned as pending, but okay via Terminal

This issue has been discussed before and looking over numerous posts, I am so far unable to find a solution to this problem. I'm new to celery so my learning curve is still fairly steep. Below my current scripts: myapp.__init__.py from __future__…
pymat
  • 1,090
  • 1
  • 23
  • 45
3
votes
1 answer

How to tell whether migrations are reversible?

In a project I'm working on, we run some tests against snapshots of production databases. For changes including migrations, I'd like to apply the migrations, run the tests, and the reverse the migrations. However, not all migrations are reversible.…
taleinat
  • 8,441
  • 1
  • 30
  • 44
3
votes
1 answer

Deletion by tab button doesn't work

Several DEVICE forms can be displayed on a page (Order), as tabs. When a user closes a tab and hits save, then renters that particular Order (ID), the user still sees his deleted tab. As a quick workaround, a checkbox was built into the html code…
pymat
  • 1,090
  • 1
  • 23
  • 45
3
votes
2 answers

Docker SMTP Server for Django Container SMTP backend

I am looking to have one of my django docker containers setup a smtp backend so I can send input from a contact form to a gmail address as well as possibly send out an email when someone puts in their email to subscribe for updates:…
user9588170
3
votes
2 answers

Prefix all table names Django 1.11

I have a database that cannot use multiple schemas due to some legacy software on it, and it needs to share space with a new Django application. Django's built-in tables names conflict with some of the existing ones, so I wanted to add a prefix to…
Chris Burrus
  • 187
  • 9
3
votes
1 answer

Add and initialize custom field in Django ModelForm

I feel like I am missing some very basic point, but can't solve this. Let's say I have model like this one: class Person(models.Model): first_name = models.CharField(max_length=256, blank=True) # this is weird field, but needed for my…
Photon Light
  • 757
  • 14
  • 26
3
votes
1 answer

Overwrite django view with custom context (Django 1.11, Viewflow)

I have a Django 1.11 project using Viewflow - https://github.com/viewflow/viewflow - that I've incorporated. It's been very helpful, but a lot of stuff is kind of "magic", and being my first serious Django project, I'm running into an issue I'm not…
Chris Burrus
  • 187
  • 9
1 2
3
21 22