Source code for the Edition Open Access website. Publications are provided in a number of different formats:
- online HTML version
- Ebook (EPUB)
In order to provide a consistent environment we are using docker. A set of python scripts is used for automatisation. Installing and running the project work without Docker or the scripts is possible, but not recommended. In this case you are on your own. Dependencies to other git repositories are handled using git_deps_py.
-
Environment variables: see file
.env
These variables are available inside the
docker-compose.yaml
file and are also loaded into the python scripts. (The.env
file is initially created with default settings by theinit.py
script) -
Django settings: see
src/eoa/settings.py
For further information please check the django documentation.
- Python 3
- Docker, Docker Compose
- git_deps_py
$ git_deps_py
$ ./scripts/init.py [--build]
This will pull remote repositories and resources, initialize the database, etc.
Force recreating the docker image by adding --build
e.g. if Dockerfile
or requirements.txt
has changed.
The dummy fixture contains the default setup for CMS pages. Also a CMS superuser with username 'test' and password 'test' (don't use this in production !).
$ cp fixtures/cms_dummy.json res/fixtures/
$ ./scripts/init.py --skip-db
$ ./scripts/run.py && ./scripts/exec_in_container.py
$ $ python manage.py loaddata $RES_DIR/fixtures/cms_dummy.json
$ $ exit
In order to publish a publication on the platform, the following 2 steps are necessary:
-
First you have to compile your publication to "django", using EOASkripts
-
After that you have to import it to the platform.
For the example publication, this process goes as follows:
-
compiling the example
$ cd example_import $ git_deps_py --store-dir ../dependencies $ cd dependencies/EOASkripts $ ./scripts/run.py && ./scripts/exec_in_container.py $ $ process_eoa_latex.py -f input/example/eoatex/EOASample.tex $ $ exit $ ./scripts/stop.py $ cd ..
-
import example to the platform
After you have compiled the publication to "django", you might want to import it into the platform.
$ cp -r example_import/EOASkripts/runtime/output/django res/publications/example
$ ./scripts/init.py --skip-db
$ ./scripts/run.py && ./scripts/exec_in_container.py
$ $ python manage.py publicationimport $RES_DIR/publications/example
$ $ exit
$ ./scripts/stop.py
That's all.
-
You might want to tweak the CMS pages: log in to the CMS and do it
-
You might want to configer organisation information (org. name, logo, ...):
- edit
res/custom_config/*
- $ ./scripts/init.py --skip-db
- edit
-
You might want to add your organisations logo, favicon etc:
Copy them into
res/static/custom_static/
. Files in this directory overwrite default files with the same name:$ cp <my_icon> res/static/custom_static/ $ ./scripts/init.py --skip-db
TODO: list images that one typically wants to overwrite
The templates expect some pages to exist in the CMS:
- Introduction Page (id: 'introduction')
- Contact (id: 'contact')
- Imprint (id: 'imprint')
Deleting those might break things.
$ ./scripts/run.py
The webpage can now be explored in your local browser.
$ ./scripts/stop.py
$ ./scripts/exec_in_container.py [-- CMD ...]
$ ./scripts/exit.py
This should remove all remote repositories and resources not part of this repository. Docker images are not deleted though.
In order to export CMS content, execute:
$ ./scripts/run.py && ./scripts/exec_in_container.py 'python manage.py dump_cms'
$ cp runtime_data/fixtures/* fixtures/
Not documented yet. It might be necessary to tweak the django settings, among other adjustments.