Skip to content

BAK2K3/PythonClassesSeminar

Repository files navigation

Code Institute - Python Classes Live Coding Seminar

This GitHub Repo contains all of the files created during the Python Classes Live Coding Seminar.

Python Meme

Overview

Throughout the seminar, a basic Flask application was created which performs all basic CRUD operations on a MongoDB database.

app_basic.py

This python file is the initial Flask application, where the functionality is implemented using basic and procedural programming.

app_function.py / example_functions.py

These python files demonstrate the refactored functionality, replacing the basic and procedural functionality with re-usable, clear, and seperated functions.

app.py / example_classes.py

These python files demonstrate how recurring data structures and their associated methods can be grouped into classes, to allow for the appropriate seperation of concerns, and improved readability of code.

/static and /templates

These folders hold the neccessary HTML and CSS required for Flask and Python to generate web content.

How to Run

In order to test this code, please run pip install -r requirements.txt.

You will need the following environment variables:

"SECRET_KEY"
"MONGO_URI"
"MONGO_DBNAME"

Run the program with python app.py.

Note:

Whichever method of implementation you would like to test (basic, functions, or classes), replace the app.py file with the chosen file. For example, change app.py to app_classes.py and rename app_function.py to app.py if you would like to test the flask application using the functions implemented throughout the serminar.

Further Reading

For interesting takes on Classes in Python, please see Stop Writing Classes, Start Writing More Classes, and Stop Writing Stupid Classes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published