...
Assuming you use Homebrew, run the following:
Code Block | ||
---|---|---|
| ||
brew install postgresql |
To start PostgreSQL temporarily, you can run brew services run postgresql
. For more information on services via Homebrew, run brew services --help
.
...
On Debian-based distributions (i.e. Ubuntu or Linux Mint):
Code Block | ||
---|---|---|
| ||
apt install libpq-dev python3-dev postgresql postgresql-client |
For RHEL-based distributions (i.e. CentOS/Fedora):
Code Block | ||
---|---|---|
| ||
dnf install libpq-devel python3-devel postgresql-server |
For Arch Linux (Additional configuration may be required after install. Check the Arch Wiki):
Code Block | ||
---|---|---|
| ||
pacman -S postgresql-libs postgresql |
...
You'll most likely want to create a virtualenv to install things. For example:
Code Block | ||
---|---|---|
| ||
python3 -m venv virtualenv |
...
Once done, ensure you install requirements:
Code Block | ||
---|---|---|
| ||
pip3 install -r requirements.txt # Useful for reading .flaskenv. pip3 install python-dotenv |
...
Run in development mode, and enjoy!
Code Block | ||
---|---|---|
| ||
flask run --host :: --port 80 |
...