PyLicense is a license validation and management solution for your Python projects. It enables you to check, validate, and manage licenses within your Python applications.
pip install -r requirements.txt
1 - Locate the directory
cd licensing
2 - Migration operations
python manage.py migrate
3 - Create a superuser
python manage.py createsuperuser
4 - Run API
python manage.py runserver
Login your admin panel from https://your-domain.com/admin/
and add new license from Licenses area.
POST request to /api/licenses (login required!)
{
"key":"ENTER_EXAMPLE_LICENSE_KEY",
"author":1
}
author 1 is a default for admin user.
Login endpoint: /api/login
.
# Test application using PyLicense
import pylicense
API_URL = 'http://127.0.0.1:8000/api/licenses' # Enter your pylicense api
def main():
username = input('username: ')
password = input('password: ')
license = pylicense.License(API_URL,app_key='examplekey1')
operation = pylicense.run(API_URL, username, password, license=license)
# Controller
for x in operation: # x: License object
check = license.check_license(x['key'])
if check:
print('License found!')
else:
print('License not found!')
if __name__ == '__main__':
main()
This project is licensed under the GPLv3.0 License. For more information, please see the LICENSE file.