Skip to content

๐Ÿ› ๏ธ My configurations, cheatsheets, and guides for most text editors and language-specific frameworks I use in my tech stack.

Notifications You must be signed in to change notification settings

agamjolly/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 

Repository files navigation

๐Ÿ› ๏ธ Dotfiles

My configurations and cheatsheets for most text-editors and language-specific frameworks I use in my tech stack.

Flask Environment Setup

cd into your your source and then use

python3 -m venv venv # makes a venv called "venv"

Activation

Activate your recently developed venv using:

source venv/bin/activate

Make sure that you are in the same directory as your venv to run the command.

Boilerplate Code

Use the following boilerplate code to make your source file:

from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return "Hello world"

if __name__ == '__main__':
  app.run(host='0.0.0.0', port=8000, debug=True)

Flask Development Server

Export the flask app using:

export FLASK_APP=app.py

(Optional) Change the development environment:

export FLASK_ENV=debug # runs in debug mode and facilitates automatic refreshing for frontend changes

Make the code publicly available to everyone in localhost:

flask run --host=0.0.0.0 --port=8000 # also stops interference with nginx 

About

๐Ÿ› ๏ธ My configurations, cheatsheets, and guides for most text editors and language-specific frameworks I use in my tech stack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published