Skip to content

Commit

Permalink
Virtual environment documented
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Jun 9, 2020
1 parent 0067b24 commit c1f2c59
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@

# -- Options for intersphinx extension ---------------------------------------

DOC_URL = "http://localhost:7999"

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/3/': None}
intersphinx_mapping = {'main': (f'{DOC_URL}/', None)
'webplat': (f'{DOC_URL}/webdesign_platform', None),
}
2 changes: 1 addition & 1 deletion docs/install_docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Installation with Docker
==========================

Docker is used to provide a consistent environment. Additional Python scripts are used for automisation of the installation process.
Docker is used to provide a consistent environment. Additional Python scripts are used for automisation of the installation process. This solution also contains the EOASkripts suite, which effectively makes this an all-in-one-solution for the whole production infrastructure.

Dependencies to other git repositories are handled using `git_deps_py <https://github.molgen.mpg.de/EditionOpenAccess/git_deps_py>`_.

Expand Down
92 changes: 92 additions & 0 deletions docs/install_venv.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
=======================================
Installation with Virtual Environment
=======================================

As a slightly more lightweight approach, the whole system can also be set up in a Virtual Environment. This solution will definitely be lighter on system resources like disk space and memory.


Python packages
===============
If not done already, install the following packages (on Linux)::

sudo apt-get install python3-venv virtualenv

EOA Publication Platform
========================
Clone the source files for the publication platform::

git clone https://github.molgen.mpg.de/EditionOpenAccess/eoa-1.5.git


Additional deployment steps
===========================
.. note::
A small note before you continue, as it is not easy to move a virtual environment after installation.

If you plan to use this installation on a production server, consider the additional steps of creating a separate user and a daemon and running the service in a non-user directory for more security and stability. See :doc:`the main documentation <main:chapters/djangodeploy>`.


Create Virtual Environment
==========================
You are free to choose a name of your choice here::

virtualenv -p python3 eoapp_ve
cd eoapp_ve
source bin/activate

Installation of the system
--------------------------
The next steps set up the EOA Publication Platform::

pip install djangocms-installer lxml
djangocms --django-version 2.1 --cms-version stable eoapp
pip uninstall djangocms-googlemap

Submodules – Further development planned?
-----------------------------------------
If you plan on further developing the submodules of the platform, consider using the following commands for installation. With this, the submodules are located in the ``src`` directory on root level and in version control::

pip install -e git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoapublications.git#egg=django-eoapublications
pip install -e git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaauthors.git#egg=django-authors
pip install -e git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaseries.git#egg=django-series
pip install -e git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaforthcoming.git#egg=django-forthcoming
pip install -e git+https://github.molgen.mpg.de/EditionOpenAccess/django-opds.git#egg=django-opds

Otherwise, use these commands to install them deeper in the system::

pip install git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoapublications
pip install git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaauthors
pip install git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaseries
pip install git+https://github.molgen.mpg.de/EditionOpenAccess/django-eoaforthcoming
pip install git+https://github.molgen.mpg.de/EditionOpenAccess/django-opds

Adding the webdesign and templates and settings
-----------------------------------------------
If you haven't done so yet, see the :doc:`webdesign documentation <webplat:index>` for installation and usage. For the webdesign, you need the ``app.js`` and ``app.css`` files as well as the ``assets`` directory. After having built these files or obtained them from another source, copy them into the new platform::

cd <path_to_webdesign_platform>/dist
cp -r app.* assets/ <path_to_eoapp_ve>/eoapp/eoapp/static/

Similarly, add the templates and settings from the EOA-1.5 repository::

cd <path_to_eoapp_ve>
rm -r eoapp/eoapp/templates
cp -rv <path_to_eoa-1.5>/src/eoa/templates <path_to_eoapp_ve>/eoapp/eoapp/
cp <path_to_eoa-1.5>/src/eoa/settings_lite.py <path_to_eoapp_ve>/eoapp/eoapp/settings.py
cp <path_to_eoa-1.5>/src/eoa/urls.py <path_to_eoapp_ve>/eoapp/eoapp/

Importing data and setting up the database
==========================================
Import some basic CMS pages and settings::

cd eoapp
python manage.py loaddata <path_to_eoa-1.5>/fixtures/cms_dummy.json

Finally, update the database by migrating::

python manage.py makemigrations
python manage.py migrate --run-syncdb


Run the server
==============
It should now be possible to run a server and access the site through the browser::

python manage.py runserver 0.0.0.0:8000

0 comments on commit c1f2c59

Please sign in to comment.