A simple recipe-based web application that allows users to store their favorite recipes and view each others. Web app uses MySQL to store user and their recipe data.
Before you get started, make sure you have the following installed:
- Python 3.8 or up
- Django 3.1 or up
- Docker
- MySQL
To run the app locally, follow these steps:
- Clone the repository:
git clone (https://github.com/KlauMack/fs-task.git)
- Change into the project directory:
cd fs_task - Create a virtual environment (optional but recommended):
python -m venv env
- Activate the virtual environment:
- Linux/Mac:
source env/bin/activate - Windows:
env\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
To run the Django app locally, use the following command:
python manage.py runserverAccess the app in your web browser at http://localhost:8000.
To run the app using Docker, follow these steps:
- Build the Docker image:
docker build -t <image_name> .
- Run the Docker container:
docker run -p 8000:8000 <image_name>
- Access the app in your web browser at http://localhost:8000.
To set up the MySQL database, follow these steps:
- Create the necessary database schema and tables.
- Modify the
Dockerfileanddocker-compose.ymlfiles to connect to your MySQL database.
To run the unit tests for your Django app, follow these steps:
- Make sure you have set up the development environment and installed the required dependencies as mentioned in the Installation section.
- Open a terminal or command prompt and navigate to the project's root directory (where the manage.py file is located).
- Run the following command to execute the unit tests:
python manage.py test
This command will discover and run all the unit tests found in your app's tests.py files.