some changes for apache2 deployment

This commit is contained in:
Timo Tomasini 2016-03-19 13:54:19 +01:00
parent 58f4467ad0
commit e7de4008ef
12 changed files with 39 additions and 15 deletions

1
.gitignore vendored
View file

@ -57,3 +57,4 @@ docs/_build/
# PyBuilder # PyBuilder
target/ target/

View file

@ -2,7 +2,8 @@
a pragmatic and simple elearning webapp based on python django a pragmatic and simple elearning webapp based on python django
requirements: requirements:
- python - python 2.7
- django - django 1.9
- sqlite3 - sqlite3
- tinymce - tinymce 2.3

21
apache2/httpd.conf Normal file
View file

@ -0,0 +1,21 @@
WSGIScriptAlias / /var/www/tkupek_elearning/wsgi.py
WSGIDaemonProcess elearning user=apache group=nobody processes=10 threads=1
WSGIProcessGroup elearning
Alias /static/ /var/www/tkupek_elearning/elearning/static/
<Directory /var/www/tkupek_elearning/elearning/static>
Order allow,deny
Allow from all
</Directory>
<Directory /var/www/tkupek_elearning>
Options +FollowSymLinks
<Files wsgi.py>
Order allow,deny
Allow from all
</Files>
</Directory>

View file

@ -8,3 +8,4 @@ if __name__ == "__main__":
from django.core.management import execute_from_command_line from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) execute_from_command_line(sys.argv)

View file

@ -1,3 +0,0 @@
from django.test import TestCase
# Create your tests here.

View file

@ -0,0 +1 @@
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/

View file

@ -0,0 +1 @@
/usr/local/lib/python2.7/dist-packages/tinymce/static/django_tinymce/

View file

@ -207,3 +207,4 @@ function ajaxRequest() {
else else
return false return false
} }

View file

@ -0,0 +1 @@
/usr/local/lib/python2.7/dist-packages/tinymce/static/tiny_mce/

View file

@ -23,13 +23,12 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '_*hrxgzo(8hkrp5f8n4j9vo15acsy0b88yiy$6d5ezwi&pns(j' SECRET_KEY = '_*hrxgzo(8hkrp5f8n4j9vo15acsy0b88yiy$6d5ezwi&pns(j'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = True
ALLOWED_HOSTS = ["127.0.0.1", "localhost"] ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
@ -42,12 +41,12 @@ INSTALLED_APPS = [
] ]
MIDDLEWARE_CLASSES = [ MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware', # 'django.middleware.security.SecurityMiddleware',
# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware',
] ]
@ -75,7 +74,6 @@ WSGI_APPLICATION = 'tkupek_elearning.wsgi.application'
# Database # Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = { DATABASES = {
'default': { 'default': {
'ENGINE': 'django.db.backends.sqlite3', 'ENGINE': 'django.db.backends.sqlite3',
@ -86,7 +84,6 @@ DATABASES = {
# Password validation # Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [ AUTH_PASSWORD_VALIDATORS = [
{ {
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
@ -105,7 +102,6 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/ # https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'
@ -119,5 +115,6 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/ # https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = '/var/www/tkupek_elearning/elearning/static/'

View file

@ -26,3 +26,4 @@ urlpatterns = [
url(r'statistic', tkupek_elearning.elearning.views.statistic), url(r'statistic', tkupek_elearning.elearning.views.statistic),
url(r'^tinymce/', include('tinymce.urls')), url(r'^tinymce/', include('tinymce.urls')),
] ]

View file

@ -19,3 +19,4 @@ sys.path.append(base_parent)
os.environ["DJANGO_SETTINGS_MODULE"] = "tkupek_elearning.settings" os.environ["DJANGO_SETTINGS_MODULE"] = "tkupek_elearning.settings"
application = get_wsgi_application() application = get_wsgi_application()