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

Reference to another field in model.py // Django

I would like to return in str method of the Chapter, title of the Chapter and title of the Book (from book model). I need it for better display at the admin pages. How to do that? Should I create some new method in Book or use Model instance…
0
votes
1 answer

How create queryset to custom fields?

I have 2 custom fields as in the picture below in my form. When user make GET request, in the right list I want to show user's permissions. In the left list I want to show available permissions which is not yet in right list. How to make correct…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
0 answers

No confirmation of authenticate(username=username, password=password) in django-python3-ldap

I'm trying to develop what should be a relative simple web application that requests a user to log in via LDAP, then if successfully logged in, the user can then search for another user(s) in the LDAP server. It's an application for admin people.…
pymat
  • 1,090
  • 1
  • 23
  • 45
0
votes
1 answer

How save User data in OneToOneField | Django?

I have two models(User and Profile). In Profile model as you can see I have idx field which I use for sorting. In my project I show list of profiles and admin can sorting them by drag and drop. For thats why I use idx. Also this field is invisible…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

build a follower system which is not between enduser

Usecase The app that I am developing is about linking startup, job seekers and investors. Sorry I could not give the name still though I have developed already around 40% :) .There will be three entities. One is Startup account, Enduser account…
milan
  • 2,409
  • 2
  • 34
  • 71
0
votes
3 answers

NoReverseMatch on Django even when kwargs are provided

The Django cant resovle the url, even though the expected kwarg is provided. Here is root urls.py: from django.conf import settings from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import…
Maverick
  • 2,738
  • 24
  • 91
  • 157
0
votes
1 answer

Django + HTML Template cannot display the right way

I'like to represent the list of news_list, the result should be like following style using 2 loops: category1 -- info_record 1 -- info_record 2 category2 -- info_record 3 The problem is, inside loop {% for m in…
wu peter
  • 97
  • 2
  • 11
0
votes
2 answers

Django inline formset data not saved

I'm working in Django 1.11 I have three models, business, business_address, business_phone where business_address and business_phon are associated with business. I want to create fields for business_address as well as business_phone along with…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
0
votes
1 answer

Unit test form with ImageField in django

I have model with ImageField. I am trying to write unit test to my form but it always raise error. Can someone say me where is my mistake? From error I understand that form is not valid. print str(form.errors) return me this:
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
3 answers

Django .raw query fails (error 1064) -- but works in SQL

(using django 1.11.2, python 2.7.10, mysql 5.7.18) The following SQL query: SELECT transaction_transaction.id, sec_to_time(avg(time_to_sec(extract(HOUR_SECOND from transaction_transaction.transaction_datetime)))) AS…
Hal
  • 537
  • 4
  • 13
0
votes
0 answers

Unit test to assertRedirects of login?

I have custom login page for admin in my Django project. I am trying to write unit-test but it raise error. After successful login Django redirect user to other page (dashboard page). In my unit test dont work assertRedirects. How to fix this…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
0 answers

FormView in edit form | Django dont see object pk?

I have CBV with View which works perfect. I am trying to rewrite this code with FormView. Is my FormView code correct? I need someone who can analyze that code and say where is my mistakes. I would be grateful for any help. Right now get method…
Nurzhan Nogerbek
  • 4,806
  • 16
  • 87
  • 193
0
votes
1 answer

How can I rediredct the views with different user groups in django

This is the view which was written for my django project. if user is not None: if user.is_active: auth_login(request, user) return HttpResponseRedirect('/home/') else: messages.error(self.request, …
Self
  • 497
  • 1
  • 6
  • 19
0
votes
1 answer

Django 1.11 use template from an app as admin template

as the title said i am having a problem using a template in an admin view here is my worktree project |-- project/ |-- myapp/ |-- templates/ |-- admin/ |-- file.html settings.py TEMPLATES = [ { 'BACKEND':…
0
votes
1 answer

Django Settings Module

I installed Django and was able to double check that the module was in fact in Python, but when attempting to implement basic commands such as runserver or utilize manage.py; I get DJANGO_SETTEINGS_MODULE error. I already used "set…
OphA
  • 23
  • 3