Personal tools
Skip to content. | Skip to navigation
django-import-export is a Django application and library for importing and exporting data with included admin integration. Features: support multiple formats (Excel, CSV, JSON, and everything else that tablib support) admin integration for importing preview import changes admin integration for exporting export data respecting admin filters Documentation: https:/django-import-export.readthedocs.io/en/stable/ GitHub: https:/github.com/django-import-export/django-import-export/ Free software: BSD license PyPI: https:/pypi.org/project/django-import-export/ Example app To run the demo app: cd tests ./manage.py makemigrations ./manage.py migrate ./manage.py createsuperuser ./manage.py loaddata category book ./manage.py runserver Contribute If youd like to contribute, simply fork the repository, commit your changes to the develop branch (or branch off of it), and send a pull request. Make sure you add yourself to AUTHORS. As most projects, we try to follow PEP8 as closely as possible
Django Lifecycle Hooks This project provides a @hook decorator as well as a base model and mixin to add lifecycle hooks to your Django models. Django's built-in approach to offering lifecycle hooks is Signals. However, my team often finds that Signals introduce unnecessary indirection and are at odds with Django's "fat models" approach. Django Lifecycle Hooks supports Python 3.5, 3.6, 3.7, 3.8 and 3.9, Django 2.0.x, 2.1.x, 2.2.x, 3.0.x and 3.1.x. In short, you can write model code like this: from django_lifecycle import LifecycleModel, hook, BEFORE_UPDATE, AFTER_UPDATE class Article(LifecycleModel): contents = models.TextField() updated_at = models.DateTimeField(null=True) status = models.ChoiceField(choices=['draft', 'published']) editor = models.ForeignKey(AuthUser) @hook(BEFORE_UPDATE, when='contents', has_changed=True) def on_content_change(self): self.updated_at = timezone.now() @hook(AFTER_UPDATE, when="status", was="draft", is_now="pub
Django Readonly Field Make Django model fields readonly. In other words, make it so that Django will read from your fields in your database, but never try to write them. It can be
Django REST Framework QueryFields Installation .. code-block:: bash pip install djangorestframework-queryfields Quickstart -Specify your base model serializer like this:.. code-block:: python from rest_framework.serializers import ModelSerializer from drf_queryfields import QueryFieldsMixin class MyModelSerializer(QueryFieldsMixin, ModelSerializer): pass--.. code-block:: bash GET...
Django REST - Access Policy This project brings a declaritive, organized approach to managing access control in Django REST Framework projects. Each ViewSet or function-based view can be assigned an explicit policy for the exposed resource(s). No more digging through views or seralizers to understand access logic -- it's all in one place in a format that less technical stakeholders can understand. If you're familiar with other declaritive access models, such as AWS' IAM, the syntax will be familiar. In short, you can start expressing your access rules like this: class ArticleAccessPolicy(AccessPolicy): statements = [ { "action": ["list", "retrieve"], "principal": "*", "effect": "allow" }, { "action": ["publish", "unpublish"], "principal": ["group:editor"], "effect": "allow" } ] This project has complete test coverage and the base AccessPolicy class is only ~150 lines of co
DRF-extensions is a collection of custom extensions for Django REST Framework
Django REST - FlexFields[ for [Django REST Framework]() is a package designed to provide a common baseline of functionality for dynamically setting fields and nested models within DRF serializers. To remove unneeded fields, you can dynamically set fields,...
drf-nested-routers |build-status-image| |pypi-version|Overview Nested resources for the Django Rest FrameworkDocumentation -Please see the README on the Github repo page: < |build-status-imag .. |pypi-versio
Sane and flexible OpenAPI 3.0 schema generation for Django REST framework. This project has 3 goals: Extract as much schema information from DRF as possible. Provide flexibility to make the schema usable in the real world (not only toy examples). Generate a schema that works well with the most popular client generators. The code is a heavily modified fork of the DRF OpenAPI generator, which is/was lacking all of the below listed features. Features Serializers modelled as components. (arbitrary nesting and recursion supported) @extend_schema decorator for customization of APIView, Viewsets, function-based views, and @action additional parameters request/response serializer override (with status codes) polymorphic responses either manually with PolymorphicProxySerializer helper or via rest_polymorphics PolymorphicSerializer) and more customization options Authentication support (DRF natives included, easily extendable) Custom serializer class support (easily extendable) Ser
dynaconf - Configuration Management for Python. Features Inspired by the 12-factor application guide Settings management (default values, validation, parsing, templating) Protection of sensitive information (passwords/tokens) Multiple file formats toml|yaml|json|ini|py and also customizable loaders. Full support for environment variables to override existing settings (dotenv support included). Optional layered system for multi environments [default, development, testing, production] Built-in support for Hashicorp Vault and Redis as settings and secrets storage. Built-in extensions for Django and Flask web frameworks. CLI for common operations such as init, list, write, validate, export. full docs on https:/dynaconf.com