diff --git a/README.rst b/README.rst
index c5dac76..90f6073 100644
--- a/README.rst
+++ b/README.rst
@@ -54,7 +54,7 @@ Installation and Configuration
Prerequisites
-------------
-- Python => 2.7
+- Python == 3.6
- python-virtualenv
- gcc
- mod_ssl.x86_64
@@ -65,6 +65,8 @@ Prerequisites
Installation
------------
+Run the Anisble playbook to complete most of the installation or:
+
Create the directory for the static files
.. code:: bash
diff --git a/datasets/views.py b/datasets/views.py
index c633b57..89985ed 100644
--- a/datasets/views.py
+++ b/datasets/views.py
@@ -7,7 +7,7 @@
class Mint(View):
- @method_decorator(login_required)
+ #@method_decorator(login_required)
def dispatch(self, *args, **kwargs):
return super(Mint, self).dispatch(*args, **kwargs)
diff --git a/doi_site/__init__.py b/doi_site/__init__.py
index 0be4fbf..e69de29 100644
--- a/doi_site/__init__.py
+++ b/doi_site/__init__.py
@@ -1 +0,0 @@
-""" The main web pages for displaying information and logging on and off. """
diff --git a/doi_site/local_settings.py.ini b/doi_site/local_settings.py.ini
deleted file mode 100644
index 4917e08..0000000
--- a/doi_site/local_settings.py.ini
+++ /dev/null
@@ -1,100 +0,0 @@
-"""
-Django local settings for doi_site project.
-
-This file contains the variables that MAY/SHOULD be set with values specific for
-the deployment.
-"""
-
-# Datacite URL, the default in settings.py is the test service
-# Override here to use the production service
-# DATACITE_URL = 'https://mds.datacite.org/'
-
-# Datacite handler, the default in settings.py is the test service
-# Override here to use the production service
-# DATACITE_HANDLER = 'http://dx.doi.org/'
-
-# Web proxy
-#HTTP_PROXY_HOST = 'example.org'
-#HTTP_PROXY_PORT = '8080'
-
-# The organisation's DataCite prefix in the form nn.nnnn
-DOI_PREFIX = 'nn.nnnn'
-
-# The organisation's username for DataCite
-DATACITE_USER_NAME = 'BL.XXXX'
-
-# The organisation's password for DataCite
-DATACITE_PASSWORD = 'xxxxxxxxxxxxxxxxx'
-
-# The URI of the organisation's LDAP server
-AUTH_LDAP_SERVER_URI = "ldap://example.org:389"
-
-# The organisation's LDAP DN template
-AUTH_LDAP_USER_DN_TEMPLATE = "%(user)s@example.org"
-
-# The name of your organisation, this will be displayed on the home page
-ORGANISATION_NAME = 'My Organisation'
-
-# An email address for people to contact you about the this service, this will
-# be displayed on the home page
-ORGANISATION_DOI_EMAIL = 'doi@example.org'
-
-# SECURITY WARNING: keep the secret key used in production secret!
-# A secret key for a particular Django installation. This is used to provide
-# cryptographic signing, and should be set to a unique, unpredictable value.
-SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
-
-# A list of strings representing the host/domain names that this Django site
-# can serve
-ALLOWED_HOSTS = [
- '127.0.0.1',
- 'example.org'
-]
-
-# The URL of the location of the document detailing users roles and
-# responsibilities
-ROLES_URL = 'https://example.org/DOI-responsibilities.docx'
-
-# The URL of the location of the document containing notes for issuers
-NOTES_URL = 'https://example.org/Notes%20for%20Issuers.docx'
-
-# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = False
-
-# Database
-# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
-DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/var/doi/doi.db' } }
-
-# A sample logging configuration. The only tangible logging
-# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error.
-# See http://docs.djangoproject.com/en/dev/topics/logging for
-# more details on how to customize your logging configuration.
-LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'formatters': {
- 'verbose': {
- 'format':
- '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
- },
- 'simple': {
- 'format': '%(levelname)s %(message)s'
- },
- },
- 'handlers': {
- 'console':{
- 'level':'DEBUG',
- 'class':'logging.StreamHandler',
- 'formatter': 'verbose'
- }
- },
- 'loggers': {
- 'mds': {
- 'handlers': ['console'],
- 'level': 'DEBUG',
- 'propagate': True,
- }
- }
-}
-
diff --git a/doi_site/manage.py b/doi_site/manage.py
deleted file mode 100755
index 7fe150f..0000000
--- a/doi_site/manage.py
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-
-
-if __name__ == "__main__":
- os.environ.setdefault("DJANGO_SETTINGS_MODULE", "doi_site.settings")
-
- from django.core.management import execute_from_command_line
-
- execute_from_command_line(sys.argv)
diff --git a/doi_site/settings.py b/doi_site/settings.py
index 1244e83..e8fb0b0 100644
--- a/doi_site/settings.py
+++ b/doi_site/settings.py
@@ -1,65 +1,61 @@
"""
Django settings for doi_site project.
-Generated by 'django-admin startproject' using Django 1.8.
+Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
-https://docs.djangoproject.com/en/1.8/topics/settings/
+https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
-https://docs.djangoproject.com/en/1.8/ref/settings/
+https://docs.djangoproject.com/en/2.2/ref/settings/
"""
-# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
-
+# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
# Quick-start development settings - unsuitable for production
-# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
+# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
+
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
-# A list of strings representing the host/domain names that this Django site can
-# serve
ALLOWED_HOSTS = []
# Application definition
-INSTALLED_APPS = (
+INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
- 'datasets',
'mds',
-)
+ 'datasets'
+]
-MIDDLEWARE_CLASSES = (
+MIDDLEWARE = [
+ 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
- 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
- 'django.middleware.security.SecurityMiddleware',
-)
+]
ROOT_URLCONF = 'doi_site.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [os.path.join(BASE_DIR, 'doi_site', 'templates')],
+ 'DIRS': [os.path.join(BASE_DIR, "doi_site", 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@@ -72,11 +68,11 @@
},
]
-WSGI_APPLICATION = 'doi_site.wsgi.application'
+WSGI_APPLICATION = 'doi_site.wsgi.application'
# Database
-# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
DATABASES = {
'default': {
@@ -85,9 +81,26 @@
}
}
+# Password validation
+# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
# Internationalization
-# https://docs.djangoproject.com/en/1.8/topics/i18n/
+# https://docs.djangoproject.com/en/2.2/topics/i18n/
LANGUAGE_CODE = 'en-us'
@@ -99,14 +112,11 @@
USE_TZ = True
-
# Static files (CSS, JavaScript, Images)
-# https://docs.djangoproject.com/en/1.8/howto/static-files/
+# https://docs.djangoproject.com/en/2.2/howto/static-files/
STATIC_URL = '/static/'
-STATIC_ROOT = '/var/www/html/doi/'
-
STATICFILES_DIRS = (
os.path.join(BASE_DIR, "doi_site", "static"),
)
@@ -127,16 +137,15 @@
# The connection timeout in seconds
TIME_OUT = 10
+AUTH_LDAP_BIND_AS_AUTHENTICATING_USER = True
+
# Populate the Django user from the LDAP directory.
-AUTH_LDAP_USER_ATTR_MAP = {
- "first_name": "givenName",
- "last_name": "sn",
- "email": "mail"
-}
+AUTH_LDAP_USER_ATTR_MAP = {"first_name": "givenName", "last_name": "sn", "email":"mail"}
# This is the default, but I like to be explicit.
AUTH_LDAP_ALWAYS_UPDATE_USER = True
+
# Keep ModelBackend around for per-user permissions and maybe a local
# superuser.
AUTHENTICATION_BACKENDS = (
@@ -152,9 +161,8 @@
# The email address to display on the home page
ORGANISATION_DOI_EMAIL = 'My eMail'
-
try:
- #pylint: disable=wildcard-import, unused-wildcard-import
+ # pylint: disable=wildcard-import, unused-wildcard-import
from doi_site.local_settings import *
except ImportError:
pass
diff --git a/doi_site/templates/doi_site/domains.html b/doi_site/templates/doi_site/domains.html
index 51fd3af..82eec80 100644
--- a/doi_site/templates/doi_site/domains.html
+++ b/doi_site/templates/doi_site/domains.html
@@ -15,9 +15,9 @@