mirror of
https://github.com/kennethreitz/kennethreitz.org.git
synced 2026-06-05 22:50:17 +00:00
2.1 KiB
2.1 KiB
Heroku 101
Introduction
- Heroku 101 provides an overview of Heroku's platform-as-a-service (PaaS) offering, highlighting its simplicity and utility for developers.
Key Concepts
- Confusion as a Service:
- SaaS (Software as a Service): For software users, providing more features and transparent updates (e.g., Facebook, Trello).
- IaaS (Infrastructure as a Service): For operations, offering on-demand machine resources (e.g., AWS, Digital Ocean).
- PaaS (Platform as a Service): For developers, offering transparent updates with no need to manage servers (e.g., Heroku, App Engine).
Using Heroku with Python
-
Locally:
- Create a virtual environment and install dependencies using
pip. - Run a Python web server with
python manage.py runserver 0.0.0.0:8000.
- Create a virtual environment and install dependencies using
-
On Heroku:
- Install dependencies with
pipand deploy using aProcfile. - The
Procfilespecifies the commands that Heroku should run to start your application.
- Install dependencies with
Understanding Dynos
- Dyno:
- A Dyno is a lightweight process running in a container, not a traditional server or VM.
- Dynos can be scaled to handle multi-process web applications using commands like
heroku scale.
Managing Applications
-
Run Arbitrary Commands:
- Heroku allows running various commands, such as database migrations or opening an interactive Python shell, using
heroku run.
- Heroku allows running various commands, such as database migrations or opening an interactive Python shell, using
-
Addon Services:
- Heroku provides managed infrastructure resources like Postgres, Redis, and Kafka.
- Addons are easy to integrate and configure within your application.
-
Application Configuration:
- Config variables can be set and managed with
heroku config:set, enabling environment-specific settings.
- Config variables can be set and managed with