This is a shopping list webapp built in flask/python without JS
Python version: 3.10.1
It is good practice to create a virtual environment for the project this can be done in the folder root folder using the following windows (or equivalent) terminal commands
> py -m venv venv
> venv\Scripts\activate
> py -m pip install -r requirements.txt
note: if you do not activate the venv before installing the requirements.txt, then it will be installed in your main python directory
In-order to connect to a database either create a file in ./shop/ called 'config.py' this must contain the folowing variables (shown using mysql):
secret_key = '<- add secret key here ->'
database_uri = 'mysql+pymysql://<- DB Password ->@<- DB domain/IP (localhost normally) ->/<- DB Name ->'
debug_setting = <- True or False ->
replace the <- -> with the correct info
or
app.config['SECRET_KEY'] = db_var.SECRET_KEY
app.config['SQLALCHEMY_DATABASE_URI'] = db_var.SQLALCHEMY_DATABASE_URI
Use the following python commands to generate a secret key:
> python
>>> import os
>>> os.urandom(24).hex()
you can use the following commands:
> python
>>> from main import db
>>> db.create_all()
Copyright © 2022 Alexander A Deverson, Durigy
Licensed under the MIT License