Skip to main content

Quick REST API creation

Project description

Django Start-API

Quick REST API creation.

Quick ready to use REST API based on Django and DRF, create your config file, launch 'startapi' and you will get:

  • Standard Django project created
  • All app created

For each app:

Installation

pip install django_startapi

Quickstart

  1. Create your config.yaml
  2. Run 'startapi'

Usage

This software is intented to be used to create an initial full working REST API, based on Django and Django Rest Framework. Design apps with models inside a config file and run django_startapi.

  1. Create a config file named 'config.yaml'
  2. run startapi
  3. optional: python manage.py createsuperuser
  4. python manage.py runserver and go to http://127.0.0.1:8000/api/

Config file

  • Add a project name used as for django-admin stratproject
  • Define your apps with models, models fields are Django fields

Note: Write related model name as string or put related models before relation to avoid "NameError: name 'YourModel' is not defined"

Config file structure:

project: <your_project_name>
apps:
    <app_name>:
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
    <app_name>:
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
        <ModelName>:
            field: SomeDjangoField()
            field: SomeDjangoField()
            ...
     ...       

Example of config file

project: audiolibrary
apps:
    band:
        Musician:
            name: CharField(max_length=40)
            surname: CharField(max_length=40)
            born_date: DateField(null=True)
        Band:
            name: CharField(max_length=100)
            author: ManyToManyField('Musician')
    album:
        Genre:
            name: CharField(max_length=100)
        Label:
            name: CharField(max_length=100)
        Album:
            name: CharField(max_length=120)
            band: ForeignKey('band.Band',  on_delete=models.DO_NOTHING)
            label: ForeignKey('Label',  on_delete=models.DO_NOTHING)
            date: DateField(null=True)

Project details


Download files

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

Source Distribution

django-startapi-0.0.2.dev2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_startapi-0.0.2.dev2-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file django-startapi-0.0.2.dev2.tar.gz.

File metadata

  • Download URL: django-startapi-0.0.2.dev2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for django-startapi-0.0.2.dev2.tar.gz
Algorithm Hash digest
SHA256 c1252e15e0a3eaa19541809be44f8d87c896433ee3f95ada2ebfcb95bb1da1a6
MD5 710cca4d09116bd97ff6ffe7ffd92fc7
BLAKE2b-256 6e483f2537b541927a8224bf817a6b5c52026f480545632fcd9a08f6ad1a9fe1

See more details on using hashes here.

File details

Details for the file django_startapi-0.0.2.dev2-py3-none-any.whl.

File metadata

  • Download URL: django_startapi-0.0.2.dev2-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for django_startapi-0.0.2.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 a741cc4537f371867e77569c732fe2621718f2858f503bfe96c38e74dd472b22
MD5 b389d86199709db176e7fcdb5f97c6ec
BLAKE2b-256 3e2812872381dc1471ae6f8eeed1d2eacebffe672b7b2ca57b6b30a448e4068a

See more details on using hashes here.

Supported by

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