A Flask web application that can be used to help new students find their Halls of Residence flatmates.
This guide will walk you through the steps to set up and run the "Halls Flatmate Finder" project on your local machine.
Before you begin, ensure that you have the following installed on your system:
- Python (version 3.6 or later) (3.10.8 recommended)
- Git
-
Open your terminal or command prompt.
-
Navigate to the directory where you want to store the project.
-
Run the following command to clone the repository:
git clone https://github.com/corey-richardson/halls-of-residence-flat-finder.git
- Navigate to the project directory:
cd halls-of-residence-flat-finder
- Create a virtual environment (recommended but optional):
python -m venv venv
- Activate the virtual environment:
- Windows
venv\Scripts\activate
- Linux, maxOS, GitHub Codespace
source venv/bin/activate
- Install required packages from
requirements.txt
using pip:
pip install -r requirements.txt
To update requirements, run
pip freeze > requirements.txt
.
- Run the
pytest
command below.
pytest -v --no-header | tee tests/results.txt
The
pytest
tests will run, and you will see the test output in the terminal as well as in theresults.txt
file in thetest/
directory.
-
In the project directory, you'll find a file named app.py. This is the main Flask application file.
-
Run the application using the following command:
flask run
By default, the application should start on 127.0.0.1:5000/ in your web browser.
- Open your web browser and navigate to 127.0.0.1:5000/. You should see the "Halls Flatmate Finder" application running.
-
To stop the Flask application, go back to the terminal where the application is running and press Ctrl+C.
-
If you used a virtual environment, you can deactivate it by running:
deactivate
You've successfully installed and run the "Halls Flatmate Finder" project on your local machine.