5 ms·
Sandman: A Boilerplate-free Python REST API for Existing Databases
- deckiedan 13y agoVery 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 13y agoI'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 13y agoCaveat: 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.
- jknupp 13y agoYour wish is my command. Django-style admin GUI added! Check out the GitHub page for a screenshot. Authentication is next on my list...
- eli 13y agoNice. 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.
- clubhi 13y agoA few lines of code added on django-admin will get you this as well.
- johnsonmkj 13y agoNew to django, care to share a link?
- dkroy 13y agofrom 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 13y agoThe 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 13y agoI 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.
- Arnor 13y agoI 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 13y agoContributions 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...
- clarkevans 13y agoOver 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.
- dpcx 13y agoAnyone know of a PHP version of this? Would make my life so much easier.
- gnaritas 13y agoWhy would you need a PHP version? If you like this idea, just use this and consume the services with your PHP front end.
- ChikkaChiChi 13y agoAs a for instance, PHP has a native driver for Microsoft SQL services.
- gnaritas 13y agoAnd Python doesn't?
- allannienhuis 13y agoA php version would be useful for someone with an existing php project who doesn't want to add another tech stack to their build/deploy/host requirements. This is especially useful for authors who might target customers self-hosting on low cost shared hosting services, where php & mysql is ubiquitous.
- allannienhuis 13y agohttps://github.com/gilbitron/Arrest-MySQL https://github.com/gilbitron/Arrest-MySQL