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.
- Host: GitHub
- URL: https://github.com/dotchoco/navi
- Owner: DotChoco
- License: mit
- Created: 2024-03-04T23:44:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-17T13:32:09.000Z (about 1 year ago)
- Last Synced: 2024-12-19T04:39:12.710Z (6 months ago)
- Language: Python
- Homepage:
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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 localFirst 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
```