How pyconcrete integration works in Django
masterIn the Django example, pyconcrete is used to protect the application source code within a Docker container.
Key Integration Details:
- Encryption: The Django source code located in
/code/is encrypted within the Docker image. - Entrypoint Requirements: To ensure the encrypted files are handled correctly, specific entrypoint files must remain as
.pyfiles and must includeimport pyconcreteat the very beginning of the file:/code/pye_web/wsgi.py/code/manage.py
- Production Warning: The example uses Docker image layers to cache the source code. For production deployments, you must ensure that the Docker build process does not inadvertently cache the original, unencrypted
.pysource code in any image layers.
# Example of required entrypoint modification
import pyconcrete
# ... rest of the file