Skip to content

Commit

Permalink
Add files accidentally deleted by merge
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarPersson committed Feb 1, 2017
1 parent 2334540 commit a43bc0c
Show file tree
Hide file tree
Showing 11 changed files with 2,030 additions and 0 deletions.
29 changes: 29 additions & 0 deletions ESSArch_TP/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
ESSArch is an open source archiving and digital preservation system
ESSArch Tools for Producer (ETP)
Copyright (C) 2005-2017 ES Solutions AB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact information:
Web - http://www.essolutions.se
Email - essarch@essolutions.se
"""

from __future__ import absolute_import

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app # noqa
234 changes: 234 additions & 0 deletions ESSArch_TP/config/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
"""
ESSArch is an open source archiving and digital preservation system
ESSArch Tools for Producer (ETP)
Copyright (C) 2005-2017 ES Solutions AB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact information:
Web - http://www.essolutions.se
Email - essarch@essolutions.se
"""

"""
Django settings for ETP project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""

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.9/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'ze7xnd#&9_m)05j&j8wpu!=dp+jlj3olk&@k7amq9-s2x+b=$%'
SESSION_COOKIE_NAME = 'etp'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'preingest.pagination.LinkHeaderPagination',
'PAGE_SIZE': 10
}


# Application definition

INSTALLED_APPS = [
'allauth',
'allauth.account',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.sites',
'rest_auth',
'rest_auth.registration',
'rest_framework',
'rest_framework.authtoken',
'corsheaders',
'frontend',
'ESSArch_Core.config',
'ESSArch_Core.configuration',
'ESSArch_Core.ip',
'ESSArch_Core.profiles',
'ESSArch_Core.essxml.Generator',
'ESSArch_Core.essxml.ProfileMaker',
'ESSArch_Core.WorkflowEngine',
]

SITE_ID = 1

MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

CORS_ORIGIN_ALLOW_ALL = True
ROOT_URLCONF = 'config.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'config.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
#'STORAGE_ENGINE': 'MyISAM', # STORAGE_ENGINE for MySQL database tables, 'MyISAM' or 'INNODB'
'NAME': 'etp', # Or path to database file if using sqlite3.
'USER': 'arkiv', # Not used with sqlite3.
'PASSWORD': 'password', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
# This options for storage_engine have to be set for "south migrate" to work.
'OPTIONS': {
#"init_command": "SET storage_engine=MyISAM", # MySQL (<= 5.5.2)
"init_command": "SET default_storage_engine=MyISAM", # MySQL (>= 5.5.3)
}
}
}

# Password validation
# https://docs.djangoproject.com/en/1.9/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',
},
]

# Django Rest Auth serializers
# http://django-rest-auth.readthedocs.io/en/latest/configuration.html

REST_AUTH_SERIALIZERS = {
'USER_DETAILS_SERIALIZER': 'preingest.serializers.UserSerializer'
}


# File elements in different metadata standards

FILE_ELEMENTS = {
"file": {
"path": "FLocat@href",
"pathprefix": "file:///",
"checksum": "@CHECKSUM",
"checksumtype": "@CHECKSUMTYPE",
},
"mdRef": {
"path": "@href",
"pathprefix": "file:///",
"checksum": "@CHECKSUM",
"checksumtype": "@CHECKSUMTYPE",
},
"object": {
"path": "storage/contentLocation/contentLocationValue",
"pathprefix": "file:///",
"checksum": "objectCharacteristics/fixity/messageDigest",
"checksumtype": "objectCharacteristics/fixity/messageDigestAlgorithm",
"format": "objectCharacteristics/format/formatDesignation/formatName",
},
}

# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'Europe/Stockholm'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_root')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)

# Add etp vhost to rabbitmq:
# rabbitmqctl add_user guest guest
# rabbitmqctl add_vhost etp
# rabbitmqctl set_permissions -p etp guest ".*" ".*" ".*"

# Celery settings
BROKER_URL = 'amqp://guest:guest@localhost:5672/etp'
CELERY_IMPORTS = ("preingest.tasks", "ESSArch_Core.WorkflowEngine.tests.tasks")
CELERY_RESULT_BACKEND = 'amqp://'

# Rest auth settings
OLD_PASSWORD_FIELD_ENABLED = True

try:
from local_etp_settings import *
except ImportError, exp:
pass
113 changes: 113 additions & 0 deletions ESSArch_TP/config/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
"""
ESSArch is an open source archiving and digital preservation system
ESSArch Tools for Producer (ETP)
Copyright (C) 2005-2017 ES Solutions AB
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Contact information:
Web - http://www.essolutions.se
Email - essarch@essolutions.se
"""

"""etp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views

from rest_framework import routers

from ESSArch_Core.configuration.views import (
AgentViewSet,
EventTypeViewSet,
ParameterViewSet,
PathViewSet,
SysInfoView,
)

from ip.views import (
ArchivalInstitutionViewSet,
ArchivistOrganizationViewSet,
ArchivalTypeViewSet,
ArchivalLocationViewSet,
EventIPViewSet,
InformationPackageViewSet,
)

from preingest.views import (
GroupViewSet,
PermissionViewSet,
ProcessStepViewSet,
ProcessTaskViewSet,
UserViewSet,
)

from profiles.views import (
ProfileViewSet,
ProfileSAViewSet,
ProfileIPViewSet,
SubmissionAgreementViewSet,
)

admin.site.site_header = 'ESSArch Tools Producer Administration'
admin.site.site_title = 'ESSArch Tools Producer Administration'

router = routers.DefaultRouter()
router.register(r'users', UserViewSet)
router.register(r'groups', GroupViewSet)
router.register(r'permissions', PermissionViewSet)
router.register(r'archival-institutions', ArchivalInstitutionViewSet)
router.register(r'archivist-organizations', ArchivistOrganizationViewSet)
router.register(r'archival-types', ArchivalTypeViewSet)
router.register(r'archival-locations', ArchivalLocationViewSet)
router.register(r'information-packages', InformationPackageViewSet)
router.register(r'steps', ProcessStepViewSet)
router.register(r'tasks', ProcessTaskViewSet)
router.register(r'events', EventIPViewSet)
router.register(r'event-types', EventTypeViewSet)
router.register(r'submission-agreements', SubmissionAgreementViewSet)
router.register(r'profiles', ProfileViewSet)
router.register(r'profile-sa', ProfileSAViewSet)
router.register(r'profile-ip', ProfileIPViewSet)
router.register(r'agents', AgentViewSet)
router.register(r'parameters', ParameterViewSet)
router.register(r'paths', PathViewSet)

urlpatterns = [
url(r'^', include('frontend.urls'), name='home'),
url(r'^admin/', admin.site.urls),
url(r'^api/sysinfo/', SysInfoView.as_view()),
url(r'^api/', include(router.urls)),
url(r'^accounts/changepassword', auth_views.password_change, {'post_change_redirect': '/'} ),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^template/', include('ESSArch_Core.essxml.ProfileMaker.urls')),
url(r'^accounts/login/$', auth_views.login),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
]
Loading

0 comments on commit a43bc0c

Please sign in to comment.