This is the back-end counterpart to the full-stack Hired React App. A full description of the app can be found there.
-
Please Note that you must place the following steps in a separate directory from the front end app!!!!
-
Clone the repo and cd into it:
git clone git@github.com:kurtkrafft1/Hired-API.git
-
Navigate to the root directory:
cd Hired-API
-
Set up your virtual environment:
python -m venv hiredEnv
-
Activate virtual environment:
source ./hiredEnv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
I had to manually connect to the database a few times so you're going to have to set that up really quick so follow these instructions
-
In the root directory (the one you should be in) enter this:
touch hiredapp/views/connection.py
-
hit then
code .
or some way to open your text editor to the root directory. -
find that connection file the path is this
hiredapp/views/connection.py
-
in that file enter the following code:
class Connection: db_path = "Your db.sqlite3 path here"
-
make sure that the spacing is correct and that db_path is indented
-
In the terminal now we can run migrations:
python manage.py makemigrations
python manage.py migrate
-
Now that you have this set up go back to your text editor that you opened earlier and you should see a file called "db.sqlite3" right or cmd click that file and hit 'copy path'
-
navigate back to the connection.py file and past that path where it says "your DB path here" keeping the quotation marks
-
in your terminal it is time to load fixtures:
python manage.py loaddata */fixtures/*.json
-
Start the API server:
python manage.py runserver
-
Follow the steps on the front-end web app readme to view the web app in your browser
- Django
- Python
- SQLite
- Fixtures
- ORM & SQL queries
- Models
- API Endpoint Views
- User authentication with authtoken
- url routing
![ERD] (https://github.com/kurtkrafft1/Hired-API/blob/master/images/erd.png?raw=true)