Configuration Reference¶
PyLocket is configured through environment variables. This reference covers all configuration options available to developers using the PyLocket platform.
Client Configuration¶
CLI Credentials¶
| File | Path | Description |
|---|---|---|
| Credentials | ~/.pylocket/credentials |
Stored auth tokens (auto-managed by pylocket login) |
Environment Variables¶
| Variable | Description | Default |
|---|---|---|
PYLOCKET_TOKEN |
API authentication token | — |
PYLOCKET_API_URL |
API base URL | https://api.pylocket.com |
PYLOCKET_FORCE_INCLUDE |
Comma-separated module names to always protect. Local engine runs only — the hosted service runs the engine on PyLocket's infrastructure, so this has no effect with pylocket protect. Use pylocket.toml or the build API's force_include instead. |
— |
PYLOCKET_FORCE_EXCLUDE |
Comma-separated module names to never protect. Same caveat as above — use pylocket.toml or the build API's force_exclude. |
— |
See Module Selection for details on controlling which modules are protected.
End-User Runtime Environment Variables¶
These variables are read by protected applications at runtime on the end user's machine.
| Variable | Description | Default |
|---|---|---|
PYLOCKET_LICENSE_KEY |
License key for automatic activation (skips the interactive prompt) | — |
Set PYLOCKET_LICENSE_KEY to activate silently — useful for server deployments, Docker containers, and CI/CD environments where interactive prompts are not practical.
Application-Level Configuration¶
These settings are configured per-app through the CLI, API, or Developer Portal.
Protection Settings¶
| Setting | CLI Flag | API Field | Description | Default |
|---|---|---|---|---|
| Target platform | --platform |
platform |
OS + architecture | CLI: auto-detected from your OS. API: required |
| Python version | --python |
python_version |
Bytecode version | Engine-detected from the artifact (API: optional since v1.2.218) |
Every build receives maximum protection automatically. No protection level configuration is needed.
Licensing Settings¶
| Setting | CLI Flag | API Field | Description | Default |
|---|---|---|---|---|
| Device limit | --device-limit |
device_limit |
Max devices per license | 2 |
| Offline use | — | — | How long an activated app keeps working with no network, counted from the last time it reached PyLocket. The same for every app; not configurable | 14 days (a free trial: until the trial ends) |
| License expiration | --expires (YYYY-MM-DD) |
create: license_config.expiry_days (integer days); update: expiry_date (datetime) |
License expiry date | None (perpetual); free tier forces 30 days when --expires is omitted |
| License type | --type (standard/demo) |
license_config.license_type (perpetual/subscription/trial) |
CLI standard maps to API perpetual; CLI demo maps to API trial. A trial is a free trial: never charged the per-license fee, at most 14 days (--expires further out is rejected), one trial per computer per app, and the app must have Allow free trials on |
standard |
See Also¶
- Getting Started — Initial setup
- CLI Reference — Command-line options
- REST API Reference — API endpoints