Table of Contents
Simple Python web application, that shows current time in Moscow. The time updates with a page refreshing. This project was developed within the DevOps Engineering course in Innopolis University. The Flask framework was used to adapt the python code to web app. More about best practices used you can read in PYTHON.md in app_python folder.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Download the project using
git clone https://github.com/mari1647iv/devops.gitSet up the environment using setup.py:
python3 -m venv venv
source venv/bin/activate
pip install .or install the requirements manually:
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r app_python/requirements.txtStart the application:
cd app_python
python3 main.pyAs a result you will get the project running on your localhost with port 5000
* Serving Flask app "main" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 830-674-667The application could be built and running using Docker.
Download the project using
git clone https://github.com/mari1647iv/devops.gitBuild docker image:
cd app_python
docker build --tag mari1647iv/devops:app_python .or pull it from the Docker Hub repository:
docker pull mari1647iv/devops:app_pythonRun the docker image
docker run -p 5000:5000 mari1647iv/devops:app_pythonTo run it in detached mode use:
docker run -d -p 5000:5000 mari1647iv/devops:app_pythonThe application is running locally on port 5000. The web pages demonstrates the current time in Moscow. As the page is refreshed the time updates correspondingly.
Press CTRL+C in terminal to stop the application.
Do not forget to leave the virtual environment:
cd ..
deactivate/- root path with current Moscow time/visits- list of the root path/visits by the client.
Unit tests are written in python using unittest framework and stored in test_main.py file.
To run the tests you can use the following command in the app_python folder:
python3 -m unittest test_main.pyMarina Ivanova, Innopolis University BS18-SE-01
- Github: @mari1647iv
- Email: m.ivanova@innopolis.university
Project Link: https://github.com/mari1647iv/devops
Distributed under the MIT License. See LICENSE.md for more information.