Django Restful API backend template - project generator/development environment. Can be used by Python developers for quick start on building Restful API's using Django framework and django-rest-framework. This project is aimed to simmplify development environment setup and includes many useful dev tools like RabbitMQ, Redis, Elasticsearch, Kibana, Apidoc
- RabbitMQ
- Redis
- Elasticsearch
- Logstash
- PostgreSQL
- Nginx
- Supervisord
- Kibana
- Apidoc
Python libraries included:
- django-rest-framework
- uwsgi
- psycopg2
- Clone this project into your work directory:
$ git clone "https://github.com/trydirect/django-restful.git"
- Bring up services with docker-compose:
$ cd django-restful/v01/dockerfiles
$ docker-compose up -d
$ docker-compose exec web python manage.py migrate
- Now, let's check it out
$ curl -i localhost/users/
HTTP/1.1 200 OK
Server: nginx/1.16.0
Date: Thu, 13 Jun 2019 10:39:46 GMT
Content-Type: application/json
Content-Length: 52
Connection: keep-alive
Vary: Accept, Cookie
Allow: GET, POST, HEAD, OPTIONS
X-Frame-Options: SAMEORIGIN
{"count":0,"next":null,"previous":null,"results":[]}
- Let's check running containers
$ docker-compose ps
Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------
db docker-entrypoint.sh postgres Up (healthy) 5432/tcp
elasticsearch /docker-entrypoint.sh elas ... Up 9200/tcp, 9300/tcp
kibana /docker-entrypoint.sh kibana Up 0.0.0.0:5601->5601/tcp
logstash /docker-entrypoint.sh -e Up 0.0.0.0:5044->5044/tcp
mq docker-entrypoint.sh rabbi ... Up (healthy) 15671/tcp, 0.0.0.0:21072->15672/tcp, 25672/tcp, 4369/tcp, 5671/tcp, 0.0.0.0:2172->5672/tcp,0.0.0.0:32770->5672/tcp
nginx /usr/bin/supervisord -c /e ... Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
redis docker-entrypoint.sh redis ... Up (healthy) 6379/tcp
web /usr/bin/supervisord -c /e ... Up 0.0.0.0:8000->8000/tcp
- Run tests
$ python ../../tests.py
$ sh ./djangorest/scripts/apidoc.sh
- Fork it (https://github.com/trydirect/django-restful/fork)
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request