An open API service indexing awesome lists of open source software.

https://github.com/dotchoco/navi

It's an REST API was used in an web app for UDEM (Morelia's University) using Django Rest Framework.
https://github.com/dotchoco/navi

Last synced: 3 months ago
JSON representation

It's an REST API was used in an web app for UDEM (Morelia's University) using Django Rest Framework.

Awesome Lists containing this project

README

        

# Navi

## About
Navi it's an API REST created in python using Django and Django Rest Framework. This project was used in an web app for UDEM (Morelia's Univerty).

## Installation

Clone the repository

```sh
git clone https://github.com/MrChocoreto/Navi.git
```

## Setup Project
You might have python 3.12.2 intalled in your device.

You can ensure that is installed using this comand
```sh
python --version
```
If you dont have install this version go to the official page to download.

[python.org/downloads](https://www.python.org/downloads/)

### Dependencies
>[!NOTE]
>To create the environment the command works same for Linux and Windows.

>[!NOTE]
>I recommend create the environment if you're only work in local

First you have to create your environment to have more control in the project
```sh
python -m venv env
```
Now you have execute the environment before to install the dependencies. To execute this commands you need be in the project path.

#### Windows

```sh
./env/Scripts/activate
```

#### Linux
```sh
source ./env/bin/activate
```

After that, you need install the next dependencies:
- setuptools

```sh
pip install setuptools
```
- django

```sh
pip install django
```
- django rest framework

```sh
pip install djangorestframework
```
- coreapi

```sh
pip install coreapi
```

- mysql

```sh
pip install mysqlclient
```

### DataBase Setup

To use the database you need create the next configuration in MariaDB

- user: ```navi```
- password: ```1>fCT)},dfVZ6Rbv9q*.```
- port: ```3306```
- host: ```localhost```

To create the user in database if is not created:
```sql
CREATE USER 'navi'@localhost IDENTIFIED BY '1>fCT)},dfVZ6Rbv9q*.';
```
Then, give it the correct access to the database
```sql
GRANT USAGE ON *.* TO 'navi'@localhost IDENTIFIED BY '1>fCT)},dfVZ6Rbv9q*.';
```
Give the user access to the database
```sql
GRANT ALL ON `navi`.* TO 'navi'@localhost;
```
Apply the changes
```sql
FLUSH PRIVILEGES;
```

#### Optional configurations
If you are using vscode, there are recommend extensions, one of them is pylint, you have to install pylint-django in your
environment
```sh
pip install pylint-django
```

After that, you have to modify the configuration of pylint in vscode, and add the following args,
you add this at ```Configuration -> pylint -> Pylint:args``` in VSCode UI
```sh
"pylintArgs": ["--load-plugins=pylint_django" ]
```

### Initialize API

After to run the API you might do the next commands.
```sh
python manage.py makemigrations
```
```sh
python manage.py migrate
```

For the test in local you have to write this command.
```sh
python manage.py runserver
```

### Exit Environment

If you want to exit of your environment you need put the next command:

```sh
deactivate
```