Skip to content

Fullstack development of application that logs suppliers to its dashboards in PowerBI and also the CEO's company as superuser to all dashboards.

Notifications You must be signed in to change notification settings

AndreKuratomi/prototipo_login_api

Repository files navigation

prototipo_login_api


Translations


About

prototipo_login_api is the PrototipoLogin's API.

This API uses the language Python, its framework Django, its lib DjangoMail, the database PostgreSQL, the software Docker and the AWS EC2 service.


Links

AWS S3 link

PrototipoLogin's frontend repository


Instalation:

0. It is first necessary to have instaled the following devices:

git init

1. Clone the repository prototipo_login_api by your machine terminal or by the IDE:

git clone https://github.com/AndreKuratomi/prototipo_login_api.git

WINDOWS:

Obs: In case of any mistake similar to this one:

unable to access 'https://github.com/AndreKuratomi/prototipo_login_api.git': SSL certificate problem: self-signed certificate in certificate chain

Configure git to disable SSL certification:

git config --global http.sslVerify "false"

Enter the directory:

cd prototipo_login_api

2. After cloning the repository install:

Virtual enviroment* and update its dependencies with the following command:

LINUX:

python3 -m venv venv --upgrade-deps

WINDOWS:

py -m venv venv --upgrade-deps

In case an error like this one is returned just follow the command displayed:

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.10-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

*It is a good practice to work with virtual enviroments because different projects may need different dependencies. A virtual enviroment is only a separated enviroment from the user machine. If not used, the user's machine may have lots of dependencies intalled that may only be used in a single project.


Ativate your virtual enviroment with the command:

LINUX:

source/venv/bin/activate

WINDOWS:

On Windows operational system it is necessary to configure the Execution Policy at PowerShell:

Get-ExecutionPolicy # to check the Execution policy type
Set-ExecutionPolicy RemoteSigned # to change the type of policy if the command above shows 'Restricted'

Obs: It may often be necessary to open PowerShell as administrador for that.

.\env\Scripts\activate

Install its dependencies:

pip install -r requirements.txt

WINDOWS:

In case any error similar to the one bellow be returned:

ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: 'C:\\Users\\andre.kuratomi\\OneDrive - Company\\Área de Trabalho\\tables_to_db_mail_for_finances\\tables_to_db_and_mail_finances\\env\\Lib\\site-packages\\jedi\\third_party\\django-stubs\\django-stubs\\contrib\\contenttypes\\management\\commands\\remove_stale_contenttypes.pyi'
HINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths

Run cmd as adminstrador with the following command:

reg.exe add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f

3. Open the application on your IDE:

code .

4. Create .env file at the root directory:

touch .env

Inside it we need to put our enviroment variables taking as reference the given file .env.example:

DJANGO_SECRET_KEY=secret_key

EMAIL_HOST_USER=user_mail
EMAIL_HOST_PASSWORD=password

POSTGRES_DB=database
POSTGRES_HOST=host
POSTGRES_PASSWORD=password
POSTGRES_USER=user

Obs: Do not share info from .env file. It is already mentioned in .gitignore for not being pushed to the repo.

5. And run Django:

LINUX:

python manage.py runserver

or

./manage.py runserver

WINDOWS:

py manage.py runserver

Documentation

For full description of endpoints and its responses check the insomnia documentation on the link bellow (necessary free login account) click here.


References

About

Fullstack development of application that logs suppliers to its dashboards in PowerBI and also the CEO's company as superuser to all dashboards.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published