- Overview
- Features
- Setup Instruction
- Running the Flask Application
- Key Python Modules Used
- Testing
- To Do
This Flask application implements a basic user management system that can be used as a starting point for more compleplex Flask applications.
- Register
- Loging
- Logout
- Change Password
- Clone repository:
$ git clone https://github.com/manoelteixeira/user-management.git
- Create a new virtual environment:
$ cd user-management $ python3 -m venv venv
- Activate virtual environment:
$ source venv/bon/activate
- Install required python packages (specified in requirements.txt):
(venv) $ pip install -r requirements.txt
- Install Pipenv:
$ pip install pipenv
- Clone repository:
$ git clone https://github.com/manoelteixeira/user-management.git
- Create a new virtual environment and install required python packages:
$ pipenv install
Activate virtual environment:
- venv:
$ source venv/bon/activate
- pipenv:
$ pipenv shell
- Manual setup (need to be executed every time the virtual environment is activated):
$ export APPLICATION_SETTINGS=../app_settings.cfg $ export FLASK_APP=app.py $ export FLASK_DEBUG=true
- Automatic setup:
- Install python-dotenv:
$ pip install python_dotenv
- Create a
.env
file and add:APPLICATION_SETTINGS=../app_settings.cfg FLASK_APP=app.py FLASK_DEBUG=true
- Install python-dotenv:
-
Using Flask command line command:
flask init-db
-
Using
Flask shell
:flask shell
from app import db import app.models db.drop_all() # if database file already exists db.create_all() # create all tables exit()
Running the application:
After activating the virtual environment, setting up the Flask virtual environments and initializing the database (if needed):
(venv) $ flask run
- Activate virtual environment
or
$ source venv/bon/activate
$ pipenv shell
- Install pytest package:
or
$ pip install --dev pytest
$ pipenv install --dev
- Running tests:
$ python -m pytest -v
- Email confirmation
- Password recovery
- Improve UX and UI