Skip to main content

INSTALL

Requires Python 3.11 or newer (below 4.0). The application uses Django 5.2 LTS.

For this checkout, use Python 3.11 with the locked dependencies:

poetry env use python3.11
poetry install

Create your new project:

poetry new myproject
cd myproject
poetry add piprints
poetry run manage

Initialize the database

poetry run manage migrate
poetry run manage collectstatic --no-input

(or test database connection with poetry run manage dbshell)

Create the first user

poetry run manage createsuperuser

Collect static files

poetry run manage collectstatic

Run the server

poetry run manage runserver

and then connect to localhost:8000/admin/ for the initial configuration. You should create a SiteParameter object. The id of this object must be given to the server configuration throught the SITE_ID configuration variable. The default value is 2, hence if you have a diffent value check the configuration section below.

Once an admin has been created, anyone can make a request for an account (from the login page) and the admin can manage account requests. You can then change a user's password with the command

    poetry run manage changepassword <username>

Warning: the default configuration is not suitable for production. You should carefully check your configuration (see section below) in particular for production you should have DEBUG=False a randomly choosen SECRET_KEY and possibly a solid database (mysql or postgres instead of sqlite).

CONFIGURATION

Configuration is loaded from environment variables. For example, to set the SITE_ID you should issue this command

export SITE_ID=2

before running the server. This is not permanent. To make it permanent you can create a .env file (in the same directory as the README.md file) and insert there all variables definition:

echo "SITE_ID=2" >> .env

An example file listing all settings is provided in the file .env.example

Set a fixed, private SECRET_KEY in .env: changing it invalidates login sessions, including when different server processes use different keys. Session and CSRF cookies default to HTTP-compatible in DEBUG mode and HTTPS-only otherwise. Override these defaults with SESSION_COOKIE_SECURE and CSRF_COOKIE_SECURE if needed.

You can check the values of settings with the command

poetry run manage diffsettings

DEPLOY USING PIP

create a working directory on your server

mkdir piprints
cd piprints

create a virtualenv and activate it:

python -m venv venv
. venv/bin/activate

install the latest version of piprints:

pip install piprints

You might need the following additional packages, depending on your configuration:

pip install mysqlclient # if you use mysql as database
pip install 'piprints[google]' # to use Google Calendar with the security minimums

pip install --upgrade piprints reads the package dependency ranges, not poetry.lock. Security minimums are declared for indirect runtime dependencies so pip also replaces older, vulnerable versions. If Google Calendar is enabled, upgrade with python -m pip install --upgrade 'piprints[google]' to apply the optional integration's minimums too. Python 3.11 remains supported.

The virtualenv's installation tools are maintained separately from application dependencies: update pip and setuptools through the deployment procedure, then run python -m pip check and audit the actual installed environment.

Configure your .env file as described above

The manage command should be available in your shell (when the virtual environment is active):

manage

You can use manage runserver to run a debug server. Otherwise for production use you should adapt the piprints/wsgi.py script

BUILD pypi PACKAGE

Remember to bump version in pyproject.toml.

poetry build
poetry publish

MAKE requirements.txt

poetry self add poetry-plugin-export
poetry export --without-hashes --format requirements.txt --output requirements.txt 

For the development Docker image, include the optional MariaDB driver group:

poetry export --only main,docker --without-hashes --format requirements.txt --output docker/requirements.txt

DEVELOPMENT AND TESTS

From this repository, install the locked dependencies and run the checks:

poetry install --with dev
poetry run manage check
DATABASE_NAME=/tmp/piprints-check.sqlite3 poetry run python -m pytest -q

Tests create their own database and use an in-memory email backend. The existing naive datetime behavior is preserved explicitly with USE_TZ=False after the Django upgrade. See AGENTS.md for the project map and maintenance commands, and SECURITY_REVIEW.md for known security issues.

LOCAL DOCKER EXAMPLE

Build from the repository root with docker build -f docker/Dockerfile -t piprints ., or use Compose:

export DATABASE_PASSWORD='choose-a-local-database-password'
docker compose -f docker/docker-compose.yml up --build -d web
docker compose -f docker/docker-compose.yml run --rm createsuperuser

The example uses Python 3.14, MariaDB 11.4 and the source in this checkout. It binds port 8000 to localhost and runs Django's development server. Configure SiteParameters through /admin/ as described above. Use a production WSGI server and review the deployment settings before exposing a public service. Existing database volumes need a separate compatibility review before changing MariaDB versions.

BACKUP

Per fare un dump del database il comando che sembra funzionare e' questo:

da un lato:

python manage.py dumpdata --exclude=contenttypes --exclude=auth.Permission --exclude=admin -o mydump.json

dall'altro lato:

python manage.py flush   ## cancella il database!!
python manage.py loaddata mydump.json

Metadata

Release files for piprints 4.2.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piprints 4.2.11
File Size Uploaded Provenance Actions
piprints-4.2.11.tar.gz 7.2 MB Without provenance Details for piprints-4.2.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for piprints 4.2.11
File Interpreter ABI Platform Actions
piprints-4.2.11-py3-none-any.whl Python 3 none any Details for piprints-4.2.11-py3-none-any.whl

Total release size: 14.5 MB

Release files / piprints-4.2.11.tar.gz

Download URL piprints-4.2.11.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
cefec980cc86f6fdc5e4be4224b69635d6beaf379fa1f3bfb14244038efff4e2
BLAKE2b-256 checksum
How to use checksums
8cb798596d61c90ceaf73d76bd310585e5c7e592f3e06a7c269360e0aa0420d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.18 Linux/7.0.0-44-generic

Release files / piprints-4.2.11-py3-none-any.whl

Download URL piprints-4.2.11-py3-none-any.whl
Size 7.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
72a03338f663c92706cc02e714628257071780910493f31854d75e7f05942de5
BLAKE2b-256 checksum
How to use checksums
3c7a1035f23e91bb3df0c3d18077f27bb77c62080dbabefcf3ae3092dadd277a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.11.18 Linux/7.0.0-44-generic

Security for piprints 4.2.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.2.11 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page