this repository is deprecated since it was written to use pyusermanager v1.0.5 which is deprecated
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
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)
in line 8 you finde the following
config={"api_url":"http://172.28.117.204:1337"}
its the api url for the api backend
- 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)
for Debian/Ubuntu you need libev-dev to install bjoern
- git clone --recurse-submodules https://github.com/Aurvandill137/pyusermanager_reference_implementation
- cd web_interface/jquery
- npm run build
and you are done
- head into the api subfolder
- run api.py with python3
- head into the web_interface Folder
- run base.py with python3