Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Doi site upgrade history #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Installation and Configuration
Prerequisites
-------------

- Python => 2.7
- Python == 3.6
- python-virtualenv
- gcc
- mod_ssl.x86_64
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion datasets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion doi_site/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
""" The main web pages for displaying information and logging on and off. """
100 changes: 0 additions & 100 deletions doi_site/local_settings.py.ini

This file was deleted.

11 changes: 0 additions & 11 deletions doi_site/manage.py

This file was deleted.

70 changes: 39 additions & 31 deletions doi_site/settings.py
Original file line number Diff line number Diff line change
@@ -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': [
Expand All @@ -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': {
Expand All @@ -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'

Expand All @@ -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"),
)
Expand All @@ -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 = (
Expand All @@ -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
4 changes: 2 additions & 2 deletions doi_site/templates/doi_site/domains.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ <h1>DOI Sub-Domains Accessible via this Service</h1>
<td>
{% for user in profile.group.user_set.values %}
{% if forloop.last %}
{{user.first_name }} {{ user.last_name }}
{{user.first_name }} {{ user.last_name }} ({{ user.email }})
{% else %}
{{user.first_name }} {{ user.last_name }},
{{user.first_name }} {{ user.last_name }} ({{ user.email }}),
{% endif %}
{% endfor %}
</td>
Expand Down
24 changes: 12 additions & 12 deletions doi_site/templates/doi_site/stfc_skin.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<link href="{% static 'doi_site/css/stfc/stfc_normalize.css' %}" rel="styleSheet"
type="text/css" />
type="text/css" />
<link href="{% static 'doi_site/css/stfc/stfc_style.css' %}" rel="styleSheet" type="text/css"
media="screen" />
media="screen" />
<link rel="stylesheet" href="{% static 'doi_site/css/stfc/stfc_print.css' %}" type="text/css"
media="print" />
media="print" />
<link rel="shortcut icon" href="{% static 'doi_site/images/stfc/favicon.ico.png' %}"
type="image/x-icon" />

Expand All @@ -36,7 +36,7 @@
<div id="headerStart">
<div id="siteLogo">
<a href="http://www.stfc.ac.uk"> <img alt="STFC logo"
src="{% static 'doi_site/images/stfc/stfcLogo.png' %}" id="mainLogo" /></a> <img
src="{% static 'doi_site/images/stfc/stfcLogo.png' %}" id="mainLogo" /></a> <img
alt="STFC logo" src="{% static 'doi_site/images/stfc/logoPrint.png' %}"
id="printLogo" />
</div>
Expand Down Expand Up @@ -75,20 +75,20 @@ <h1 class="siteName">
</div>
<div id="footerRight">
<a href="http://www.stfc.ac.uk/rss/stfcNewsRSS.xml"><img
title="STFC RSS feeds" alt="STFC RSS Feeds"
src="{% static 'doi_site/images/stfc/rss.png' %}" id="imgRS" /></a> <a
title="STFC RSS feeds" alt="STFC RSS Feeds"
src="{% static 'doi_site/images/stfc/rss.png' %}" id="imgRS" /></a> <a
href="http://twitter.com/STFC_Matters"><img
title="Follow us on Twitter" alt="STFC on Twitter"
src="{% static 'doi_site/images/stfc/twitter.png' %}" id="imgTW" /></a> <a
title="Follow us on Twitter" alt="STFC on Twitter"
src="{% static 'doi_site/images/stfc/twitter.png' %}" id="imgTW" /></a> <a
href="http://www.youtube.com/user/SciTechUK"><img
title="STFC on YouTube" alt="STFC on YouTube"
src="{% static 'doi_site/images/stfc/youTube.png' %}" id="imgYT" /></a> <a
title="STFC on YouTube" alt="STFC on YouTube"
src="{% static 'doi_site/images/stfc/youTube.png' %}" id="imgYT" /></a> <a
href="http://www.thenakedscientists.com/rss/naked_scientists_stfc_podcast.xml"><img
title="Podcasts from Naked Scientists supported by the STFC"
alt="Naked Scientists podcasts" src="{% static 'doi_site/images/stfc/nsci20.png' %}"
id="imgNS" /></a> <a id="printLink" href="javascript:window.print()"><img
title="Printer-friendly" alt="Printer-friendly"
src="{% static 'doi_site/images/stfc/pf.png' %}" id="imgPF" /></a>
title="Printer-friendly" alt="Printer-friendly"
src="{% static 'doi_site/images/stfc/pf.png' %}" id="imgPF" /></a>
</div>
</div>
</div>
Expand Down
Loading