Skip to content

Commit

Permalink
update docs/index.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
alainivars committed Jun 14, 2019
1 parent d32f7ea commit 80fcf77
Showing 1 changed file with 58 additions and 19 deletions.
77 changes: 58 additions & 19 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,37 @@ Welcome to cookiecutter-drf-microservice documentation!
:target: https://pypi.python.org/pypi/cookiecutter-drf-microservice/
:alt: PyPi wheel



About cookiecutter-drf-microservice
====================================
cookiecutter-drf-microservice is a ready-to-use API skeleton, Cookiescutter generates it, add your endpoints, test it, package it, validate it on stage and deploy it.
It sounds simple and it is.
Something disturb you in the code? Don't hesitate to submit a pull request and contribute.
Cookiecutter-drf-microservice is a ready-to-use API skeleton generator:
- generates it,
- add your endpoints,
- test it,
- package it,
- validate it on stage and QA then
- deploy it on production.

It sounds simple and it is. Take a look at `Drf-microservice`_ it's now generated by `Cookiescutter-drf-microservice`_.

Something disturb you in the code? Don't hesitate to open a an issue and contribute.

Releases Notes
==============
- 0.7.1: Remove all .md file, update the doc,
- 0.7.0: cookiecutter-drf-microservice got it own separate repository
- 0.6.1: Update dependencies
- 0.6.0: total refactoring for add cookiecutter
- 0.5.2: fix depencies security alert
- 0.5.1: fix some document presentation on github and pypi
- 0.5.0: Initial publication version

Bugs and evolution policies
===========================
When you will find a bug or propose an evolution create a ticket on:

- `Issue Cookiescutter-drf-microservice`_ if it's about the generation process
- `Issue Drf-microservice`_ if it's about a functionality in the generated drf process

To setup
========
+ If needed install https://github.com/audreyr/cookiecutter or ::
Expand All @@ -68,20 +83,20 @@ To setup

cookiecutter gh:alainivars/cookiecutter-drf-microservice 00:31:00
github_username [my-github-user-name]: alainivars
github_repository_name [my-repository]: my-drf-microservice
github_repository_name [my-repository]: drf-microservice
app_name [my_app]: my_api
email [my-email@my-domain.my]: alainivars@gmail.com
description [The description of my drf app]: A simple demo on how to use cookiecutter-drf-microservice generator

+ Now we just jump in the new directory and run tox to ::

- be sure that everything as worked fine
- generate the documentation
- generate an virtualenv

.. code-block:: shell

cd my-drf-microservice
tox
cd my-drf-microservice
tox

+ An virtualenv is already ready for you at ::

Expand Down Expand Up @@ -130,19 +145,39 @@ To see the documentation for the API
In development mode, login at ::

curl --request POST \
--url http://127.0.0.1:8000/rest-auth/login/ \
--header 'authorization: Basic YWRtaW46YWRtaW4=' \
--url http://127.0.0.1:8000/api-auth/login/ \
--header 'content-type: application/json' \
}'
--data '{
"username": "admin",
"password": "admin"
}'

Actually the default mode is "development" (same to the state of this project)
in that mode a default login is the the db with username='admin' password='admin'
you will get back in return your token.

you will get back in return your token::

{"key":"400a4e55c729ec899c9f6ac07818f2f21e3b4143"}


Then open to see the full auto-generated documentation of you API::

curl --request GET \
--url http://127.0.0.1:8000/docs/ \
--header 'authorization: Basic YWRtaW46YWRtaW4='

or by if BasicAuthentication is disabled and that wil be normally the case in prod and QA we use the Token::

curl --request GET \
--url http://127.0.0.1:8000/docs/ \
--header 'authorization: Token 400a4e55c729ec899c9f6ac07818f2f21e3b4143'


Then open ::

http://127.0.0.1:8000/docs/

.. image:: media/docs.png

Testing
=======
You can run the tests by ::
Expand All @@ -167,7 +202,7 @@ Before dockerization for deployment to production, don't forget to check if by :

If you Use Aws
==============
Aws secret required ???::
Aws secret required ???:: WORK IN PROGESS

APPNAME_USERNAME_PASSWD => a client API password
SECRET_KEY => the secret key
Expand Down Expand Up @@ -210,24 +245,24 @@ Functionalities DONE

DevOps tools DONE
=================
- the docker-image configuration file
- the docker-compose configuration file
- endpoint get status Icinga2
- endpoint get status Nagios/Icinga2

Functionalities TODO
====================
- AWS ssm secret
- endpoint json file DELETE,PUT?
- create differents version:
- create different version:
- Aws S3 support (in progress)
- Aws RDS support
- Aws Elastisearch support
- Redis support
- Aerospike support
- ...
- ...

DevOps tools TODO
=================
- the docker-image configuration file (in progress)
- the Packer configuration file (in progress)
- the Terraform configuration file AWS (in progress)
- the Terraform configuration file GCD
Expand All @@ -241,3 +276,7 @@ DevOps tools TODO
- the Juju configuration file GCD
- the Juju configuration file Azure

.. _`Cookiescutter-drf-microservice`: https://github.com/alainivars/cookiecutter-drf-microservice
.. _`Drf-microservice`: https://github.com/alainivars/drf-microservice
.. _`Issue Cookiescutter-drf-microservice`: https://github.com/alainivars/cookiecutter-drf-microservice/issues
.. _`Issue Drf-microservice`: https://github.com/alainivars/drf-microservice/issues

0 comments on commit 80fcf77

Please sign in to comment.