Basic structure for starting a Flask project with basic role based security.
CREATE TABLE users (
id INT(11) AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(100),
username VARCHAR(30),
password_hash VARCHAR(128),
access INT(11), register_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-
Create the database table.
-
Start the application and register a new user from the webpage
-
In the database users table, change access to
2
for admin -
Log in to the application as this new user
-
Clone this repository to local computer
-
Rename the directory to reflect the new project name
-
Delete .git folder
-
Create a new virtual environment.
python -m venv ./venv
-
Activate the new virtual environment
- Windows:
.\venv\Scripts\activate
- Mac:
source ./venv/bin/activate
- Windows:
-
Install the dependencies
pip install -r requirements.txt
-
Make a new repository by running
git init
in the folder. -
Track all the files in the new local repository
git add .
-
Make the first commit of this new project
git commit -m 'first commit of <project name>
from flask_template -
On Github, create a new repository. DO NOT initialize it
-
Connect the local repository to the new Github repository
git remote add origin <<repository_URL>>
-
Create and change to a new local development branch
git checkout b development
-
Continue working with the project as you normally would.