3

werkzeug_movie_app

 3 years ago
source link: https://gitlab.com/patkennedy79/werkzeug_movie_app
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Overview

This project demonstrates how to use Werkzeug (key module of Flask) to build a web application.

The application stores your favorite movies in a Redis in-memory data store:

Installation Instructions

Pull down the source code from this GitLab repository:

git clone [email protected]:patkennedy79/werkzeug_movie_app.git

Create a new virtual environment:

$ cd werkzeug_movie_app
$ python3 -m venv venv

Activate the virtual environment:

$ source venv/bin/activate

Install the python packages in requirements.txt:

(venv) $ pip install -r requirements.txt

Run the Development Server

In the top-level directory, run the Werkzeug development server to serve the application:

(venv) $ python app.py

Navigate to 'http://localhost:5000' to view the website!

Key Python Modules Used

  • Werkzeug - collection of libraries that can be used to create a WSGI (Web Server Gateway Interface) web application in Python.
  • Jinga - templating engine
  • py-redis - Python interface to Redis data storage

This application is written using Python 3.9.2.

Testing

To run all the tests:

(venv) $ pytest -v

To check the code coverage of the tests:

(venv) $ pytest --cov-report term-missing --cov=app

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK