Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
S
Scinage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Science Computing
Scinage
Commits
91ea958d
Commit
91ea958d
authored
Dec 17, 2020
by
Mirko Vucicevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rejig settings
parent
9ad006c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
44 deletions
+103
-44
.gitignore
.gitignore
+1
-0
scinage/settings_base.py
scinage/settings_base.py
+32
-44
scinage/settings_example.py
scinage/settings_example.py
+59
-0
scinage/urls_default.py
scinage/urls_default.py
+11
-0
No files found.
.gitignore
View file @
91ea958d
...
...
@@ -5,6 +5,7 @@ docs/
solr/
media/
scinage/settings_local.py
scinage/settings.py
whoosh_index/
*.bak
bin/
...
...
scinage/settings.py
→
scinage/settings
_base
.py
View file @
91ea958d
"""
Django settings for scinage project.
import
os
Generated by 'django-admin startproject' using Django 1.8.5.
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
try
:
from
.settings_local
import
*
except
Exception
as
e
:
from
.settings_local_example
import
*
# Application definition
INSTALLED_APPS
=
(
INSTALLED_APPS
=
[
'django.contrib.admin'
,
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
...
...
@@ -29,27 +15,26 @@ INSTALLED_APPS = (
'haystack'
,
'taggit'
,
'layers'
,
# 'undelete',
'rest_framework'
,
'django_cas_ng'
,
'sass_processor'
,
#'independoc',
)
]
MIDDLEWARE
=
[
'django.middleware.
common.Common
Middleware'
,
'django.middleware.
security.Security
Middleware'
,
'django.contrib.sessions.middleware.SessionMiddleware'
,
'django.middleware.common.CommonMiddleware'
,
'django.middleware.csrf.CsrfViewMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
'django.contrib.messages.middleware.MessageMiddleware'
,
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
'scinage.middleware.UserMaskMiddleware'
,
]
ROOT_URLCONF
=
'scinage.urls'
TEMPLATES
=
[
{
'BACKEND'
:
'django.template.backends.django.DjangoTemplates'
,
'DIRS'
:
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)
],
'DIRS'
:
[],
'APP_DIRS'
:
True
,
'OPTIONS'
:
{
'context_processors'
:
[
...
...
@@ -57,27 +42,31 @@ TEMPLATES = [
'django.template.context_processors.request'
,
'django.contrib.auth.context_processors.auth'
,
'django.contrib.messages.context_processors.messages'
,
'scinage.context_processors.newlysaved'
,
],
},
},
]
REST_FRAMEWORK
=
{
# Use Django's standard `django.contrib.auth` permissions,
# or allow read-only access for unauthenticated users.
'DEFAULT_PERMISSION_CLASSES'
:
[
'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly'
]
}
WSGI_APPLICATION
=
'scinage.wsgi.application'
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
}
}
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'
,
},
]
WSGI_APPLICATION
=
'scinage.wsgi.application'
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'America/Toronto'
USE_I18N
=
True
...
...
@@ -85,9 +74,9 @@ USE_L10N = True
USE_TZ
=
True
STATIC_URL
=
'/static/'
TIME_ZONE
=
'America/Toronto'
MEDIA_URL
=
'/media/'
CRISPY_TEMPLATE_PACK
=
'bootstrap3'
...
...
@@ -101,5 +90,4 @@ DOC_URL = '/static/documentation/index.html'
COMPRESS_ROOT
=
'/static/css/'
LOGIN_REDIRECT_URL
=
'/'
STATIC_URL
=
'/static/'
LOGIN_REDIRECT_URL
=
'/'
\ No newline at end of file
scinage/settings_
local_
example.py
→
scinage/settings_example.py
View file @
91ea958d
import
os
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
from
.settings_base
import
*
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'@ieti4$o(7jf8_3*kz0x5d6hb4z$@1rhh=_u)=b2g@o1n+eoi5'
...
...
@@ -11,15 +8,6 @@ DEBUG = True
ALLOWED_HOSTS
=
[]
LANGUAGE_CODE
=
'en-us'
TIME_ZONE
=
'UTC'
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.sqlite3'
,
...
...
@@ -27,14 +15,11 @@ DATABASES = {
}
}
STATIC_URL
=
'/static/'
MEDIA_URL
=
'/media/'
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
# STATIC_ROOT = os.path.join(BASE_DIR, "static")
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
"static"
),)
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.locmem.LocMemCache'
,
}
}
HAYSTACK_CONNECTIONS
=
{
'default'
:
{
...
...
@@ -43,25 +28,6 @@ HAYSTACK_CONNECTIONS = {
},
}
AUTHENTICATION_BACKENDS
=
(
'django.contrib.auth.backends.ModelBackend'
,
'django_cas_ng.backends.CASBackend'
,
)
MIDDLEWARE_CLASSES
=
(
'django.middleware.common.CommonMiddleware'
,
'django.contrib.sessions.middleware.SessionMiddleware'
,
'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'
,
'cas.middleware.CASMiddleware'
,
'scinage.middleware.UserMaskMiddleware'
,
)
CAS_SERVER_URL
=
"https://cas.uwaterloo.ca/cas/"
TWITTER_KEYS
=
(
'....'
,
...
...
@@ -72,8 +38,13 @@ TWITTER_TOKEN_KEYS = (
'...'
,
)
# Email related variables, these are used for sending emails related to the
# password reset process
EMERGENCY_ALERTS_ENABLED
=
True
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'media'
)
STATIC_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'staticfiles'
)
EMAIL_BACKEND
=
'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST
=
'<smtp.gmail.com | OR OTHER HOST>'
EMAIL_USE_TLS
=
True
...
...
@@ -81,20 +52,8 @@ EMAIL_PORT = 587
EMAIL_HOST_USER
=
'<EMAIL ADDRESS>'
EMAIL_HOST_PASSWORD
=
'<EMAIL PASSWORD>'
LOGGING
=
{
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'handlers'
:
{
'console'
:
{
'class'
:
'logging.StreamHandler'
,
},
},
'loggers'
:
{
'django'
:
{
'handlers'
:
[
'console'
],
'level'
:
os
.
getenv
(
'DJANGO_LOG_LEVEL'
,
'INFO'
),
},
},
}
EMERGENCY_ALERTS_ENABLED
=
True
# Change these to handle alternate auth methoids
ROOT_URLCONF
=
'scinage.default_urls'
LOGIN_URL
=
'/auth/login'
LOGOUT_URL
=
'/auth/logout'
\ No newline at end of file
scinage/urls_default.py
0 → 100644
View file @
91ea958d
# The default URL settings for scinage. Uses local auth.
# Write a new setup to handle non-local auth if needed
from
django.urls
import
path
from
django.contrib.admin
import
site
urlpatterns
=
[
path
(
'login'
,
site
.
login
,
name
=
'login'
),
path
(
'logout'
,
site
.
logout
,
name
=
'logout'
),
path
(
''
,
include
(
'scinage.urls'
))
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment