-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from LaurierCS/pablo/setup-local-db
Setup Local DB and Updated READMEs
- Loading branch information
Showing
6 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Django Migrate | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- "api/**" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
DEBUG: 0 | ||
defaults: | ||
run: | ||
working-directory: ./api/optimeet/ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Migrate Production DB | ||
run: | | ||
python manage.py makemigrations | ||
python manage.py migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Django Test Migrations | ||
|
||
on: | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- "api/*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
DEBUG: 1 | ||
defaults: | ||
run: | ||
working-directory: ./api/optimeet/ | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Migrate Local DB Should Not Throw Errors | ||
run: | | ||
python manage.py makemigrations | ||
python manage.py migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.env | ||
my.cnf | ||
db.sqlite3 | ||
**/__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
## Setup | ||
1. Install dependencies with `pip install -r requirements.txt`. | ||
2. Create `.env` file in base directory with `DEBUG` and `SECRET_KEY` variables. | ||
3. Create `my.cnf` in base directory with variables required to connect to MySQL database. | ||
|
||
## Migrate Model Changes | ||
When you make changes to `models.py` files, you need to run the following commands to update your local DB: | ||
1. `python manage.py makemigrations` | ||
2. `python manage.py migrate` | ||
|
||
## Run | ||
Run `python manage.py runserver` to start the server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# React + Vite | ||
## Setup | ||
1. Install dependencies with `npm i`. | ||
2. Create `.env` file in base directory with the `VITE_CLIENT_ID` variable. | ||
|
||
React app created using Vite. | ||
## Run | ||
Run `npm run dev` to start the server. |