https://github.com/bihealth/sodar-django-site
Django site template for SODAR Core based projects
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Django site template for SODAR Core based projects
Basic Info
- Host: GitHub
- Owner: bihealth
- License: mit
- Language: Python
- Default Branch: main
- Size: 152 KB
Statistics
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
- Releases: 0
Created over 7 years ago
· Last pushed 12 months ago
Metadata Files
Readme
License
Authors
README.rst
SODAR Django Site
^^^^^^^^^^^^^^^^^
.. image:: https://github.com/bihealth/sodar_django_site/workflows/Build/badge.svg
:target: https://github.com/bihealth/sodar_django_site/actions?query=workflow%3ABuild
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
This project contains a minimal `Django 4.2 `_
site template for building `SODAR Core `_
based projects.
Introduction
============
The site is based on a site template created with
`cookiecutter-django `_.
Included in this project are the critical OS and Python requirements, pre-set
Django settings, a pre-installed SODAR Core framework and some helper scripts.
It is also readily compatible with Selenium UI testing, coverage checking and
continuous integration for GitHub Actions and GitLab-CI.
The current version of this site is compatible with
`SODAR Core v1.2.0 `_.
Installation for Development
============================
For instructions and best practices in Django development, see
`Django 4.2 documentation `_ and
`Two Scoops of Django `_.
For SODAR Core concepts and instructions, see
`SODAR Core documentation `_.
The examples here use venv and pip, but you may also use e.g. conda for virtual
environments and installing packages.
Requirements
------------
- Ubuntu 24.04 (Recommended for development)
- Python 3.9, 3.10 or 3.11
- Postgres 12+ (v16 recommended)
System Installation
-------------------
First you need to install OS dependencies, PostgreSQL 16 and Python 3.9+.
.. code-block:: console
$ sudo utility/install_os_dependencies.sh
$ sudo utility/install_python.sh
$ sudo utility/install_postgres.sh
Database Setup
--------------
Create a PostgreSQL user and a database for your application. Make sure to
give the user the permission to create further PostgreSQL databases (used for
testing).
You can either use the helper script in ``utility/setup_database.sh`` or use
psql manually. Make sure to replace the example values below with your actual
database name, user name and password.
.. code-block:: console
$ sudo su - postgres
$ psql
$ CREATE DATABASE your_db;
$ CREATE USER your_user WITH PASSWORD 'your_password';
$ GRANT ALL PRIVILEGES ON DATABASE your_db to your_user;
$ ALTER USER your_user CREATEDB;
$ \q
You have to add the credentials in the environment variable ``DATABASE_URL``.
For development it is recommended to place this variable in an ``.env`` file and
set ``DJANGO_READ_DOT_ENV_FILE=1`` in your actual environment. See
``config/settings/base.py`` for more information.
.. code-block:: console
DATABASE_URL=postgres://your_user:your_password@127.0.0.1/your_db
Project Setup
-------------
Clone the repository, setup and activate the virtual environment. Once in
the environment, install Python requirements for the project:
.. code-block:: console
$ git clone https://github.com/bihealth/sodar_django_site.git
$ cd sodar_django_site
$ python -m venv .venv
$ source .venv/bin/activate
$ utility/install_python_dependencies.sh
**Hint:** At this point, you most likely want to rename the project and the
website directory from ``sodar_django_site`` into the name of the system you
will be developing.
LDAP Setup (Optional)
---------------------
If you will be using LDAP/AD auth on your site, make sure to also run:
.. code-block:: console
$ sudo utility/install_ldap_dependencies.sh
$ pip install -r requirements/ldap.txt
Final Setup
-----------
Initialize the database (this will also synchronize django-plugins):
.. code-block:: console
$ ./manage.py migrate
Create a Django superuser for the web site:
.. code-block:: console
$ ./manage.py createsuperuser
Retrieve icons to use on the site and collect static files:
.. code-block:: console
$ ./manage.py geticons
$ ./manage.py collectstatic
Now you should be able to run the server:
.. code-block:: console
$ make serve
Navigate to `http://127.0.0.1:8000/ `_ and log in to see
the results. The site should be up and running with the default SODAR Core
layout.
Note that if you are utilizing Celery or the bgjobs app, you will also need to
configure and run Celery in a separate process.
Developing your Site
====================
Once the installation is successful, you can continue to add your own
SODAR based apps. See
`SODAR Core documentation `_.
for further instructions.
Updating This Repository
========================
Below is a checklist for updating the SODAR Django Site repository for a new
SODAR Core version, applicable to SODAR Core developers.
- Upgrade system dependencies (if changed)
- Upgrade Python dependencies (if changed)
- Update utility scripts (if changed)
- Update Django settings files (if changed)
- Update URL config (if changed)
- Any other SODAR Core version specific updates if applicable
- Reinstall versioneer (if versioneer has been upgraded)
- Update SODAR version in requirements
- Update version number in docs
Owner
- Name: Berlin Institute of Health
- Login: bihealth
- Kind: organization
- Website: https://www.cubi.bihealth.org/
- Repositories: 215
- Profile: https://github.com/bihealth
BIH Core Unit Bioinformatics & BIH HPC IT
GitHub Events
Total
- Push event: 3
Last Year
- Push event: 3
Dependencies
requirements/base.txt
pypi
- Sphinx ==4.3.2
- argon2-cffi >=21.3.0,<21.4
- awesome-slugify ==1.6.5
- django >=3.2.14,<3.3
- django-autocomplete-light ==3.8.2
- django-crispy-forms >=1.13.0,<1.14
- django-db-file-storage ==0.5.5
- django-docs ==0.3.1
- django-environ >=0.8.1,<0.9
- django-markupfield >=2.0.1,<2.1
- django-model-utils >=4.2.0,<4.3
- django-pagedown >=2.2.1,<2.3
- django-rest-knox ==4.1.0
- django-saml2-auth-ai >=2.1.6,<2.2
- django-sodar-core ==0.10.13
- djangorestframework ==3.13.1
- docutils ==0.17.1
- markdown ==3.3.4
- mistune >=2.0.1,<2.1
- psycopg2-binary >=2.9.3,<2.10
- pytz ==2021.3
- rules ==3.0
- setuptools ==59.6.0
- sphinx-rtd-theme ==1.0.0
- versioneer ==0.21
- wheel ==0.37.1
requirements/ldap.txt
pypi
- django-auth-ldap ==4.0.0
- python-ldap ==3.4.0
requirements/local.txt
pypi
- Werkzeug ==2.0.2
- django-debug-toolbar >=3.2.4,<3.3
- django-extensions ==3.1.5
- ipdb ==0.13.9
requirements/production.txt
pypi
- django-redis ==5.2.0
- gevent ==21.12.0
- gunicorn ==20.1.0
- redis ==4.1.2
- whitenoise ==5.3.0
requirements/test.txt
pypi
- beautifulsoup4 ==4.10.0 test
- black ==22.3.0 test
- coverage ==6.2 test
- django-coverage-plugin ==2.0.2 test
- django-test-plus ==2.2.0 test
- factory-boy ==3.2.1 test
- flake8 ==4.0.1 test
- pytest-django ==4.5.2 test
- pytest-sugar ==0.9.4 test
- selenium ==4.1.0 test
.github/workflows/build.yml
actions
- actions/checkout v2 composite
- actions/setup-python v2 composite
- postgres 11 docker
requirements.txt
pypi
setup.py
pypi