Skip to content

An exercise in Flask w/ Google Login and Google Sheets Datastore

Notifications You must be signed in to change notification settings

prof-rossetti/flask-sheets-starter-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flask-sheets-starter-2023

This is an example full stack web application built in Python with the Flask framework. This application implements Google Login and interfaces with a Google Sheets datastore.

Screenshot 2023-04-19 at 8 10 15 PM

Setup

Prerequisites

To run this app, you'll need to have Anaconda, Python, and Pip installed (specifically Python version 3.10+).

Installation

Make a copy of the template repository from GitHub, as necessary. Clone your copy of the repo onto your local computer, for example onto your Desktop.

Navigate to the local repository from the command line, for example if on the Desktop:

cd ~/Desktop/flask-sheets-starter-2023

NOTE: it is important to navigate to the root directory before running many of the commands below.

Create new virtual environment (first time only):

conda create -n flask-sheets-starter python=3.10

Activate the virtual environment (first time, or whenever you return to the project):

conda activate flask-sheets-starter

NOTE: it is important to activate the virual environment before running any of the commands below.

Install package dependencies (first time only):

pip install -r requirements.txt

Services

Follow these guides to setup the various cloud services required by this application:

Configuration

Create a new file called ".env" in the root directory of this local repository, and place inside contents like the following:

# this is the ".env" file...

# for flask:
FLASK_APP="web_app"

# for google analytics (optional):
# GA_TRACKER_ID="G-____________"

# for google login:
GOOGLE_CLIENT_ID="___________"
GOOGLE_CLIENT_SECRET="___________"

# for google sheets:
GOOGLE_SHEETS_DOCUMENT_ID="___________"

NOTE: when you push your repository to GitHub, the ".env" file does not show up - this is desired behavior, as designated by the ".gitignore" file, to prevent our secret credentials stored in the ".env" file from being uploaded or exposed on GitHub.

Usage

Run the web application (then view in the browser at localhost:5000):

flask run

About

An exercise in Flask w/ Google Login and Google Sheets Datastore

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published