This is a website made By Omar Barakat That has alot of functionalities to apply DevOps tools and technicques
- Text To QRcode Generator
- Password Generator
- Weather Provider
- Real Time Clock
- Maps Provider
- To-Do List
Finally To Create Virtual Enviroment:
python3 -m venv venv
Now you created venv folder which is your virtual enviroment To run terminal commands inside the virutal Enviroment use
On Linux
source venv/bin/activate
On Windows
venv\Scripts\activate
Note that ~/Project_directory
is the location you've selected on your PC make sure you're in venv (Virtual Enviromnet)
git clone https://github.com/omarbarakota/DevOps_Project.git
cd venv
pip install -r requirments.txt
the application will be available at http://localhost:8000
gunicorn wsgi
-
Run All tests:
Use
python3 -m pytest
to execute the test suite for the application: That file has all scripts to be runpython3 -m pytest
This ensures all functionalities are working correctly.
-
Run Specific test:
Open the terminal in
/tests
file and make sure that the project is running Usepython3 tests_name.py
to execute the needed test case:python3 tests_name.py
This ensures each functionality is working correctly.
-
Virtual Environment: Utilization of
venv
for package management, ensuring a clean environment isolated from system-wide Python packages. -
Separation of Concerns: HTML templates are stored in the
templates/
directory, maintaining separation between front-end and back-end logic. -
Testing: Integration of automated tests (
pytest
) to verify application functionality, ensuring reliability and consistency.
DevOps Project
│
└── main.py # Main Flask application file
├── templates/ # HTML templates (separation of concerns)
│ └── index.html # Main page template
│ └── Generate.html # Page that generates QR Code template
│ └── Password.html # Page that generates Password template
│ └── Weather.html # Page that Get the weather of a city
├── tests/
│ └── test_qr.py # Test QR generation feature for the application
│ └── test_tasks.py # Test Do do list features for the application
│ └── test_time.py # Test time display for the application
│ └── test_weather.py # Test weather display feature for the application
│ └── test_password.py # Test suite for the application
└── requirements.txt # List of dependencies
To make all libraries, verions and dependencies together to easy download them later (Don't not run this command)
pip freeze > requirments.txt
-
make all new test files in
/tests
folder -
Any new test files are created add it in
run_test.py
-
all new HTML files put it in
/templates
folder -
whenever you want to deactivate your virtual enviroment
source deactivate