Skip to main content

A typescript code generator for Django Rest Framework.

Project description

https://github.com/jinkanhq/django-rest-tsg/actions/workflows/coverage.yml/badge.svg https://codecov.io/gh/jinkanhq/django-rest-tsg/branch/main/graph/badge.svg?token=LX8E3QB541 https://badge.fury.io/py/django-rest-tsg.svg

django-rest-tsg

A typescript code generator for Django Rest Framework.

Usage

Install using pip

$ pip install django_rest_tsg

Put a tsgconfig.py file with build tasks into your django project’s root.

from django.conf import settings
from django_rest_tsg.build import build

BUILD_DIR = settings.BASE_DIR / 'app/src/core'

BUILD_TASKS = [
    build(Foo),
    build(BarSerializer, 'app/src/app/core', {'alias': 'Foobar'}),
]

Add django_rest_tsg to your INSTALLED_APPS.

INSTALLED_APPS = [
    ...
    'django_rest_tsg'
]

Run buildtypescript command on manage.py.

$ python manage.py buildtypescript

Or you can switch to another place.

$ python manage.py buildtypescript --build-dir /somewhere/you/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_rest_tsg-0.1.1-py3-none-any.whl (11.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page