nickjj / demo-for-chattanooga-python-user-group

A demo app for a talk I gave at the Chattanooga python user group.
10 stars 3 forks source link

What is this?

I recently gave a talk at the Chattanooga-Python-User-Group. This repo contains the demo code and slides from the presentation.

It it a demo that shows how you can use webpack to manage your assets with Flask. The following topics are covered:

Get set up locally with the demo

You will need both Python and NodeJS installed on your system before continuing.

# Set up a working directory and clone the demo app.
mkdir /tmp/demo-flask-webpack && cd /tmp/demo-flask-webbpack
git clone https://github.com/nickjj/demo-for-chattanooga-python-user-group

# Create a virtual environment.
#
# Personally I like virtualenvwrapper:
#   https://virtualenvwrapper.readthedocs.org/en/latest
#
# However you can set up your own environment however you wish.
mkvirtualenv demo-flask-webpack

# Install the demo app's python dependencies.
pip install -r requirements.txt

# Install the demo app's webpack dependencies.
npm install

# Run the webpack dev server.
npm start

# Run the Flask server.
python app.py

# View the page in a browser.
open http://localhost:5000

# (Optionally) build the assets to disk.
npm run-script build