Skip to content

This is a Django API connected to a MySQL database to store and retrieve Gw2 percentile data.

Notifications You must be signed in to change notification settings

Mapleia/LogCompareAPI

Repository files navigation

WELCOME

This is a Django API connected to a MySQL database to store and retrieve Gw2 percentile data.

If you haven't already...

1. Install Python

Skip this step if already installed. Download and install Python for your OS.

2. Clone Repo.

cd /your_project_folder/
git clone https://github.com/Mapleia/LogCompareAPI.git

3. Install MySQL.

Skip this step if already installed. Download and install MySQL for your OS.

If you know how, open MySQL command line. Otherwise, from your MySQL dev default install, open MySQL Client Command Line. Open, then login. From MySQL command line, create the database if you haven't already.

CREATE DATABASE logcomparedb;

To confirm:

SHOW DATABASES;

You should see "logcomparedb".

Base Setup

  1. Setup virtual environment (this is an example for VS Code).

    a. If not already in the LogCompareAPI folder,

    cd /LogCompareAPI/

    else, skip to b.

    b. Install virtualenv. If already installed, skip to c.

    pip install virtualenv

    c. Create virtual environment with virtualenv.

    virtualenv venv

    d. Activate virtual environment. (shell script)

    venv/Scripts/activate
  2. Install requirements.

    Once your virtual environment is running, the terminal should show:

    (venv) C:\path_to_project_folder\LogCompareAPI>

    In here, pip install the requirements.

    pip install -r requirements.txt
  3. Setup your .env file to store your secrets. Create a file in the home directory of the project (C:\path_to_project_folder\LogCompareAPI) called .env.

    DB_PASS='INSERT YOUR DATABASE PASSWORD HERE'
    SECRET_KEY='INSERT SECRET DJANGO KEY HERE'
    NAME='logcomparedb'
    USER='INSERT LOCAL DB USERNAME HERE'
    HOST='localhost'
    ENVIRONMENT='DEV'
    

Setup Django.

While you're still in your virtual environment:

py manage.py makemigrations
py manage.py migrate

Super User

If you'd like to create an admin account run the commands below to be taken through the process of setting up an admin account.

py manage.py createsuperuser

Run Django Server

py manage.py runserver

About

This is a Django API connected to a MySQL database to store and retrieve Gw2 percentile data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages