Using PKI Express on Python
This article describes how to use PKI Express on Python
Sample project
The sample project shows the usage of PKI Express together with the Web PKI browser component on a Python project. It is hosted on GitHub:
https://github.com/LacunaSoftware/PkiSuiteSamples/tree/master/python/flask
Note
If you are using a previous version of Ptyhon, please contact us.
Running the project
- Install PKI Express
- Download the project or clone the repository
- In a command prompt, navigate to the folder
Python/Flask
and run the commandpip install -r requirements.txt
to download the dependencies - Define the
FLASK_APP
environment variable to define the name of app the should be run:FLASK_APP=sample
- Run the web application:
flask run
orpython -m flask run
- Access the URL: http://localhost:5000
Optionally, you can create and activate a "virtualenv" to avoid mixing library versions:
virtualenv <venv>
source bin/activate (on Windows: ./<venv>/Scripts/activate)
PyPi package
In order to use PKI Express on Python, you must includ the PyPi package pkiexpress
To add it to your project, add the line below to your requirements.txt
file:
pkiexpress==1.10.0
After that, do a pip install -r requirements.txt
to download the package and its dependencies.
The package is open-source, hosted on GitHub. Feel free to fork it if you need to make any customizations, and even submit an pull request.