
Sandman: A Boilerplate-free Python REST API for Existing Databases - mmariani
http://www.jeffknupp.com/blog/2013/07/23/sandman-a-boilerplatefree-python-rest-api-for-existing-databases/
======
clarkevans
Over the past few years we've also been working on a HTTP based API for SQL
databases -- [http://htsql.org;](http://htsql.org;) it has
insert/update/delete features in a plugin.

------
Arnor
I really hope this makes it to production. I'll be contributing code and money
to see that happen. Thanks for this extremely useful tool.

~~~
jknupp
Contributions are always welcome. I've been making reasonably quick progress
on it and it's getting more robust by the day. Already added features include
a Django-style admin interface, user-defined HTTP methods per Model, and user-
defined, per-method validation.

The two main features needed to make sandman really usable are authentication
and the generation of "rel" links automatically from foreign key information.
I'm working on authentication as we speak...

------
deckiedan
Very very cool. With a django-admin style gui, and some method of auth, this
could make prototyping new apps extremely quick for legacy (or other-
department maintained) databases.

~~~
asparagui
I've messed with inspectdb a few times, it's a good trick to know if you're in
the land of django:

[https://docs.djangoproject.com/en/dev/howto/legacy-
databases...](https://docs.djangoproject.com/en/dev/howto/legacy-databases/)

~~~
bmelton
Caveat: It's also frigging miserable if you are in the minority of developers
using Django with Oracle DB. It gets quite a bit wrong, but my main gripe is
that I can't inspectdb against an Oracle table and then syncdb the resultant
models and get the same (or even necessarily working) tables.

YMMV.

------
eli
Nice. I could've used this earlier. Tastypie is nice, but it really kinda
assumes your models and relationships are already designed for a public API.

------
dpcx
Anyone know of a PHP version of this? Would make my life so much easier.

~~~
gnaritas
Why would you need a PHP version? If you like this idea, just use this and
consume the services with your PHP front end.

~~~
ChikkaChiChi
As a for instance, PHP has a native driver for Microsoft SQL services.

~~~
gnaritas
And Python doesn't?

------
clubhi
A few lines of code added on django-admin will get you this as well.

~~~
johnsonmkj
New to django, care to share a link?

~~~
dkroy
from app.models import ModelName

admin.site.register(ModelName)

Django documentation for this:
[https://docs.djangoproject.com/en/dev/ref/contrib/admin/](https://docs.djangoproject.com/en/dev/ref/contrib/admin/)

~~~
jknupp
The point is, with Django you'd have to painstakingly reverse-engineer a
Django Model from your existing database. sandman does all of this without
writing any boilerplate code (aside from listing the names of the tables you
want included in your API).

The difference in LOC and general frustration is huge.

~~~
dkroy
I agree that is extremely awesome. I was just responding to his question. I
have already started playing with your project, and have enjoyed experimenting
with it.

