Skip to main content

A re-useable Django helper app for integrating rest-scaffold.js.

Project description

Django REST Scaffold

TravisCI PyPI Coveralls Code Style

Source: https://github.com/gregschmit/django-rest-scaffold

REST Scaffold is a Django app that provides a template tag helper for using the rest-scaffold.js library.

The Problem: AJAX is nice because if you have an API, then you don’t need separate pages/views for listing, creating, and updating model instances. But writing custom AJAX tables on the frontend can be time-consuming.

The Solution: This app provides a template tag that uses rest-scaffold.js to quickly render “scaffolds”, which are tables that have controls which interact with your API.

How to Use

$ pip install django-rest-scaffold

Include rest_scaffold in your INSTALLED_APPS.

Build your API or create one using AutoREST.

Then, insert a scaffold using the rest_scaffold template tag. At the top you’ll need to load the template tag:

{% load rest_scaffold %}

And then wherever you want in the HTML page, inject the scaffold:

{% rest_scaffold 'user' api_root='api' %}

In the above example, you would see a scaffold for the User model.

Contributing

Open a pull request fixing a bug or implementing a feature if you want to contribute. You must only contribute code that you have authored or otherwise hold the copyright to, and you must make any contributions to this project available under the MIT license.

To collaborators: don’t push using the --force option.

Dev Quickstart

REST Scaffold comes with a settings.py file, technically making it a Django project as well as a Django app. First clone, the repository into a location of your choosing:

$ git clone https://github.com/gregschmit/django-rest-scaffold

Then you can go into the django-rest-scaffold directory, install the test environment requirements, and then migrate and run the local development server:

$ cd django-rest-scaffold
$ pip install -r requirements-test.txt
$ python manage.py migrate
$ python manage.py createsuperuser
...
$ python manage.py runserver

Then you can see the api at http://127.0.0.1:8000/api/, and you can see the example scaffold page at http://127.0.0.1:8000/example/.

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-rest-scaffold-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

django_rest_scaffold-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file django-rest-scaffold-0.1.0.tar.gz.

File metadata

  • Download URL: django-rest-scaffold-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.9

File hashes

Hashes for django-rest-scaffold-0.1.0.tar.gz
Algorithm Hash digest
SHA256 406efc036bbb62d8ff9746413eee48db4e96f6b543b89e9490d4d485b736be90
MD5 89b9782753fde8cdd65ea4588d4b8e7a
BLAKE2b-256 bfb480d4e10b7141c4212c7762ceef0e7e0be3c96fdfe2b98e493ba8e11b3c59

See more details on using hashes here.

File details

Details for the file django_rest_scaffold-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_rest_scaffold-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.6.9

File hashes

Hashes for django_rest_scaffold-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 126765442ee1903eed0a91c5c7df0592b059f3d722cc670f7586af119232ecc7
MD5 1f731b465f8a64fa7d8f7aa5926b8d6a
BLAKE2b-256 5e09dc1df835d2d016815584f488c0c09abd76ca7acfdacf0aed94604bd24307

See more details on using hashes here.

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