Questions tagged [django-1.9]

Django 1.9 is a version of the Django framework, released December 2015. Please only use this tag if your question relates specifically to this version.

Django 1.9 supports Python 2.7, 3.4, and 3.5.

Here are a list of changes:

Django 1.9 was released in December 2015 and was supported until April 2017.

273 questions
0
votes
0 answers

How to authenticate into a Django app using RemoteUserBackend

My app is required to support users logged in via SSO on a 3rd party server. I configured settings.py based on the docs, i.e. MIDDLEWARE_CLASSES = [ '...', 'django.contrib.auth.middleware.AuthenticationMiddleware', …
mibm
  • 1,328
  • 2
  • 13
  • 23
0
votes
1 answer

Django Testing Post request exhaust the data

class SampleTest(APITestCase): def setUp(self): self.id = 1 self.api_url = 'api/check_customers' self.token ='##############' def test_check_customer(self): self.client.credentials(HTTP_AUTHORIZATION='Bearer ' +…
Sagar
  • 159
  • 2
  • 17
0
votes
1 answer

How to respond to django.test.Client using the test database

I have a django settings.py file with one configured database, leading to two mysql databases, let's call them dbname and test_dbname. When running a command like python manage.py test ..., an object selection like MyClass.objects.all() will select…
Olivier
  • 118
  • 2
  • 8
0
votes
0 answers

Internal Server Error when upgrading from django 1.9 to django 1.11

I have upgraded from django 1.9 to django 1.11. As I run python manage.py runserver after the upgrade I got an error due to the import of patterns. I realised it made sense, since patterns is depracted. So I changed my urls.py from if…
J0ANMM
  • 7,849
  • 10
  • 56
  • 90
0
votes
1 answer

how to redirect in Django correctly?

There is a button in the profile page in my django application,after clicking that button,I want to redirect it to my home page. On the click of that button,a function in views.py is mapped which is working fine and the function is: …
ssharma
  • 339
  • 1
  • 5
  • 22
0
votes
1 answer

what's the postfix configuration to allow smtp automatic django emails

On my last server i could send smtp automatic emails on port 25 but after migrating the server on virtualmin install, i can't make it work Here's the old working postfix config myhostname = ##REVERSE_DNS_IPV4## myorigin =…
Jul6art
  • 219
  • 3
  • 14
0
votes
1 answer

The right time to use .count() in Django ORM

These are the models i have in my small project class Tag(models.Model): name = models.CharField(max_length=200) class Post(models.Model): content = models.CharField(max_length=200) tags = models.ManyToManyField(Tag) location =…
qwertyui90
  • 191
  • 2
  • 14
0
votes
1 answer

Mysql not working with python 3.6 and django 1.9

I am trying to connect mysql db with django 1.9 and python version is 3.6. With database connection string I am getting the below error. If I comment out the database connection string the site is loading fine. Can anybody tell what is wrong in…
Anish
  • 4,262
  • 6
  • 36
  • 58
0
votes
2 answers

How to display a ForeignKey field as a selection field in django template

I need to display a foreignKey field as a selection field in Django template, which will show all the available records as a dropdown. On considering the case of querying to database every time on selecting the field, which is the best method to…
Akhil Mathew
  • 1,571
  • 3
  • 34
  • 69
0
votes
2 answers

html content is not sent in email

I want to sent the link to the email so when user clicks that link, the user will be redirected to the refer page and can refer other friends. I have used send_mail to send the email. Everything gets sent except the html message. Here is what i have…
pythonBeginner
  • 781
  • 2
  • 12
  • 27
0
votes
2 answers

redirect to another form if email exists

I want to implement an invitation feature where user will fill in email address and their email will be saved to database. If they again fill in email address and request for invitation, they should be redirected to another form(ReferForm) so they…
pythonBeginner
  • 781
  • 2
  • 12
  • 27
0
votes
0 answers

handle cookie when creating invite object

I want to implement the feature where users are not given to signup account directly. A request invitation button will be there. When user clicks for request invitation with an email address, a link will be send with token and when user clicks on…
pythonBeginner
  • 781
  • 2
  • 12
  • 27
0
votes
2 answers

How to call a instance method from a CharField in Django

My code is as follows... class Todo(models.Model): state_choice = (('To Do','To Do'),('Doing','Doing'),('Done','Done')) def get_color_depends_state(self): if self.state: if self.state == 'To Do': self.color_code…
Akhil Mathew
  • 1,571
  • 3
  • 34
  • 69
0
votes
1 answer

DjangoRestFramework: Unable to return count in JSON Response

I've a table Orders which contains ID, store_name, order_date, ..... I want to create an endpoint which returns me the JSON which consists of Count of Orders from all the Stores. Something as follows: [{store_name: 'Target', count: 10}, {store_name:…
Shrikant Kakani
  • 1,511
  • 2
  • 17
  • 37
0
votes
1 answer

related_name changed after 1.6

I'm upgrading from 1.6 to 1.9. My project includes code derived from this sample AuditTrail: https://code.djangoproject.com/wiki/AuditTrail Essentially, this AuditTrail allows to create an Audit model on-the-fly to record any changes to an audit…
leonsas
  • 4,718
  • 6
  • 43
  • 70