Creating delicious APIs for Django apps since 2010

django-tastypie Creating delicious APIs for Django apps since 2010. Currently in beta but being used actively in production on several sites. Requirements Core Python 2.7+ or Python 3.4+ (Whatever is supported by your version of Django) Django 1.11, 2.2 (LTS releases) or Django 3.0 (latest release) dateutil (http://labix.org/python-dateutil) >= 2.1 Format Support Optional What’s It Look Like? A basic example looks like: # myapp/api.py # ============ from tastypie.resources import ModelResource from myapp.models import Entry class EntryResource(ModelResource): class Meta: queryset = […]

Read more

Generate real Swagger/OpenAPI 2.0 specifications from a Django Rest Framework API

drf-yasg – Yet another Swagger generator Generate real Swagger/OpenAPI 2.0 specifications from a Django Rest Framework API. Compatible with Django Rest Framework: 3.10, 3.11, 3.12 Django: 2.2, 3.0, 3.1 Python: 3.6, 3.7, 3.8, 3.9 Only the latest patch version of each major.minor series of Python, Django and Django REST Framework is supported. Only the latest version of drf-yasg is supported. Support of old versions is dropped immediately with the release of a new version. Please do not create issues before […]

Read more

Transparently use webpack with django

django-webpack-loader Read http://owaislone.org/blog/webpack-plus-reactjs-and-django/ for a detailed step by step guide on setting up webpack with django using this library. Use webpack to generate your static bundles without django’s staticfiles or opaque wrappers. Django webpack loader consumes the output generated by webpack-bundle-tracker and lets you use the generated bundles in django. Compatibility Test cases cover Django>=2.0 on Python>=3.5. 100% code coverage is the target so we can be sure everything works anytime. It should probably work on older version of django […]

Read more

An instant remote API to your Django models data with a powerful query language

Djaq Djaq – pronounced “Jack” – provides an instant remote API to your Django models data with a powerful query language. No server-side code beyond two lines of config is required. You don’t write backend classes, serializers or any other code to be able to immediately get whatever data you want to the client. And it is blazing fast. Djaq queries are strings. A query string for our example dataset might look like this: (b.name as title, b.publisher.name as publisher) […]

Read more

Authentication Module for django rest auth

django-rest-knox Authentication Module for django rest auth Knox provides easy to use authentication for Django REST Framework The aim is to allow for common patterns in applications that are REST based, with little extra effort; and to ensure that connections remain secure. Knox authentication is token based, similar to the TokenAuthentication built in to DRF. However, it overcomes some problems present in the default implementation: DRF tokens are limited to one per user. This does not facilitate securely signing in […]

Read more

Authentication for Django Rest Framework

Dj-Rest-Auth Drop-in API endpoints for handling authentication securely in Django Rest Framework. Works especially well with SPAs (e.g React, Vue, Angular), and Mobile applications. Requirements Quick Setup Install package pip install dj-rest-auth Add dj_rest_auth app to INSTALLED_APPS in your django settings.py: INSTALLED_APPS = ( …, ‘rest_framework’, ‘rest_framework.authtoken’, …, ‘dj_rest_auth’ ) Add URL patterns urlpatterns = [ path(‘dj-rest-auth/’, include(‘dj_rest_auth.urls’)), ] (Optional) Use Http-Only cookies REST_USE_JWT = True JWT_AUTH_COOKIE = ‘jwt-auth’ Testing Install required modules with pip install -r dj_rest_auth/tests/requirements.pip To run […]

Read more

A Django App that adds Cross-Origin Resource Sharing headers to responses

A Django App that adds Cross-Origin Resource Sharing (CORS) headers to responses. This allows in-browser requests to your Django application from other origins. About CORS Adding CORS headers allows your resources to be accessed on other domains. It’s important you understand the implications before adding the headers, since you could be unintentionally opening up your site’s private data to others. Requirements Python 3.6 to 3.9 supported. Django 2.2 to 3.2 supported. Are your tests slow? Check out my book Speed […]

Read more

Tools for Optuna, MLflow and the integration of both

HPOflow Tools for Optuna, MLflow and the integration of both. The main components are: hpoflow.OptunaMLflow: A wrapper to use Optuna and log to MLflow at the same time. hpoflow.OptunaMLflowCallback: Class inheriting from transformers.TrainerCallback that integrates with OptunaMLflowto send the logs to MLflow and Optuna during model training. hpoflow.SignificanceRepeatedTrainingPruner: An Optuna prunerto use statistical significance (a t-test which serves as a heuristic) to stopunpromising trials early, avoiding unnecessary repeated training during cross validation. Installation HPOflow is available at the Python Package […]

Read more

A software manager for easy development and distribution of Python code

A software manager for easy development and distribution of Python code. The main features that Piper adds to Python are: Support for large-scale, multi-package projects Reproducibility (clear, transparent dependency management) Robust development-lifecycle, from blueprinting to distribution Piper is inspired by what Maven is for Java and uses Pip and Virtual Environments. Why Piper Python is great in many things, particularly for scripting. But it is powerful enough to create complex software too. Still, when doing so, it lacks some robustness […]

Read more
1 38 39 40 41 42 51