Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This guide will help you with self hosting Food Server.

If you decide to self-host, you will need a basic understanding of Python as well as Python 3. Having familiarity with databases will also assist.

Table of contents

Setting up Postgres

We recommend using PostgreSQL for the database, as this is tested, and the recommended configuration. Installation of libpq or an equivalent is required to sate food-server's requirement of psycopg2. While others will likely work as SQLAlchemy is used, we will not provide support for such configurations.

You may wish to install a tool such as pgAdmin to easily make database changes.

We have no info on setting up an environment for Windows yet, you should get by with WSL

MacOS

Assuming you use Homebrew, run the following:

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.

Linux

On Debian-based distributions (i.e. Ubuntu or Linux Mint):

apt install libpq-dev python3-dev postgresql postgresql-client

For RHEL-based distributions (i.e. CentOS/Fedora):

dnf install libpq-devel python3-devel postgresql-server

For Arch Linux (Additional configuration may be required after install. Check the Arch Wiki):

pacman -S postgresql-libs postgresql

Many package managers will start PostgreSQL automatically. Typically, you can run systemctl start postgresql to ensure this. Refer to your distribution's documentation for further information.

Setting up the development environment

You'll most likely want to create a virtualenv to install things. For example:

python3 -m venv virtualenv

Ensure you activate the environment via source venv/bin/activate.

Once done, ensure you install requirements:

pip3 install -r requirements.txt
# Useful for reading .flaskenv.
pip3 install python-dotenv

You will need to copy config-example.py to config.py and edit accordingly.

Starting food-server

Run in development mode, and enjoy!

flask run --host :: --port 80

For development, we recommend using dev.wiilink24.com as the base domain, resolving to 127.0.0.1. A web panel is available as subdirectory /thepantry/. Its default credentials are username admin/password admin. Please change them.

  • No labels