Git Product home page Git Product logo

django-rest-scaffold's Introduction

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/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.