Skip to main content

Main functionalities for the curator core project

Project description

This Django reusable app contains the main functionalities for the curator core project.

Pre-requisites

For automated and manual install, the following software are needed:

  • python

  • pip

  • virtual env (conda or venv)

In addition, for manual setup, git is needed.

Installation

Automated installation

$ pip install core_main_app

Manual installation

$ git clone https://github.com/usnistgov/core_main_app.git
$ cd core_main_app
$ python setup.py
$ pip install sdist/*.tar.gz

Configuration

Edit the setting.py file

Add the "core_main_app" and "tz_detect" under INSTALLED_APPS as such:

INSTALLED_APPS = [
    ...
    "tz_detect",
    "core_main_app",
]

Add the middleware required by tz_detect:

MIDDLEWARE = (
    ...
    'tz_detect.middleware.TimezoneMiddleware',
)

Edit the urls.py file

Add the core_main_app urls to the Django project as such.

url(r'^', include("core_main_app.urls")),

Internationalization (i18n)

Before running the project, don’t forget to compile the translation file at project level. i18n uses the gettext package, so please make sure it is installed prior to using this command.

$ python manage.py compilemessages

Tests

To play the test suite created for this package, download the git repository and run:

$ python runtests.py

Documentation

Documentation has been generated using Sphinx. To generate a local version of the docs, please clone the repository and run:

$ cd docs/
$ make html

Or, directly using Sphinx:

$ cd docs/
$ sphinx-build -b html . ../dist/_docs

Enable SSL connection

Please follow these steps to configure the connection to any system running over HTTPS (including the local instance).

  • Create a folder for SSL certificates,

  • Copy the certificate in the folder,

  • Run c_rehash on the folder (needs to be done every time a new certificate is added to the folder),

  • Update the SSL_CERTIFICATES_DIR setting to point to the SSL certificate folder previously created.

$ mkdir certs
$ cp cdcs.crt certs/
$ c_rehash certs/

Enable Redis Server authentication

Please follow these steps to enable authentication on the redis server. Depending on the way Redis is started on the machine, the method may differ.

You can follow instructions at https://redis.io/topics/security#authentication-feature to enable authentication: * Open the file redis.conf (e.g. /usr/local/etc/redis.conf), * Uncomment the authentication setting (# requirepass foobared), * It is recommended to replace the default password (foobared) by a strong and long password, * Restart the Redis Server.

You should then update the CDCS settings using a Redis connection URL with the password chosen in the previous steps.

BROKER_URL = 'redis://:<password>@localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://:<password>@localhost:6379/0'

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

core_main_app-1.1.0.tar.gz (1.3 MB view details)

Uploaded Source

File details

Details for the file core_main_app-1.1.0.tar.gz.

File metadata

  • Download URL: core_main_app-1.1.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.0 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.13

File hashes

Hashes for core_main_app-1.1.0.tar.gz
Algorithm Hash digest
SHA256 99ab21e94e53480e525b42e260cc2644b51fe6ea941ff18e5163b77988241f65
MD5 f1004043fba9e1e0dd505971ba25063b
BLAKE2b-256 f66dd69ac87e327a822253f5a6f78b84cc3cf4afac120972e3a056fb6a3b4df5

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