Little django application that exposes the sepomex database in a RESTful way.
Project description
Little django application that exposes the sepomex database in a RESTful way.
Installation
$ pip install django-tastypie-sepomex
Configuration
Once installed, you must add sepomex to your INSTALLED_APPS
INSTALLED_APPS += ['sepomex']
Apply migrate command to add the sepomex models to your database.
$ python manage.py migrate sepomex
Populate your sepomex models
$ python manage.py loadsepomex
This command will call the loadmxstates and loadmxmunicipalities commands. It finally will fill the sepomex_mxasentamiento table to complete the process.
Run your server
$ python manage.py runserver
… and use the endpoints provided
Get the list of states
There are 32 states, so we pass that as a query string.
$ curl localhost:8000/api/v1/mxestado/?limit=32
List first 20 municipalities for Coahuila
Coahuila’s id is 5. If not specified, the limit objects per query is 20
$ curl localhost:8000/api/v1/mxmunicipio/?mx_estado__id=5
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-tastypie-sepomex-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3abd27f8708cd2755aad14238824a3adb80b1da951503e5ae73d3546eda431b3 |
|
MD5 | f718ad43e8114f5babaed4277ec294e7 |
|
BLAKE2b-256 | f7b878f664412407479c80c73753c3c4bdc324d1500a090161c4bf421f7bcbe5 |