Package: oldp
OLDP: Open Legal Data PlatformOLDP is a web application, written in Python 3.5 and based on theDjango web framework,
It is used for processing legal text and providing a REST-API and Elasticsearch-based search engine.
OLDP is being develop by the non-profit initiativeOpen Legal Datawith the goal
of building an Open Data platform for legal documents (mainly court decisions and laws).
The platform makes legal information freely accessible for the general public and especially third-party apps.Our documentation is availablehere.DemoA live demo is availablehere(in German).FeaturesCases: Court decisions with meta data and content in HTML.Laws: Full-text laws and regulations and their corresponding case-law.Courts: Browse courts organized by states, jurisdiction and level of appeal from your country.Search: A document search engine based on Elasticsearch/Haystack supporting most common search syntax and faceting.API: Adding, updating, retrieving and deleting data through CRUD REST API based onDRFincluding
auto-generated API clients from Swagger.Themes: Easily adjust the look and feel depending on your countries needs (seeGerman theme).Installation guideBefore you can use OLDP, you’ll need to get it installed.
For a more detailed guide on how to get started with OLDP have a look at:Getting startedDockerTo skip the whole installation procedure you can simply run OLDP as Docker container.
Justgit clonethe repository first and then start everything with adocker-compose upfrom within the repository directory.
A small tutorial on how to use OLDP with Docker can be foundhere.DependenciesBefore anything else you will need to install the application dependencies.Python 3.5with pip (virtualenv or conda recommended)Node JS 8.12.xwith npm for building JS dependenciesDatabase (MySQL, SQLite, ...):All database engines that supportDjango's DB APIshould work. MySQL is recommended.Elasticsearch 5.4.x: Our search engine backend. Other systems supported byhaystackshould also work.Redis 4.x: Caching engine (optional)gccRequired to compile some Python libspython-mysqldb, libmysqlclient-devif you choose MySQL as databasegettextfor Django locales with msguniqpandocconvert docbook to HTML (import GG)GDAL: Geospatial libraries used by the haystack search module (seehere).# Create virtualenv
virtualenv -p python3 env
source env/bin/activate

# Clone repository to current directory
git clone https://github.com/openlegaldata/oldp.git .

# Install dependencies
apt-get install -y $(cat apt-requirements.txt)
pip install -r requirements.txt
npm installThe first time you run OLDP, you will need to initialize the database with its default blank values. If you want
to run OLDP in production mode, you also need to prepare static files and localization.# Prepare assets (JS, CSS, images, fonts, ...)
npm run-script build

# Prepare database
./manage.py migrate

# Localization (German and English, needed for production)
./manage.py compilemessages --l de --l en

# Prepare static files (needed for production)
./manage.py collectstatic --no-inputRunRun the following command to start the web app athttp://localhost:8000/../manage.py runserver 8000SettingsThe manage the app settings we rely ondjango-configurations.
Pre-configured settings can be used by setting theDJANGO_CONFIGURATIONenvironment variable to eitherProd,DevorTest.
You can as well override specific settings fromoldp/settings.pywith environment variables:Variable nameDefault valueCommentDJANGO_SETTINGS_MODULEoldp.settingsTell  Django which settings file you want to use (in Python path syntax).DJANGO_CONFIGURATIONProdChoice a predefined class of settings:Dev,ProdorTestDATABASE_URLmysql://oldp:oldp@127.0.0.1/oldpPath to database (usually mysql or sqlite)DJANGO_SECRET_KEYNoneSet this to a secret value in production modeDJANGO_ELASTICSEARCH_URLhttp://localhost:9200/Elasticsearch settings (scheme, host, port)DJANGO_ELASTICSEARCH_INDEXoldpElasticsearch index nameDJANGO_DEBUGTrueEnable to show debugging messages and errorsDJANGO_ADMINSAdmin,admin@openlegaldata.ioFormat:Foo,foo@site.com;Bar,bar@site.comDJANGO_ALLOWED_HOSTSNoneFormat:foo.com,bar.netDJANGO_LANGUAGES_DOMAINSFormat:{'de.foo.com':'de','fr.foo.com':'fr'}DJANGO_DEFAULT_FROM_EMAILno-reply@openlegaldata.ioEmails are sent from this addressDJANGO_EMAIL_HOSTlocalhostSMTP serverDJANGO_EMAIL_HOST_USERSMTP userDJANGO_EMAIL_HOST_PASSWORDSMTP passwordDJANGO_EMAIL_USE_TLSFalseenable TLSDJANGO_EMAIL_PORT25SMTP portDJANGO_FEEDBACK_EMAILfeedback@openlegaldata.ioMessages from feedback widget are sent to this address.DJANGO_TIME_ZONEUTCTime zoneDJANGO_TEST_WITH_ESFalseRun tests that require ElasticsearchDJANGO_TEST_WITH_WEBFalseRun tests that require web accessDJANGO_LOG_FILEoldp.logName of log file (in logs directory)DJANGO_DISABLE_CACHEFalseSet toTrueto disable cache (Redis)IssuesPlease use ourGitHub issuesto report bugs, request feature or simply
leave some feedback.ContactTo contact Open Legal Data Platform, see here:https://de.openlegaldata.io/contact/LicenseOLDP is licensed under the MIT License.