DRF caching time out is not setting properly

I have cached my Django views using Memcached. I have set TIME_OUT=60*15 but cache expires within 5 minutes. I'm currently using Django Rest Framework and for caching I use:...

How to cache Django Rest Framework API calls?

I'm using Memcached as backend to my django app. This code works fine in normal django query: def get_myobj(): cache_key = 'mykey' result = cache.get(cache_key, None) if...

Proper way to cache responses in django rest framework

I am aware of https://github.com/chibisov/drf-extensions but the build is failing. How should responses be cached for generic views? For example: class PropertyList(generics.ListAPIView): ...

Django Rest Framework debug post and put requests

I use DRF extension to se json list for model, and there i can debug with debug-toolbar that GET request, but how can i debug POST and PUT requests? I have this for settings in debug...

Django rest framework : How to serve binary directly in the body

I need to return an Image (binary) directly in the body request, but what i get in response is a file generated with no extension and an empty array/json inside! I'm using python 3, Django==1.10.5...

Django REST Framework Extension recursive nested urls

I want to create URLs for CMS portion of project I have following models class Category(models.Model): name = models.CharField(max_length=150) parent = models.ForeignKey('self',...

maximum page size queryset in generic views django rest

How can we achieve page_size=max for generic API view in Django rest framework? ?page_size=max work with drf-extensions but only for Viewsets not with generics ListAPIView. Can someone confirm...

Flaky Assert "java.lang.AssertionError: Can't unlock: Not locked!"

While trying to build a H2O Random Forest via the Python API, I got a flaky error. (I've saved the .err file which is empty and the .out file in case somebody wants to look at it.) ...

django extensions OSError: [Errno 2] "dot.exe" not found in path

I am trying to install django-extensions to visualize my models in my Django rest project. Complete stacktrace: (vb_env_drf) D:\Development\Bern\VB_rewrite\VB_DRF_Backend>pip install...

Google App Engine instances behave differently with the exact same API call

I have a Django application with a DRF API deployed in a flexible environment on Google App Engine. I am using PostgreSQL with the PostGIS extension. After deployment, I have two instances...

Django Rest Framework API Client Custom Header

I am trying to use bulk update from drf-extensions. To make it work, there is a safeguard requiring the header "X-BULK-OPERATION": 'true'. I can get the application working using curl or my...

Using gte, lte, and range with Django REST Framework

Has anyone successfully used DRF to make API calls using gte, lte, and range? If so, what extension did you use? I've tried django-filters and django-rest-framework-filters but neither work as...

How exactly do I have to use HStoreField?

I'm using the latest version of Django and DRF. But after running it I'm getting this error: class HStoreDescriptor(models.fields.subclassing.Creator): AttributeError: module...

Nested routes using drf-extensions are not documented in API docs

I'm writing API in DRF and had need to add nested routes. Since drf-extensions are specified in official documentation I tend to use this package and it seemed to be working, but the...

How to use reactstrap via webpack

how do I write my config, so I can run successfully? I do not know what's wrong with my webpack.config.js or wrong code in other files? can someone tell me what's wrong with my...

Validate pk as int in drf viewset retrieve url

Code looks as follows: class UserViewSet(ViewSet): # ... Many other actions def list(self): # list implementation def retrieve(self, request, pk): # manual pk int...

Django How can I trace back where this call is done

Since I created a new project (Django 2.2 and Python 3.7) I am having this error been printed periodically each 60s. Not Found: /graphql [24/Sep/2019 13:23:50] "GET /graphql HTTP/1.1" 404...

Bulk insert in Django Rest Framework JSONAPI

I'm implementing a DRFJSonAPI API: https://django-rest-framework-json-api.readthedocs.io/en/stable/index.html However, I got stuck on trying to implement a bulk insert, it seems that the JSONAPI...

AutoML: out of memory on small training file

I am attempting to run H2OAutoML on a 2.7MB training CSV on a system with 4GB RAM using the python API and it is running out of memory. The error messages I am encountering are...

How remove double quotes from postgres table and field names on django?

I'm working on a django project with postgres where table and field names are generated with double quotes. Anyone knows how can I disable this behavior? [Model definition] class...

Not able to start `django` project in local as well as in docker

I am using Docker to deploy Python2.7 application with Django1.8. I am facing some issue from last two days and I found error as below. Docker Image:...

Django - reverse nested url with drf-nested-routers

I configured my api url as localhost:port/app_name/students/{student_id}/macro/{macro_id}/lto using drf-nested-routers extension. Basically, each students has some macro categories assigned,...

Mypy linting in VSCode Errors out with "Error constructing plugin instance of NewSemanalDRFPlugin"

Trying to run Mypy linter in VSCode, always getting the same error in the output... The root of the Django project and the workspace directory are different. ##########Linting Output -...

"Authentication credentials were not provided." Django and AWS application

I'm implementing an web application in Django with a TokenAuthentication extension that I found here...

how to do nested routes drf-extensions django using uuid instead of id

I have two Django models - I will change the name of my models here but the idea is the same. class Photo(models.Model): uuid = models.UUIDField(primary_key=True, default=uuid.uuid4) image =...

localhost:8000 not working but 127.0.0.1:8000 is django

I'm not sure when it actually happened but I have a django project and when I run my server my app no longer works with localhost and instead works with 127.0.0.1. I had changed my django version...

Conflicting with version dependencies when running pip install

Having issues with version dependencies when running pip install on docker. However, when installing on my mac without docker and just virtualenv, works perfectly fine. These are the versions I...

DRF spectacular not discovering custom auth extension classes

when extending a new Token Authentication class from rest_framework_simplejwt.authentication.JWTAuthentication drf-spectacular swagger-ui authorize button disappears and there is no way to add...

Django DRF / JS - React Notifications API

I am working on a browser extension with a Django DRF backend and currently JS frontend ( working to convert it to React ). What I am trying to achieve is when a user clicks a buttons to trigger...

GeoDjango PointField | JSON serializer | coordinates

So I have this problem in my app. When I try to create user that have attribute "location" that is a GeoDjango PointField, only value set as 'default' is saved... When I send request with postman,...