### Run Django Example with PyConcrete Source: https://github.com/falldog/pyconcrete/blob/master/example/django/README.md Execute this command to build and run the Django example using PyConcrete within Docker. Ensure Docker and its prerequisites are installed. ```bash #!/bin/bash $ ./bin/run-example-django.sh ``` -------------------------------- ### Install PyConcrete with Passphrase Source: https://github.com/falldog/pyconcrete/blob/master/README.md Install PyConcrete using pip, providing a passphrase for encryption. Ensure you use a recent pip version (23.1+) and disable caching. ```sh pip install pyconcrete \ --no-cache-dir \ --config-settings=setup-args="-Dpassphrase=" ``` ```sh pip install pyconcrete \ --no-cache-dir \ --config-settings=setup-args="-Dpassphrase=" \ --config-settings=setup-args="-Dmode=exe" \ --config-settings=setup-args="-Dinstall-cli=true" ``` -------------------------------- ### Build .pyz archive Source: https://github.com/falldog/pyconcrete/blob/master/README.md Use the `pyecli build-zip` command to package source directories into executable or library zip archives. Specify the source directory, output path, and optionally an entry point or custom file extension. ```sh # basic: pack a source directory into a .pyz (requires __main__.py in source) $ pyecli build-zip --source= --output=app.pyz ``` ```sh # specify an entry point (generates __main__.py automatically) $ pyecli build-zip --source= --output=app.pyz --main=pkg.mod:fn ``` ```sh # use custom encrypted file extension $ pyecli build-zip --source= --output=app.pyz --ext=.pye ``` -------------------------------- ### Execute .pyz archive Source: https://github.com/falldog/pyconcrete/blob/master/README.md Run a PyConcrete-encrypted zip archive directly using the `pyconcrete` command followed by the archive name and any arguments. ```sh $ pyconcrete app.pyz [args...] ``` -------------------------------- ### Run tests in Docker Source: https://github.com/falldog/pyconcrete/blob/master/README.md Execute tests within a Docker environment using the `just test` command. ```sh $ just test ``` -------------------------------- ### Run Pytest Locally Source: https://github.com/falldog/pyconcrete/blob/master/tests/README.md Execute the test suite using pytest from the command line. ```shell $ pytest ``` -------------------------------- ### Import from .pyz or .zip archive Source: https://github.com/falldog/pyconcrete/blob/master/README.md Add zip archives containing encrypted modules to `sys.path` to enable importing. PyConcrete's `PyeZipImporter` will automatically handle decryption. ```python import sys import pyconcrete sys.path.insert(0, 'libs.zip') import mylib # loads mylib.pye from libs.zip ``` -------------------------------- ### PyConcrete Integration in Django Files Source: https://github.com/falldog/pyconcrete/blob/master/example/django/README.md To enable PyConcrete encryption, ensure these two files are left as .py files and have 'import pyconcrete' added at the beginning. ```python import pyconcrete ``` -------------------------------- ### Access Django Admin Interface Source: https://github.com/falldog/pyconcrete/blob/master/example/django/README.md Details for accessing the Django admin page. Use these credentials to log in. ```text http://127.0.0.1:5151/admin user name: admin password: 1234 ``` -------------------------------- ### Execute Encrypted Main Script with PyConcrete Source: https://github.com/falldog/pyconcrete/blob/master/README.md Run an encrypted main script (.pye) using the pyconcrete executable. This executable handles the decryption and execution of your script. ```sh pyconcrete main.pye ``` -------------------------------- ### Run Pytest in Docker Source: https://github.com/falldog/pyconcrete/blob/master/tests/README.md Run tests within a Docker container, specifying a Python version. This is useful for testing different Python environments. ```shell $ just test 3.10 ``` -------------------------------- ### Compile Python Scripts to Encrypted .pye Files Source: https://github.com/falldog/pyconcrete/blob/master/README.md Use the pyecli tool to compile Python scripts or directories into encrypted .pye files. You can specify a custom file extension. ```sh pyecli compile --pye -s= ``` ```sh pyecli compile --pye -s= ``` ```sh pyecli compile --pye -s= -e= ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.