University of Liverpool 2022/23 COMP208 Group Software Project - Team 16: Project Source Code
This is the code repo of COMP208 Team 16.
Online Demo: lcda.space
Think twice before git PUSH. 三思而后行(Chinese) It may affect other contributors and the web server.
Please ensure that your push does not interfere with the normal function of the original. Please carry out tests first.
Please follow the conventional commit specification when committing.
You can use commitlint to assist you in writing commit messages.
Python requirements files are a great way to keep track of the Python modules. It is a simple text file that saves a list of the modules and packages required by your project. By creating a Python requirements.txt file, you save yourself the hassle of having to track down and install all of the required modules manually. Reference
This is one of the key file for deployment. Deployment fails if the package used is not in this list. So make sure that you update the requirements.txt file when using new Python packages.
Install pipreqs if you don't have it.
pip install pipreqs
Alternatively, in conda virtual environment:
conda install -c conda-forge pipreqs
If you have installed pipreqs, you can use the following command to generate requirements.txt
in the current directory
pipreqs . --encoding=utf8
We recommend using conda virtual environment, such as Anaconda or miniconda to manage your virtual environment.
Be cautious using Pip in a Conda environment. Read more
If the package is not available in conda default channel, you can search "conda [package name]" in Google to find the package in correct channel.
If the package is not available in conda, you can use pip to install it.
Offical documents:
- Flask: English | 简体中文
- Flask-SQLAlchemy: English
- Flask-Email: English
- Vue: English | 简体中文
- Bootstrap: English | 简体中文
- MDBootstrap: English
- Jinja2: English | 简体中文
Unofficial documents
- Flask extension documentation: 简体中文
You can find the YAML file environment.yml
here.
-
Create the environment using yaml file (make sure you are in the root directory of the project):
conda env create -f ./misc/environment.yml
-
Activate the new environment:
conda activate COMP208
-
Verify that the new environment was installed correctly:
conda info --envs
Alternatively, you can update your environment using:
conda env update --name COMP208 --file ./misc/environment.yml --prune
Please remember to update the YAML file after installing new python packages.
Maintaining YAML files manually instead of generating them automatically can ensure that the file is compatible with both x86 and arm64 architectures.
Please use conda first to install python packages. Mixed use of conda and pip might cause some problems. Chances are, some packages would only be available through pip.
Jetbrains IDEs will automatically detect the requirements.txt file. Click "Install" to install all the packages. (Recommended)
Or you can use one of the following commands to install the packages:
# Use conda
conda install --yes --file requirements.txt
# Use pip
pip install -r requirements.txt
You can learn more about git from git-scm.com: English | 简体中文
Or you can read “Flight rules for Git” for a more accessible tutorial: English | 简体中文