This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework import viewsets | |
from rest_framework.response import Response | |
# https://gist.github.com/ivlevdenis/a0c8f5b472b6b8550bbb016c6a30e0be | |
class ExtendViewSet(object): | |
""" | |
This viewset mixin class with extended options list. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import psycopg2 | |
from django.conf import settings | |
from django.db.backends import utils | |
from django.db.backends.postgresql.base import \ | |
DatabaseWrapper as PostgresqlDatabaseWrapper | |
from django.db.backends.postgresql.base import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rest_framework.views import exception_handler | |
def custom_exception_handler(exc): | |
""" | |
Custom exception handler for Django Rest Framework that adds | |
the `status_code` to the response and renames the `detail` key to `error`. | |
""" | |
response = exception_handler(exc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<HTML> | |
<HEAD> | |
<TITLE>Popup div with disabled background</TITLE> | |
<style> | |
.ontop { | |
z-index: 999; | |
width: 100%; | |
height: 100%; | |
top: 0; | |
left: 0; |