Skip to main content

preprint server

Project description

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piprints-4.0.14.tar.gz (7.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piprints-4.0.14-py3-none-any.whl (7.2 MB view details)

Uploaded Python 3

File details

Details for the file piprints-4.0.14.tar.gz.

File metadata

  • Download URL: piprints-4.0.14.tar.gz
  • Upload date:
  • Size: 7.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-57-generic

File hashes

Hashes for piprints-4.0.14.tar.gz
Algorithm Hash digest
SHA256 eeda6426c407725779776feb9f3a7fb1264f2e246cb98893ca1653f30ddbf84f
MD5 a5eac480c9396930572a5305c306a9f3
BLAKE2b-256 de1b29be29fe6d9f3391ed38a86a80d1fee0d36b66b769d754fa1827904b72f0

See more details on using hashes here.

File details

Details for the file piprints-4.0.14-py3-none-any.whl.

File metadata

  • Download URL: piprints-4.0.14-py3-none-any.whl
  • Upload date:
  • Size: 7.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-57-generic

File hashes

Hashes for piprints-4.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 56d38bdd26c49084294675a8eae7e10973cc842f6d0edc4d8c1b8e5a87e007c7
MD5 9d3ee1bbeac0b4c753d75de7aa2562a1
BLAKE2b-256 cb56daadef3e773a9672ec86bbd3ec8cdf5c51d74a4e8d0375f4654d7e471435

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page