first in your route, use this base url : /api/{version}
then create this file: decorator.py
import falcon
class UriVersion:
def __init__(self, version: list):
from datetime import timedelta | |
from django.conf import settings | |
from django.http import HttpResponse, HttpResponseNotFound | |
from django.utils import timezone | |
from django_q import models | |
from django_q.monitor import Stat | |
from django_redis import get_redis_connection | |
from prometheus_client import Gauge, generate_latest |
from bson import ObjectId | |
from bson.errors import InvalidId | |
from django.utils.encoding import smart_str | |
from rest_framework import serializers | |
class ObjectIdField(serializers.Field): | |
"""Field for ObjectId values""" | |
def to_internal_value(self, value): |