isik-kaplan / django-http-exceptions Goto Github PK
View Code? Open in Web Editor NEWHTTP exceptions for django
Home Page: https://pypi.org/project/django-http-exceptions/
License: MIT License
HTTP exceptions for django
Home Page: https://pypi.org/project/django-http-exceptions/
License: MIT License
It would be really cool to have:
return OK(some_response)
This seems like a useful little package. But no way I'm going to use it with the AGPL license.
i.e., 102, 206, 307, 308, 402, 407, 417, 429
I'm not sure to understand what @errorify
does, is it an alternative to HTTPExceptions.BASE_EXCEPTION.register_default_view(view)
?
Are
@errorify(HTTPExceptions.FORBIDDEN)
def default_view_403(_):
return HttpResponse("I'm the 403 default view")
and
HTTPExceptions.FORBIDDEN.register_default_view(default_view_403)
equivalent ?
Trying to extend HTTPExceptions
for custom functionality fails with KeyError
Expectations - following code (or similar) should print YAY
:
class CustomHTTPException(HTTPException):
def my_custom_method(self):
return "YAY"
class CustomHTTPExceptions(HTTPExceptions):
BASE_EXCEPTION = CustomHTTPException
print(CustomHTTPExceptions.BAD_REQUEST.my_custom_method())
Instead it fails with
File "test.py", line 6, in <module>
class CustomHTTPExceptions(HTTPExceptions):
File "site-packages\django_http_exceptions\exceptions.py", line 33, in __new__
_transform = classdict['__transform__']
KeyError: '__transform__'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.