Anpassungen für das Hosting bei Djangoeurope und damit verbundenen Versionen Django 1.8 und Python 2.7

This commit is contained in:
Christian Berg
2015-08-05 18:55:48 +02:00
committed by Christian Berg
parent cb4b15b3c6
commit b96b485b61
1354 changed files with 7289 additions and 6858 deletions

67
.gitignore vendored
View File

@@ -1,12 +1,67 @@
*.pyc
htdocs/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Django Development
/static/
media/
virtenv/
/media/
.idea/
.gitignore
.project
.pydevproject
.settings/
*~
/kasu/static/css/kasu.css

View File

@@ -1,6 +1,8 @@
#!/bin/sh
source ./virtenv/bin/activate
#!/bin/bash
. /usr/share/virtualenvwrapper/virtualenvwrapper_lazy.sh
workon kasu
echo "aktualisiere Übersetzungen..."
exit
unset DJANGO_SETTINGS_MODULE
for dir in *
do

View File

@@ -1,25 +0,0 @@
{% extends "events/event_detail.html" %}
{% load i18n comments %}
{% block maincontent %}
<form action="" method="post" class="grid_12">
{% csrf_token %}
<header>
<h1 class="grid_12">Dieses Photo wirklich löschen?</h1>
</header>
<p>Sind Sie sicher, dass Sie das Bild &ldquo;{{photo.name}}&rdquo; löschen wollen?</p>
<img src="{{photo.display.url}}" alt="{{photo.name}}" title="{{photo.name}}" class="grid_10 push_1"/>
<br class="clear"/>
<p>&nbsp;</p>
<p class="buttonbar">
<a href="{% url 'event-photo-list' photo.event.id %}" class="button" style="float: left;"><img
src="{{STATIC_URL}}icons/cancel.png" alt="{% trans 'Cancel' %}"/> {% trans 'Cancel' %}</a>
<button type="submit"><img src="{{STATIC_URL}}icons/delete.png" alt="{% trans 'Delete' %}"/>
{% trans 'Delete' %}
</button>
</p>
</form>
{% endblock %}
{% block buttonbar %}{% endblock %}

View File

@@ -1,47 +0,0 @@
{% extends "events/event_detail.html" %}
{% load i18n %}
{% block title %}{{event.name}}{% endblock %}
{% block opengraph %}
<meta property="og:type" content="album" />
<meta property="og:title" content="{{event.name}}" />
<meta property="og:url" content="http://www.kasu.at{% url 'event-photo-list' event.pk %}" />
<meta property="og:image" content="http://www.kasu.at{{ event.get_thumbnail.url }}" />
{% if event.description %}<meta property="og:description" content="{{event.description}}" />{% endif %}
{% endblock %}
{% block maincontent %}
{% if perms.events.delete_photo %}
{% for photo in photo_list %}
<div class="thumbnail">
<a href="{{photo.get_absolute_url}}"><img src="{{photo.thumbnail.url}}" alt=""/></a>
<a href="{% url 'delete-event-photo' photo.pk %}" class="delete_image"><img src="{{STATIC_URL}}icons/delete.png" title="{% trans 'delete' %}"/></a>
</div>
{% endfor %}
{% else %}
{% for photo in photo_list %}
<a href="{{photo.get_absolute_url}}" class="thumbnail"><img src="{{photo.thumbnail.url}}" alt=""/></a>
{% endfor %}
{% endif %}
{% if perms.events.add_photo %}
<br class="clear" />
<form action="{% url 'event-photo-upload' event.id %}" method="post" enctype="multipart/form-data" class="grid_12">
{% csrf_token %}
<fieldset>
<legend>Photos hochladen</legend>
{% include "form.html"%}
<p class="buttonbar">
<button type="reset"><img src="{{STATIC_URL}}icons/arrow_undo.png" alt="{% trans 'reset' %}" /> {% trans 'reset' %}</button>
<button type="submit"><img src="{{STATIC_URL}}icons/image_add.png" alt="{% trans 'upload' %}" /> {% trans 'upload' %}</button>
</p>
</fieldset>
</form>
{% endif %}
{% endblock %}
{% block buttonbar %}{% endblock %}

Binary file not shown.

View File

@@ -1,211 +0,0 @@
from os import path
gettext = lambda s: s
PROJECT_PATH = path.abspath(path.join(path.dirname(__file__), '..', '..'))
PREREQ_APPS = [
'compressor',
'grappelli',
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.comments',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.messages',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.staticfiles',
'django_markdown',
'social.apps.django_app.default',
]
PROJECT_APPS = [
'aggregator',
'content',
'events',
'gallery',
'imagekit',
'membership',
'maistar_ranking',
'mahjong_ranking',
]
INSTALLED_APPS = PREREQ_APPS + PROJECT_APPS
ALLOWED_HOSTS = ['localhost', '.kasu.at']
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "smtp.googlemail.com"
EMAIL_PORT = "587"
EMAIL_HOST_USER = "webmaster@kasu.at"
EMAIL_HOST_PASSWORD = "Ees6aang"
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = "webmaster@kasu.at"
LOCALE_PATHS = (path.join(PROJECT_PATH, 'kasu', 'locale/'),)
AUTH_PROFILE_MODULE = 'membership.Membership'
AUTHENTICATION_BACKENDS = (
'social.backends.facebook.FacebookOAuth2',
'social.backends.google.GoogleOAuth2',
'social.backends.twitter.TwitterOAuth',
'django.contrib.auth.backends.ModelBackend',
)
ADMINS = (
('Christian Berg', 'xeniac.at@gmail.com'),
)
MANAGERS = ADMINS
ACCOUNT_ACTIVATION_DAYS = 5
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'kasu',
'USER': 'kasu',
'PASSWORD': 'F9lFbUaUvMcDA',
'HOST': 'localhost',
},
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
USE_TZ = True
TIME_ZONE = 'Europe/Vienna'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'de-at'
LANGUAGES = (
('de', gettext('German')),
('en', gettext("English")),
)
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = path.join(PROJECT_PATH, 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = '/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = path.join(PROJECT_PATH, 'static')
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
# ADMIN_MEDIA_PREFIX = path.join(STATIC_URL, "grappelli/")
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
path.join(PROJECT_PATH, 'kasu', 'static'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'compressor.finders.CompressorFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'uve7*2z2+2fs!ts80e(^2kxo^960!hl)cns@fpt_e%7qg52wy0'
MIDDLEWARE_CLASSES = [
'mahjong_ranking.middleware.DenormalizationUpdateMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
]
ROOT_URLCONF = 'kasu.urls'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
TEMPLATE_DIRS = (
path.join(PROJECT_PATH, 'kasu/templates/'),
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.core.context_processors.csrf',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'django.core.context_processors.static',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'content.context_processors.content_menus',
'events.context_processors.upcoming_events',
'social.apps.django_app.context_processors.backends',
'social.apps.django_app.context_processors.login_redirect',
)
# PREFIX_DEFAULT_LOCALE = True
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}
RECAPTCHA_PUBLIC_KEY = '6LcX_dcSAAAAAKx9FCP1Nc3EZMmiFIUPeUv5CVnt'
RECAPTCHA_PRIVATE_KEY = '6LcX_dcSAAAAAHL9m05oLSl-PiU71MLdheFWJnrC'
RECAPTCHA_THEME = 'red'
INTERNAL_IPS = ('127.0.0.1', '192.168.1.8')
##################
# SOCIAL AUTH #
##################
SOCIAL_AUTH_ENABLED_BACKENDS = ('facebook-oauth2', 'google-oauth2', 'twitter')
SOCIAL_AUTH_SLUGIFY_USERNAMES = True
SOCIAL_AUTH_CHANGE_SIGNAL_ONLY = False
LOGIN_URL = '/membership/login/'
LOGIN_ERROR_URL = '/membership/login/error/'
LOGIN_REDIRECT_URL = '/users/'
SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/users/'
SOCIAL_AUTH_FACEBOOK_KEY = '115196761917023'
SOCIAL_AUTH_FACEBOOK_SECRET = '6edf715f0506a1177b5479f8cae47566'
SOCIAL_AUTH_FACEBOOK_SCOPE = ['user_about_me', 'email']
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = '547248583417.apps.googleusercontent.com'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = '7jofzTy558SikOSV3cuTvY17'
SOCIAL_AUTH_TWITTER_KEY = 'c8UY7a5XrRlPFyuoUNJw'
SOCIAL_AUTH_TWITTER_SECRET = 'xLhz4zwAn3Lyl9MmJAiL85IurdmYzjDpoQF36du8tWg'

View File

@@ -1,26 +0,0 @@
###########################################
# Settings for the development enviroment #
###########################################
__author__ = 'Christian Berg'
from base import *
DEBUG = True
TEMPLATE_DEBUG = True
# Load the Rosetta translation tool
try:
import rosetta # @UnusedImport
INSTALLED_APPS.append('rosetta')
except ImportError:
pass
# Load the Django debug toolbar
try:
import debug_toolbar # @UnusedImport
INSTALLED_APPS.append('debug_toolbar')
MIDDLEWARE_CLASSES.append(
'debug_toolbar.middleware.DebugToolbarMiddleware') # @IgnorePep8
except ImportError:
pass

View File

@@ -1,74 +0,0 @@
##########################################
# Settings for the production enviroment #
##########################################
__author__ = 'Christian Berg'
from base import *
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
DEBUG = False
SESSION_COOKIE_DOMAIN = '.kasu.at' # Die ganze Domain Kasu
SESSION_COOKIE_AGE = 4838400 # Session dauer: 4 Wochen
TEMPLATE_DEBUG = False
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'filters': {
'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
# @IgnorePep8
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
}
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO',
'propagate': True,
},
'django.request': {
'handlers': ['console', 'mail_admins'],
'level': 'ERROR',
'propagate': False,
},
'kasu': {
'handlers': ['console', 'mail_admins'],
'level': 'DEBUG',
'propagate': False,
},
}
}

View File

@@ -1,75 +0,0 @@
##########################################
# Settings for the production enviroment #
##########################################
__author__ = 'Christian Berg'
from base import *
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
ALLOWED_HOSTS = ['*']
DEBUG = False
#SESSION_COOKIE_DOMAIN = '.kasu.at' # Die ganze Domain Kasu
SESSION_COOKIE_AGE = 4838400 # Session dauer: 4 Wochen
TEMPLATE_DEBUG = False
TEMPLATE_LOADERS = (
('django.template.loaders.cached.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'filters': {
'require_debug_false': {'()': 'django.utils.log.RequireDebugFalse'}
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
# @IgnorePep8
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
}
},
'loggers': {
'django': {
'handlers': ['console'],
'level': 'INFO',
'propagate': True,
},
'django.request': {
'handlers': ['console', 'mail_admins'],
'level': 'ERROR',
'propagate': False,
},
'kasu': {
'handlers': ['console', 'mail_admins'],
'level': 'DEBUG',
'propagate': False,
},
}
}

View File

@@ -1,8 +0,0 @@
#!/usr/bin/env python2
import os
import sys
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)

1
manage.py Symbolic link
View File

@@ -0,0 +1 @@
src/manage.py

View File

@@ -1,18 +1,24 @@
BeautifulSoup
django < 1.7
django >= 1.7, < 1.9
django-appconf
django-compressor
django-contrib-comments
django-grappelli
django-imagekit
# django-markdown
django-markdown
django-social-auth
feedparser
icalendar
jsmin
markdown < 2.5
MySQL-python
pillow
psycopg2
PyJWT
python-social-auth
pytz==2013d
requests
requests-oauthlib
xlwt
markdown < 2.5
bzr+https://code.launchpad.net/~adam.russell/pyexiv2/pyexiv2-0.3

View File

@@ -1,3 +1,5 @@
-r base.txt
django-debugbar
django-debug-toolbar
django-sslserver
rosetta
sqlparse

View File

@@ -2,7 +2,7 @@ from datetime import datetime, time
from django.conf import settings
from django.utils.translation import ugettext as _
from django.contrib import comments
import django_comments as comments
from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Rss201rev2Feed

View File

View File

@@ -2,7 +2,8 @@
import os
from django.conf import settings
from django.contrib import comments
import django_comments as comments
from django.http import HttpResponse, Http404
from django.utils.translation import ugettext as _
from django.views import generic

View File

@@ -57,3 +57,4 @@ class EventForm(forms.ModelForm):
class Meta(object):
model = models.Event
exclude = ('event_count', 'event_series', )

View File

@@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: kasu.utils\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-05 19:23+0100\n"
"PO-Revision-Date: 2014-12-14 01:11+0100\n"
"Last-Translator: Christian Berg <xeniac.at@gmail.com>\n"
"PO-Revision-Date: 2015-08-04 23:47+0100\n"
"Last-Translator: Christian Berg <xeniac@posteo.at>\n"
"Language-Team: Kasu <verein@kasu.at>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.6.11\n"
"X-Translated-Using: django-rosetta 0.7.2\n"
"X-Translated-Using: django-rosetta 0.7.6\n"
#: image_models.py:14
msgid "left"
@@ -1049,7 +1049,7 @@ msgstr "Englisch"
#: templates/404.html:8
msgid "The page your requested does not exist on this server."
msgstr ""
msgstr "Die angeforderte Seite existiert auf diesem Server nicht."
#: templates/base.html:23
msgid "Current News"
@@ -1068,7 +1068,6 @@ msgid "Current Event"
msgstr "Aktuelle Veranstaltung"
#: templates/base.html:60
#, fuzzy
msgid "Since"
msgstr "seit"
@@ -1291,15 +1290,11 @@ msgstr ""
msgid ""
"\n"
"<p>You can register here with your Google, or Facebook account.\n"
"If you don't own such an account, or do not want to use it for "
"authentication,\n"
"If you don't own such an account, or do not want to use it for authentication,\n"
"you can fill out our registration form.</p>\n"
msgstr ""
"\n"
"<p>Du kannst dich hier mit deinen Google, Twitter, oder Facebook Account "
"anmelden. Wenn du so etwas nicht besitzt, oder es nicht für die Anmeldung "
"verwenden möchtest, kannst du auch unser Registrierungsformular verwenden.</"
"p>\n"
"<p>Du kannst dich hier mit deinen Google, Twitter, oder Facebook Account anmelden. Wenn du so etwas nicht besitzt, oder es nicht für die Anmeldung verwenden möchtest, kannst du auch unser Registrierungsformular verwenden.</p>\n"
#: templates/registration/login.html:43
msgid "Your username and password didn't match. Please try again."

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 161 KiB

After

Width:  |  Height:  |  Size: 161 KiB

View File

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View File

Before

Width:  |  Height:  |  Size: 781 B

After

Width:  |  Height:  |  Size: 781 B

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 523 B

View File

Before

Width:  |  Height:  |  Size: 464 B

After

Width:  |  Height:  |  Size: 464 B

View File

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

Some files were not shown because too many files have changed in this diff Show More