Skip to content

r0ddy/microdash-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microdash-api

Getting Started

  1. Install gcloud CLI using this [link] (https://cloud.google.com/sdk/docs/install) or the following command:

    curl https://sdk.cloud.google.com | bash
    
  2. Install postgresql

    brew install postgresql
    
  3. Login with gcloud

    # Choose gmail that you is linked with GCP project
    gcloud auth login
    gcloud init
    # Enter project id which is django-app-346321
    # Ask Roddy for access.
    
  4. Start virtual environment and install dependencies.

    cd microdash
    python -m venv venv
    source venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements.txt
    
  5. Install SQL Auth Proxy (for running db)

    gcloud auth application-default login
    

    If using macOS (64-bit)

    curl -o cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.darwin.amd64
    chmod +x cloud_sql_proxy
    

    If using macOS (M1)

    curl -o cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.darwin.arm64
    chmod +x cloud_sql_proxy
    

    Move to home directory

    mv cloud_sql_proxy ~/
    
  6. Run SQL Auth Proxy

    # Open new terminal window.
    sudo ./run-db-proxy
    
  7. Run Django migrations and generate static files.

    # Go back to other terminal window now.
    export GOOGLE_CLOUD_PROJECT=django-app-346321
    export USE_CLOUD_SQL_AUTH_PROXY=true
    python manage.py makemigrations
    python manage.py makemigrations polls
    python manage.py migrate
    python manage.py collectstatic
    
  8. Open https://localhost:8000/admin

About

The API for a better DoorDash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors