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
1 answer

Possible Bug on Django 1.11 with multitable Inheritance or possible bug on python 3.5 or am i?

Using python 3.5.2 and django 1.11 multitable inheritance like this: class Artist(ArtistParent): biography = models.CharField(max_length=255, blank=True, null=True) avatar = models.ImageField(null=True, blank=True,…
alacret
  • 572
  • 4
  • 19
1
vote
2 answers

Django - Rebuild a project database

For some reasons, I droped my database by using MYSQL command DROP DATABASE. I use Python3.6 and Django 1.11 with MySQL database. So now, how am I supposed to rebuid my database/tables following my models.py ? I simply used makemigrations but I have…
user6089877
1
vote
1 answer

Django admin fails with bootstraps "danger" class?

In my django admin, error messages (using the messages framework) are created with danger class. However the message looks green with an approval sign over it: When looking into admin/css/base.css, it looks like the error class is error and not…
iTayb
  • 12,373
  • 24
  • 81
  • 135
1
vote
2 answers

Django built in request library?

I know untill a couple years ago Django did not have one, as there are several questions here regarding this topic but they are all atleast two years old How to send a POST request using django? They mostly recommend to use python-request or…
Mojimi
  • 2,561
  • 9
  • 52
  • 116
0
votes
1 answer

Django 1.11 Annotate subquery with .exclude or ~Q() does not work

Is it not possible to exclude inside a queryset? I always receive this error: ValueError: This queryset contains a reference to an outer query and may only be used in a subquery. The part of the code I am wondering why is it not working: def…
Forged
  • 61
  • 7
0
votes
1 answer

"Django-filter" Is it possible to use FilterClass(FilterSet) MultipleChoiceFilter within ViewSet methods? Django 1.11, Python 2.7

I have my class ClassFilter(FilterSet) with some of the Filters fx. MultipleChoiceFilter, ModelMultipleChoiceFilter etc. in it: class ClassFilter(FilterSet): something_severity = MultipleChoiceFilter(choices=Something.SEVERITY_CHOICES,…
0
votes
0 answers

Why does command prompt throws" Syntax Error: Generator expression must be parenthesized " while creating a Django App named Authentication?

I am new to Django and was trying to make a Django project inside the virtualenv to learn but getting following error on python manage.py startapp Authentication: python manage.py startapp Authentication Traceback (most recent call last): File…
0
votes
0 answers

Django runserver error "TypeError: __init__() takes 1 positional argument but 2 were given"

I understand that somewhere 2 parameters are passed when 1 is needed only, but I can't seem to figure out where. I was in the process of updating Django from 1.9 to 1.11. Most answers relate to views, but all my views are class based and had as_view…
mgPePe
  • 5,677
  • 12
  • 52
  • 85
0
votes
1 answer

How to change the primary key of manytomany table in django

I am changing the primary key of the legacy database. I was able to change the primary key by setting id as the primary key. Before class User(models.Model): name = models.CharField(max_length=5) email = models.CharField(max_length=5) …
0
votes
1 answer

Image missing in RSS/ATOM with Django

I'm trying to attach an image to my ATOM and RSS syndication feed thanks to the Django's documentation : https://docs.djangoproject.com/fr/1.11/ref/contrib/syndication/ I have to kind of feed : http://example.com/rss and…
GrandGTO
  • 13
  • 3
0
votes
1 answer

Django task not running using crontab

I am using django-kronos to create a cron job and it is running fine when I run it manually. But it is not running in case of crontab. Below is my code to test if it is working: settings.py ENV_PATH = os.path.join(BASE_DIR, '.env') # Adding KRONOS…
Sumit S Chawla
  • 3,180
  • 1
  • 14
  • 33
0
votes
1 answer

Django's authenticate method returns 'None' for a an already saved User

Settings.py AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', ) Tests.py which has the code triggering the error class LoginTest(TestCase): def test_can_redirect_to_user_page_if_authentificated(self): …
Lennuyé
  • 59
  • 1
  • 1
  • 7
0
votes
1 answer

Cannot login in Django tests

Trying to write tests for a legacy Django 1.11 project. The project is using unittest package (I don't know if that's standard or a choice). I'm trying to use django.test.Client.force_login to test a view with LoginRequiredMixin but it does nothing.…
Hkan
  • 3,243
  • 2
  • 22
  • 27
0
votes
1 answer

i can't do makemigrations in django 1.11 (fields.E312)

class Player(models.Model): name = models.CharField(max_length = 256) number = models.IntegerField() age = models.IntegerField() is_captain = models.BooleanField(default = False) class Injuries(models.Model): player = models.ForeignKey(Player,…
0
votes
2 answers

Django 1.11 error while trying to post data

I'm new to Django 1.11 LTS and I'm trying to solve this error from a very long time. Here is my code where the error is occurring: model.py: name = models.CharField(db_column="name", db_index=True, max_length=128) description =…
bharry29
  • 51
  • 7