Skip to main content

Libraries that have models and methods to handle user authentication

Project description

FISHAUTH

FISHAUTH is a library that allows you to manage models to create an authentication system

Installation

To install, run pip install fishauth

Basic Usage

Usage of Alembic starts with creation of the Migration Environment. This is a directory of scripts that is specific to a particular application. The migration environment is created just once, and is then maintained along with the application’s source code itself. The environment is created using the init command of Alembic, and is then customizable to suit the specific needs of the application.

The structure of this environment, including some generated migration scripts, looks like:

yourproject/
alembic/
    env.py
    README
    script.py.mako
    versions/
        3512b954651e_migrations1.py
        2b1ae634e5cd_migrations2.py
        3adcc9a56557_migrationsN.py

Now in env.py in our alembic folder, we have to make some changes. To detect auto changes by alembic we need to give our model path to env.py

# env.py

from fishauth.models.base import Base as BaseFish
target_metadata = [BaseFish.metadata,...,Base.metadata1,Base.metadata1,Base.metadataN ]

As shown above, we have to give the model base file to alembic env file. Now we are all set for our first migration.

alembic revision --autogenerate -m "First commit"

Using the above command alembic generate our first migration commit file in versions folder. you can see the version file now in the versions folder.

Once this file generates we are ready for database migration.

alembic upgrade head

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fishauth-0.1.7.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

fishauth-0.1.7-py3-none-any.whl (12.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page