This repository contains test code for creating a login and registration window. This code also establishes communication with a database to store all the records and to be able to verify the access credentials of the clients.
For this project it is recommended to use pgAdmin4
as database manager.
First of all, a table called client
was created to store the information about the client's login. These dice are used to validate the login.
-
This table contains a unique id for each client automatically generated using
SERIAL
. This method is advantageous in an environment with recurrence because the database manager itself generates and processes the ID. -
The password is encrypted using a plsql extension called
pgcrypto
-
The
registration_dat
is completed by a trigger during a table insert
In the python code, two windows are created, one with the longin and the other with the registration form. Whenever one window is open the other remains hidden.
The table is protected. Ou seja, when a user registers but an error occurs, all the dice entered are ignored and the last safe commit is returned.
# Transition: Either all data is sent correctly or none is sent
try:
cur.execute("QUERY")
conn.commit()
except Exception:
conn.rollback()