Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

About

a reference implementation of pyusermanager in an api backend!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notice

this repository is deprecated since it was written to use pyusermanager v1.0.5 which is deprecated

pyusermanager

PyPI version Supported python versions
Black badge
Documentation status

1. Info

this is an example implementation of pyusermanager in an api backend for a webiste where you can do the following

  • Log In
  • Log Out
  • Register
  • Delete own Account
  • Delete other Accounts as admin
  • do changes to your account
  • change other accounts as admin

1.1. Table of Contents

2. Configuration

2.1. api.py (api)

you can find the following code in api.py in

if __name__ == "__main__":
    #init db config
    db_config = DB_Config(provider = "mysql", host = "127.0.0.1",port = 3306, user = "test", pw = "test123", db_name = "users")

    #init db config with db config and other parameters
    config = LoginConfig(  
                    db_config=db_config,
                    debug = True,
                    auto_activate_accounts = False,
                    admin_group_name="administrator"
                    )

all config parameters should be self explaining

you can also change the default user the api creates here

create_user(uname="admin", pw="12345", email="test@local", auth=AUTH_TYPE.LOCAL)

2.2. base.py (web_interface)

in line 8 you finde the following

config={"api_url":"http://172.28.117.204:1337"}

its the api url for the api backend

3. How to install

3.1. pip modules

  • pyusermanager >=1.0.5
  • bottle
  • bjoern
    • you could also use any other wsgi server like gevent or just the reference
  • npm (to install jquery which is required for the frontend)

3.2. Misc.

for Debian/Ubuntu you need libev-dev to install bjoern

3.3. Clone the repository

3.4. build jquery

  • cd web_interface/jquery
  • npm run build

and you are done

4. How to run

4.1. API

  • head into the api subfolder
  • run api.py with python3

4.2. Web Interface

  • head into the web_interface Folder
  • run base.py with python3

About

a reference implementation of pyusermanager in an api backend!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages