This package contains the web interface for FlexTool 3, an energy systems optimization model for power and energy systems with high shares of wind and solar power. A web server and a browser are needed to use the interface. If you already have a server running somewhere, just point your browser there and you are good to go. However, it is also possible to run the server and use the interface on a local installation. The instructions below guide through the process to do just that.
A link to the Flextool User Guide is available in the top right corner of the interface, next to the Logout button.
Currently, the only supported method is installation from the Git repository. Instructions to install into a conda environment are provided below, though Python's virtual environment would work equally well.
Install Miniconda if you don't have conda yet.
- Open a conda prompt.
- Create a new Python 3.8 environment:
conda create -n flextool3-web-interface python=3.8
- Activate the environment:
conda activate flextool3-web-interface
- If you don't have Git installed yet, install it in conda:
conda install git
cd
to a directory where you want the store the application.- Clone the repository. This will create a new directory
flextool-web-interface
.git clone --recurse-submodules https://github.com/irena-flextool/flextool-web-interface.git
cd
to the newly created directory:cd flextool-web-interface
- Make sure Python's
pip
package is up-to-date:python -mpip install --upgrade pip
- Install Python packages that are required by FlexTool:
python -mpip install -r requirements.txt
- Initialize server database and create a (super) user account
(the password need not be secure/complicated on local server
and warnings regarding it can be safely ignored):
python init.py
- Open a conda prompt.
- Activate the
flextool3-web-interface
environment:conda activate flextool3-web-interface
cd
to theflextool-web-interface
directory that was set up during installation.- Start local web server:
The server will continue to run and log on the prompt until it is stopped by the user.
python manage.py runserver
- Point your browser to
http://localhost:8000/flextool3/
. - If asked, log in with the account created in Installation.
- Press Ctrl+C in the conda prompt where the server is running or just close the window.
- Open a conda prompt.
- Activate the
flextool3-web-interface
environment:conda activate flextool3-web-interface
cd
to theflextool-web-interface
directory that was set up during installation.- Pull the latest changes:
git pull
- Make sure the Python environment and server database are up-to-date:
python upgrade.py
Install dev-requirements.txt
to get the Python packages needed for development.
node.js and yarn package manager are needed to build the browser app.
The master project template is located in <repository root>/flextool3/master_project
.
The directory is a git submodule
and can be updated to the latest version by
cd flextool3
cd master_project
git checkout master
git pull
cd ..
cd ..
Before committing the changes it is good idea to run the unit tests to ensure that the master project is still compatible with the website.
python manage.py test
It is OK to commit if the tests pass:
git add -A
git commit