• Stars
    star
    148
  • Rank 249,983 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created over 12 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Django Admin powered by RESTful Hypermedia APIs
https://secure.travis-ci.org/zbyte64/django-hyperadmin.png

Introduction

django-hyperadmin is a HATEOAS API framework for building resources in Django. Resources are anything that can be manipulated with forms and configuration of a Resource is similar to that of an Admin Model. While Resources offer a REST CRUD layer out of the box they are meant to power workflows that go beyond CRUD. Additionally Resources aim to be reusable throughout the web application and not to be limitted to a single API endpoint.

This is BETA

Documentation: http://django-hyperadmin.readthedocs.org/

Features

  • ModelResource works like AdminModel
  • Data store agnostic
  • Media type agnostic
  • Index classes define search and filter capabilities through forms
  • Autoloads basic functionality from admin site
  • Inline support
  • Clients packaged seperately
  • Throttling
  • API key authentication
  • Wizard workflows

Supported Media Formats:

  • application/text-html, text/html - provides HTML responses
  • application/json - plain json serialization, uses datataps
  • text/javascript - for jsonp
  • application/vnd.Collection+JSON
  • application/vnd.Collection.next+JSON
  • application/vnd.Collection.hyperadmin+JSON - for the emberjs client
  • TODO: xml, yaml, ???

Headers control media type; "Accepts" and "Content-Type" control response and request format

Requirements

  • Python 2.6 or later
  • Django 1.3 or later
  • django-datatap

Help & Feedback

We have a mailing list for general discussion and help: http://groups.google.com/group/django-hyperadmin/

Installation

Install hyperadmin into your python environment:

pip install django-hyperadmin

or:

pip install -e git+git://github.com/webcube/django-hyperadmin.git#egg=django-hyperadmin

Put 'hyperadmin' into your INSTALLED_APPS section of your settings file.

Add to root url patterns:

url(r'^hyperapi/', include('hyperadmin.urls')),

Configuration

Registering models

Registering a model with hyperadmin:

import hyperadmin
from hpyeradmin.resources.models import ModelResource, InlineModelResource
from myapp.models import MyModel, ChildModel

class ChildModelResource(InlineModelResource):
    model = ChildModel

class MyModelResource(ModelResource):
    inlines = [ChildModelResource]
    list_display = ['name', 'number']
    list_filter = ['timestamp', 'category']

hyperadmin.site.register(MyModel, MyModelResource)

API Endpoints

  • "/" lists rows; POST to create
  • "/add/" POST to add
  • "/<id>/" displays a specific row; PUT/POST to update, DELETE to delete
  • "/<id>/delete/" POST to delete

Inline API Endpoints

  • "/<parent_id>/(relname)/" lists rows; POST to create
  • "/<parent_id>/(relname)/add/" POST to add
  • "/<parent_id>/(relname)/<id>/" displays a specific row; PUT/POST to update, DELETE to delete
  • "/<parent_id>/(relname)/<id>/delete/" POST to delete

Autoloading from Django Admin

The following registers the models from admin site (this is already done if you import from hyperadmin.urls):

from hyperadmin.resources.models.autload import DjangoCTModelAdminLoader
from django.contrib.admin import site as admin_site
from hyperadmin import site as root_endpoint

loader = DjangoCTModelAdminLoader(root_endpoint, admin_site)
loader.register_resources()

Clients

Visiting the api endpoint in a browser will let you browse the various hyberobjects made available through the resource. Clients may be installed on a different url.

Django Template Client

https://github.com/webcube/django-hyperadmin-client

Uses django templates to render an admin interface. Responsive design out of the box.

Ember REST Client

https://github.com/zbyte64/django-hyperadmin-emberclient

Uses REST calls and emberjs to render an admin interface.

Backbone Bindings

https://github.com/zbyte64/django-hyperadmin-backboneclient

Provides basic bindings to the Backbone API.

Dockit CMS

https://github.com/webcube/django-dockitcms

A dynamic API builder with a public HTML (template driven) client.

Reading up on Hypermedia APIs

http://www.amundsen.com/hypermedia/hfactor/

http://code.ge/media-types/collection-next-json/

More Repositories

1

reactjs-crashcourse

Condensed Reactjs Patterns
JavaScript
82
star
2

django-jsonschema

django-jsonschema converts Django Forms into JSON Schema compatibile representations
Python
36
star
3

django-configstore

An application to allow for other apps to easily store site based configurations
Python
32
star
4

django-dockit

Provides a document based ORM suite modelled after Django's own conventions.
Python
28
star
5

real-world-graphql-with-django

Real world GraphQL patterns with Django
22
star
6

pugdit

P2P BBS over IPFS
Python
12
star
7

django-dockitcms

CMS written using django-dockit
Python
10
star
8

wtforms-jsonschema

Generate json-schema from wtforms
Python
9
star
9

refluxxor

refluxxor
JavaScript
8
star
10

django-hyperadmin-emberclient

Hyperadmin client written using ember.js
JavaScript
7
star
11

django-hyperadmin-backboneclient

Backbone.js client for hyperadmin
JavaScript
7
star
12

django-fieldmaker

This package enables you to design forms in the Django admin. These forms can be used in your code or to extend existing forms in the admin itself. Other libraries may register new fields or widgets for the designer to use.
Python
7
star
13

pytorch-fuzzdom

Write browser tests without dom specifics
Python
6
star
14

django-allauth-graphene

GraphQL mutations for django aullauth
Python
6
star
15

django-hyperadmin-client

HTML client for hyperadmin
JavaScript
6
star
16

website-archspace

Archspace Reloaded
Python
5
star
17

python_datagov_notebooks

Examples in scraping data.gov with python
Jupyter Notebook
4
star
18

pytorch-reddit-distance

Trains karmic based distance embedding using attention, and BPEmb.
Python
3
star
19

stowaway-ssl-ambassador

Shell
3
star
20

django-hostingservices

Python
3
star
21

dockitcmsdemo

Demo for the dockit cms system
Python
3
star
22

django-datatap

django-datatap is a fixture system enabling applications to define their own loading and dumping process while supporting file asset storage.
Python
3
star
23

django-hyperadmin-dockitresource

Hyperadmin document resource for Dockit
Python
2
star
24

django-tasklock

An app to ensure only one of a certian task is running in celery
Python
2
star
25

stowaway

Simple docker image deployment through vagrant provisioned machines
Python
2
star
26

asyncio-demo

Asyncio Demo
Python
2
star
27

django-schemamaker

Python
2
star
28

webpack-systemjs-loader

webpack-systemjs-loader
JavaScript
2
star
29

pytorch-dagsearch

Python
2
star
30

django-customerevents

Python
2
star
31

project-hoster

Microservices for publishing & hosting websites on IPFS
JavaScript
1
star
32

python-restmore

The missing django batteries for restless to help you get more sleep.
Python
1
star
33

website-jennythai

Jenny Thai's website
Python
1
star
34

PyshGP

Python implementation of Push
Python
1
star
35

python_demo

Demo stuff for python class
Jupyter Notebook
1
star
36

django-rulebuilder

Python
1
star
37

beaker-plugin-ipfs

IPFS-protocol plugin for the Beaker browser
JavaScript
1
star
38

WSGIProxy

Python
1
star
39

django-hyperadmin-s3resource

Hyperadmin Storage Resource made for S3
Python
1
star
40

django-cachetree

cache configurable trees of related model instances in Django
Python
1
star
41

django-eggproxy

PyPi Eggproxy in django
Python
1
star