Giter Site home page Giter Site logo

gonzalo-bulnes / kata-python-web-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 52 KB

๐Ÿฅ• A proof of concept for a deployable web app in Python โ€” with extra docs.

Home Page: https://colorsandnumbers.herokuapp.com

License: Other

Python 100.00%
demo

kata-python-web-app's Introduction

Python Web App

A proof of concept for a deployable web app in Python.

Goals

  • learn what it takes to deploy a small we app to Heroku
  • get a feeling of how its files could be organized in Python
  • give a try to Flask

Usage

  • the application is configured with a given color
  • every time you visit the web page you get a different number and the color that was chosen

Development

Build Status Demo

# create a virtual environment (optional)
python -m venv venv # using Python 3, search for virtualenv for Python 2
# activate the virtual environment
./venv/bin/activate

# install the dependencies
pip install -r requirements.txt

# run the test suite
pytest -v

# pick a color, configure the application to use it
export COLOR=turquoise

# run the application locally
FLASK_APP=numbersandcolors.py python -m flask run # then visit http://127.0.0.1:5000

# make changes, contribute ideas, have fun!

# once you're done, deactivate the virtual environment
deactivate

Deployment to Heroku

Manual

# install the Heroku CLI, then:
heroku login -i

# intitial setup
heroku git:remote -a numbersandcolors # or any name you like

# to deploy:
git push heroku master
# to configure the app:
heroku set:config COLOR=turquoise

# then visit: https://numbersandcolors.herokuapp.com (or https://your-preferred-name.herokuapp.com)

Automatic

Press the button to deploy this app to your Heroku account! A free Heroku account should suffice.

Deploy

Notes

  • Remember to add any new dependency to requirements.txt with pip freeze! On Ubuntu (and other Debian systems) pip freeze > requirements.txt outputs some undue configuration. If that's the case for you, prefer: pip freeze | grep -v "pkg-resources" > requirements.txt.

Credits

The carrot emoji used as logo belongs to Google and was published under the Apache License v2.0 as part of Noto Emoji.

License

Documentation

Copyright (C) 2019 Gonzalo Bulnes Guilpain

Permission is granted to copy, distribute and/or modify this document under the terms
of the GNU Free Documentation License, Version 1.3 or any later version published by
the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and
no Back-Cover Texts. A copy of the license can be found at
<http://www.gnu.org/copyleft/fdl.html>.

Code

Except for the contents of the doc/ directory, this code is in the public domain.

kata-python-web-app's People

Contributors

gonzalo-bulnes avatar

Watchers

James Cloos avatar

Forkers

oknono

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.