.. | ||
templates | ||
.env_sample | ||
.gitignore | ||
README.md | ||
requirements.txt | ||
server.py |
Example Server with mCaptcha protection
The example server shows a dummy form with the mCaptcha widget. When the form is submitted, it validates the authorization token presented by the visitor against the mCaptcha instance that the server is configured with.
The example server is built with the Flask webframework and uses the Python API library for mCaptcha for validation.
1. Configuration
Before running, please configure the server:
cp .env_sample .env
And fill in the configuration parameters in .env
file with:
- Sitekey
- Account secret: Available in the settings page on the mCaptcha dashboard
- Instance URL
2. Install dependencies
virtualenv venv && . venv/bin/activate && pip install -r ./requirements.txt
3. Launch server
flask --app server run
If all configuration parameters are properly filled in, the example server must work.