Skip to content

Running the Web Application

Dave Walker edited this page Aug 19, 2024 · 2 revisions

These instructions describe how to run the application from a local working copy of the repository. For instructions on how to run the pre-built container image, see the section on "Docker and Docker Compose".

Pre-requisites

To create the database for the first time, a virtual environment should be created, the requirements should be installed from the "requirements.txt" file using pip and the environment should be activated.

Running the Application

To run the web-based application in the Flask development web server, first open a terminal window and then change to the enter the "src/naturerec_web" folder. Then, run the following commands:

Windows

$env:NATURE_RECORDER_DB="$pwd\data\naturerecorder.db"
$env:PYTHONPATH="$pwd\src"
$env:FLASK_ENV="development"
python -m naturerec_web

Linux or MacOS

export NATURE_RECORDER_DB="`pwd`/data/naturerecorder.db"
export PYTHONPATH=`pwd`/src
export FLASK_ENV=development
python -m naturerec_web

Once the development server is running, browse to the following URL in a web browser:

http://127.0.0.1:5000/

The application is also available as a Docker image and can be run using Docker Compose. Please see the section on Docker and Docker Compose for more details.