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
target/

View File

@ -2,7 +2,8 @@
a pragmatic and simple elearning webapp based on python django
requirements:
- python
- django
- python 2.7
- django 1.9
- 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
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
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'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
ALLOWED_HOSTS = ["127.0.0.1", "localhost"]
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
@ -42,12 +41,12 @@ INSTALLED_APPS = [
]
MIDDLEWARE_CLASSES = [
'django.middleware.security.SecurityMiddleware',
# 'django.middleware.security.SecurityMiddleware',
# 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'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',
]
@ -75,7 +74,6 @@ WSGI_APPLICATION = 'tkupek_elearning.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
@ -86,7 +84,6 @@ DATABASES = {
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
@ -105,7 +102,6 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/1.9/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
@ -119,5 +115,6 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = '/var/www/tkupek_elearning/elearning/static/'

View File

@ -25,4 +25,5 @@ urlpatterns = [
url(r'api', tkupek_elearning.elearning.views.get_answer),
url(r'statistic', tkupek_elearning.elearning.views.statistic),
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"
application = get_wsgi_application()