kurtkrafft1 / Hired-API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hired Django RESTful App

This is the back-end counterpart to the full-stack Hired React App. A full description of the app can be found there.

Project Setup

  1. Please Note that you must place the following steps in a separate directory from the front end app!!!!

  2. Clone the repo and cd into it:

    git clone git@github.com:kurtkrafft1/Hired-API.git

  3. Navigate to the root directory: cd Hired-API

  4. Set up your virtual environment:

    python -m venv hiredEnv

  5. Activate virtual environment:

    source ./hiredEnv/bin/activate

  6. Install dependencies:

    pip install -r requirements.txt

  7. 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

  8. In the root directory (the one you should be in) enter this: touch hiredapp/views/connection.py

  9. hit then code . or some way to open your text editor to the root directory.

  10. find that connection file the path is this hiredapp/views/connection.py

  11. in that file enter the following code:

     class Connection:
         db_path = "Your db.sqlite3 path here"
    
  12. make sure that the spacing is correct and that db_path is indented

  13. In the terminal now we can run migrations:

    python manage.py makemigrations python manage.py migrate

  14. 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'

  15. navigate back to the connection.py file and past that path where it says "your DB path here" keeping the quotation marks

  16. in your terminal it is time to load fixtures:

    python manage.py loaddata */fixtures/*.json

  17. Start the API server:

    python manage.py runserver

  18. Follow the steps on the front-end web app readme to view the web app in your browser

Technology Utilized

  1. Django
  2. Python
  3. SQLite
  4. Fixtures
  5. ORM & SQL queries
  6. Models
  7. API Endpoint Views
  8. User authentication with authtoken
  9. url routing

Made By:

![ERD] (https://github.com/kurtkrafft1/Hired-API/blob/master/images/erd.png?raw=true)

About


Languages

Language:Python 100.0%