Skip to content
Snippets Groups Projects
Commit f4c8b549 authored by Jonathan Weth's avatar Jonathan Weth :keyboard: Committed by root
Browse files

Merge pull request #20 from Katharineum/master

Apply new config for server
parents 0430e762 bec0e95b
No related branches found
No related tags found
1 merge request!86Merge school-apps
__pycache__
env/
*.pyc
secure*
\ No newline at end of file
This diff is collapsed.
......@@ -17,18 +17,32 @@ keine
## Installation
### Grundsystem
```
apt install python3 python3-pip python3-mysqldb git mysql-server
pip3 install django
apt install python3 python3-dev python3-pip git mariadb-server python3-venv
```
### MySQL-Datenbank
1. Datenbank `schoolapps` (`utf8_general_ci`) anlegen
2. Benutzer `www-data` anlegen
3. Benutzer `www-data` alle Rechte auf `schoolapps` geben
4. Benutzer `untis-read` anlegen
5. Benutzer `untis-read` Leserechte auf UNTIS-DB geben
```
mysql -u root -p
CREATE DATABASE schoolapps;
```
### Django
- Zum Installationsordner wechseln
```
python3 -m venv env
source env/bin/activate
pip install mysqlclient
pip install django
```
- `example_secure_settings.py` zu `secure_settings.py` kopieren und anpassen
# EMAIL
EMAIL_HOST = 'postoffice.katharineum.de'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'infoplan@katharineum.de'
EMAIL_HOST_PASSWORD = 'grummelPASS1531'
# SECRET KEY
SECRET_KEY = '_89lg!56$d^sf$22cz1ja_f)x9z(nc*y-x*@j4!!vzmlgi*53u'
# DATABASES
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'schoolapps',
'USER': 'www-data',
'PASSWORD': 'grummelPASS1531',
'HOST': '',
'PORT': ''
},
'untis': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'untiskath',
'USER': 'www-data',
'PASSWORD': 'grummelPASS1531',
'HOST': '',
'PORT': ''
}
}
......@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.0/ref/settings/
"""
import os
from .secure_settings import *
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -19,7 +20,8 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '_89lg!56$d^sf$22cz1ja_f)x9z(nc*y-x*@j4!!vzmlgi*53u'
# SECRET_KEY = '_89lg!56$d^sf$22cz1ja_f)x9z(nc*y-x*@j4!!vzmlgi*53u'
# Provided by secure_settings
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
......@@ -56,7 +58,7 @@ ROOT_URLCONF = 'schoolapps.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['./templates', ],
'DIRS': ['./templates', '/srv/sites/school-apps/schoolapps/templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......@@ -73,25 +75,25 @@ WSGI_APPLICATION = 'schoolapps.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'schoolapps',
'USER': 'www-data',
'PASSWORD': 'grummelPASS1531',
'HOST': '',
'PORT': ''
},
'untis': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'untiskath',
'USER': 'www-data',
'PASSWORD': 'grummelPASS1531',
'HOST': '',
'PORT': ''
}
}
# Provided by secure_settings
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'schoolapps',
# 'USER': 'www-data',
# 'PASSWORD': 'grummelPASS1531',
# 'HOST': '',
# 'PORT': ''
# },
# 'untis': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'untiskath',
# 'USER': 'www-data',
# 'PASSWORD': 'grummelPASS1531',
# 'HOST': '',
# 'PORT': ''
# }
# }
# Password validation
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
......@@ -138,10 +140,7 @@ STATICFILES_DIRS = [
# EMAIL
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'postoffice.katharineum.de'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'infoplan@katharineum.de'
EMAIL_HOST_PASSWORD = 'grummelPASS1531'
# Email settings provided by secure_settings
EMAIL_USE_TLS = True
# TIMETABLE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment