Skip to main content

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

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 httplib2 # if you want to connect to arxiv
pip install oauth2client google-api-python-client # to use google calendar

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 

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.1.13

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.1.13
File Size Uploaded
piprints-4.1.13.tar.gz 7.2 MB Details

Built distribution (wheel)

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

Total release size: 14.4 MB

Release files / piprints-4.1.13.tar.gz

Download URL piprints-4.1.13.tar.gz
Size 7.2 MB
Tags Source
SHA-256 checksum
How to use checksums
c7a5e712679173a751788922d611393180e61f00863668aeca95591b02060fc7
BLAKE2b-256 checksum
How to use checksums
c396b55aebd8539a4f5ae07fcf6ac8389d772f40e45bc99c27146b91e3e2e89a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-124-generic

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

Download URL piprints-4.1.13-py3-none-any.whl
Size 7.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
66451141327eccf5b0ab45e6f83d70367e2eb8a623d8e69d9e592803cef56956
BLAKE2b-256 checksum
How to use checksums
905da83a0b210fe78e91bd5b522618676f1ab3c67a278895b57305e935fe9409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-124-generic

Release history Release notifications | RSS feed

This release

4.1.13 This release

2 release files

4.1.11

2 release files

4.1.10

2 release files

4.1.9

2 release files

4.1.8

2 release files

4.1.7

2 release files

4.1.6

2 release files

4.1.5

2 release files

4.1.4

2 release files

4.1.3

2 release files

4.1.2

1 release file

4.1.1

2 release files

4.1.0

2 release files

4.0.16

2 release files

4.0.15

2 release files

4.0.13

2 release files

4.0.9

2 release files

4.0.8

2 release files

4.0.7

2 release files

4.0.6

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

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