> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Required Configuration

To use the middleware on a specific route follow this example:

```python
from perimeterx.middleware import PerimeterX

px_config = {
    'px_app_id': 'PX_APP_ID',
    'px_cookie_secret': 'PX_COOKIE_KEY',
    'px_auth_token': 'PX_AUTH_TOKEN',
}
application = get_wsgi_application()
application = PerimeterX(application, px_config)
```

* The **Application ID** / **AppId** and **Token** / **Auth Token** can be found in the Portal, in [Applications](https://console.humansecurity.com/#/app/applicationsmgmt).
* HUMAN **Risk Cookie** / **Cookie Secret** can be found in the portal, in [Policies](https://console.humansecurity.com/#/app/policiesmgmt).\
  The Policy from where the **Risk Cookie** / **Cookie Secret** is taken must correspond with the Application from where the **Application ID** / **AppId** and **Token** / **Auth Token**.\
  For details on how to create a custom Captcha page, refer to the [documentation](https://console.perimeterx.com/docs/server_integration_new.html#custom-captcha-section)