How to access pk in views (Django)

I'm writing a small chat programm in Django but have problems getting any further. Here's the code: models.py from django.db import models from datetime import datetime from django.utils import timezone class Chat(models.Model): chatname = mo...
more »

2017-04-19 16:04 (2) Answers

Django rest project dockerfile

I am absolutely new to docker. I have an existing Django Rest project whose structure looks like following: My requirements.txt: django==1.8.8 djangorestframework markdown django-filter django-rest-auth django-cors-headers django-secure dj...
more »

2017-04-19 13:04 (1) Answers

Using geoip2 for timezone look up

The django.contrib.gis.geoip2 framework expose a high level geolocation api. I want to use it to look up the user timezone, but the queries do not return the timezone, although the maxmind documetion says that their databases include them. Am I missi...
more »

2017-04-18 23:04 (1) Answers

Coalesce results in a QuerySet

I have the following models: class Property(models.Model): name = models.CharField(max_length=100) def is_available(self, avail_date_from, avail_date_to): # Check against the owner's specified availability available_periods ...
more »

2017-04-18 10:04 (2) Answers

Django - Cannot add middleware

I added a middleware django-user-agents to my application, used for getting user agent information and now my app won't start up. I followed all steps mentioned on their github page: django_user_agents but cannot get this thing working. Here's the ...
more »

2017-04-16 19:04 (1) Answers

Django - HTTP and WebSockets

We have an existing large Django 1.11 & Django-rest-framework application served by wsgi. We noticed that we might want to use a WebSocker for some requests (for example: get all running tasks - live updating) There is already a GET URL for that...
more »

2017-04-16 15:04 (0) Answers

Latest django-mongodb-engine

I'm following the guide to setup django-mongodb. But this line pip install git+https://github.com/django-nonrel/django@nonrel-1.5 always reverts my django to 1.5. Is there anyway that I can use lastest django? ...
more »

2017-04-16 11:04 (1) Answers

Connecting Django with MSSQL server

I'm trying to connect my Django app to SQL Server 2016. I've tried using django-pyodbc but it doesn't support Django 1.11. Instead I installed django-mssql 1.8. When I try to run the application I get this error. TypeError was unhandled by user code...
more »

2017-04-15 21:04 (0) Answers

How can I add a facebook user login functionality

My python version is 3.4.3 and my django version is 1.9.6 . I tried many django facebook registrations apps but almost all the versions are outdated. What I want is to allow users to login via facebook and check if their friends are registered to ...
more »

2017-04-15 19:04 (3) Answers