The goal of this repository is to show how to implement a simple RESTful using Django.
Below you'll find a table with the current endpoints implemented:
Endpoint | Supported methods | Description |
---|---|---|
/todos |
GET | Get list of ToDo items |
- Fork this repository to your GitHub account by clicking the Fork button.
- Clone the main repository locally:
$ git clone https://github.com/gdsrosa/todos-api
- Add your fork as a remote to push your work to. Replace {username} with your username. This names the remote "fork", the default remote is "origin".
$ git remote add fork https://github.com/<username>/todos-api
- Create a virtualenv.
$ python3 -m venv env/
- Install the development dependencies
$ pip install -r requirements.txt
Create a branch for what you would like to work on. Always branch off master to get the latest changes.
$ git fetch origin
$ git checkout -b your-branch-name origin/master
Using your favorite editor, make your changes, committing as you go.
Make sure to include tests that cover any code changes you make. Run the tests as described below.
Push your commits to your fork on GitHub and create a pull request.
$ git push --set-upstream fork your-branch-name
$ python manage.py test todos
This application is dockerized and it's managed by Docker Compose. See docker-compose.yml.
Install Docker for your OS.
First build the web
and db
containers:
$ docker-compose build web db
Then, you can start the app:
$ docker-compose up