The Starter Kit includes only the theme source code(sass, js, media, fonts and icons) from the HTML version, build tools(Gulp, Webpack),
layout views and general pages(index, authentication, error) integration.
To use any feature shown in the HTML version just copy & paste the HTML code and include required assets(css, js) using the Theme Api.
Check the boxes next to “Install launcher for all users (recommended)” then click “Install Now”.
After installation, open the command prompt and check that the Python version matches the version you installed by executing:
python --version
Install Flask
Flask can be installed easily using pip. Within the activated environment, use the following command to install Flask:
Before you work on your project, activate the corresponding environment. In the command prompt within the project folder starterkit.
For macOS/Linux:
. venv/Scripts/activate
For Windows:
venv\Scripts\activate
Your shell prompt will change to show the name of the activated environment.
In the command prompt and execute the following command:
pip install Flask
Flask is now installed.
Build assets
Before running the application we need to build theme assets:
Start a command prompt window or terminal and change directory to starterkit/_keenthemes/tools
cd starterkit/_keenthemes/tools
Install dependencies with either one, yarn or npm:
yarn install
You can use either one.
npm install
This command will fetch all dependencies listed in starterkit/_keenthemes/tools/package.json and place them into _keenthemes/tools/node_modules folder.
You can use Gulp
or Webpack commands to bundle theme assets.
The below command will compile all the assets(sass, js, media) to starterkit/assets folder:
For gulp use command:
gulp
For webpack use command:
npm run build
Note on the package.json file. This step is very important for Webpack in Good template. The default package.json works for Gulp. To make it work for Webpack, you have to modify tools/package.json and remove "type": "module".
Otherwise, it will cause compilation error when running the build command.
Run Flask
To run the Flask application navigate your prompt to starterkit folder and run the following command.
Navigate your prompt to starterkit folder.
cd starterkit
For macOS/Linux only, this step is required. Navigate to the directory where the run.sh script is located using the cd command. Make the script executable using the chmod command:
chmod +x run.sh
For macOS/Linux, run the script by typing its name and pressing Enter:
./run.sh
For Windows:
run.bat
For debug mode, use --debug flag. Eg. ./run.sh --debug
In essence, this script automates the setup of a Python virtual environment, installation of package dependencies, and the execution of a Flask web application. It's designed to be cross-platform, accommodating both macOS/Linux and Windows systems. The use of the virtual environment helps manage package dependencies independently of the system-wide Python installation. The script also allows for running the Flask app in debug mode if specified.