Challenge for Belvo Application

kaajavi 9c235ecde9 Fix> Add .env usage file!!! há 5 anos atrás
application b25c346391 Solve some pylint problems há 5 anos atrás
transactions b25c346391 Solve some pylint problems há 5 anos atrás
users b25c346391 Solve some pylint problems há 5 anos atrás
.dockerignore f28d0a275b * Change Readme.md há 5 anos atrás
.gitignore 913e0c200c Add gitignore file há 5 anos atrás
Dockerfile f28d0a275b * Change Readme.md há 5 anos atrás
Readme.md 9c235ecde9 Fix> Add .env usage file!!! há 5 anos atrás
docker-compose.yml f28d0a275b * Change Readme.md há 5 anos atrás
entrypoint.sh f28d0a275b * Change Readme.md há 5 anos atrás
manage.py fda69d4b77 Project start and app users há 5 anos atrás
requirements.txt 4311f408cc * Add transaction application há 5 anos atrás

Readme.md

Belvo challenge

Author: Javier Guignard

You can see demo in https://demo.kaajavi.com/

If you want to see the admin panel, the default email is admin@admin.com and their password is admin

Setup

This application was developed with python 3.8

The first thing to do is to clone the repository:

$ git clone https://gogs.kaajavi.com/kaajavi/BelvoApp.git
$ cd BelvoApp

Create a virtual environment to install dependencies in and activate it:

$ virtualenv --no-site-packages env
$ source env/bin/activate

Then install the dependencies:

(env)$ pip install -r requirements.txt

Note the (env) in front of the prompt. This indicates that this terminal session operates in a virtual environment set up by virtualenv.

Once pip has finished downloading the dependencies:

(env)$ python manage.py migrate
(env)$ python manage.py create_superuser
(env)$ python manage.py runserver

And navigate to http://127.0.0.1:8000/.

The home page is the API documentation.

What do you need know about the challenge

I removed the session authentication and I didn't set up the authentication by JWT or similar token, so the API is open for everybody.

To run in docker-compose

I suppose you have installed docker and docker-compose. If not, try here

Create the .env file and add this lines:

POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
DJANGO_SETTINGS_MODULE=application.settings-pg #Very important

Run:

$ docker-compose up

and server runs in development mode.
When docker-compose runs, call commands for DB migrations, create superuser if not exists, and then run the server in 8080 port.

Tests

To run the tests, cd into the directory where manage.py is:

(env)$ python manage.py test users
(env)$ python manage.py test transactions

or for all:

(env)$ python manage.py test