This repository contains a licensing service developed as a side project while working at Paracosma. The service includes an admin panel for generating serial keys and a user interface for assigning and checking the validity of these keys.
- Admin panel for generating 16-digit serial keys
- User interface for assigning serial keys to devices
- Check the validity of serial keys
- Track the usage and activation of serial keys
-
Clone the repository:
git clone https://github.com/kamalkhnl/licensing_service.git cd licensing_service -
Create and activate a virtual environment:
python3 -m venv .venv source .venv/bin/activate -
Install the required dependencies:
pip install -r requirements.txt
-
Apply the migrations:
python manage.py migrate
-
Create a superuser for the admin panel:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
- Access the admin panel at
http://127.0.0.1:8000/admin/. - Log in with the superuser credentials.
- Generate serial keys using the "Serial Keys" section.
-
Assign Key:
POST /keys/assign_key/- Request body:
{ "key": "YOUR_SERIAL_KEY", "device_id": "YOUR_DEVICE_ID" } - Response:
{ "status": "success", "message": "Key activated" }
- Request body:
-
Check Key:
POST /keys/check_key/- Request body:
{ "key": "YOUR_SERIAL_KEY", "device_id": "YOUR_DEVICE_ID" } - Response:
{ "status": "success", "message": "Key activated" }
- Request body: