-
Clone the Repository:
git clone https://github.com/fadi002/pyauth
-
Install Dependencies:
cd python pip install -r requirements.txt
-
Configuration:
- Generate a random secret key and admin control password. You can run the configuration script provided:
python configure.py
- Follow the prompts to generate the secret key and control password. Optionally, you can provide your own admin password.
- Generate a random secret key and admin control password. You can run the configuration script provided:
-
Database Initialization:
- If the database doesn't exist, it will be initialized automatically.
-
Run the Application:
python main.py
-
Access the Website:
- Once the application is running, you can access it in your web browser at
http://localhost:5000
.
- Once the application is running, you can access it in your web browser at
-
Initialization
- Initialize the
License
class instance:license_in = License()
- Initialize the
-
Checking Internet Connectivity
- Use the
check_internet()
method to check if the client has an internet connection:if license_in.check_internet(): print("Client has an internet connection") else: print("Client doesn't have an internet connection")
- Use the
-
Initialization
- Initialize the license system using the
initialize()
method:if license_in.initialize(): print("License system initialized successfully") else: print("Failed to initialize the license system")
- Initialize the license system using the
-
Login
- Use the
login()
method to authenticate with a license key:status = license_in.login("USER LICENSE HERE") if "valid" in status["status"]: print("Logged in successfully") elif "suspended" in status["status"]: print("License has been suspended") elif "banned" in status["status"]: print("License has been banned") else: print("Invalid or tampered response")
- Use the
Here's an example demonstrating the usage of the license management system:
from lib import License
# Initialize License class instance
license_in = License()
# Check internet connectivity
if license_in.check_internet():
print("Client has an internet connection")
else:
print("Client doesn't have an internet connection")
# Initialize license system
if license_in.initialize():
print("License system initialized successfully")
else:
print("Failed to initialize the license system")
# Login with license key
status = license_in.login("USER LICENSE HERE")
if "valid" in status["status"]:
print("Logged in successfully")
elif "suspended" in status["status"]:
print("License has been suspended")
elif "banned" in status["status"]:
print("License has been banned")
else:
print("Invalid or tampered response")