-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
<title>Turniej Elektrybałtów{% block "extratitle" %}{% endblock %}</title>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'pl'}
</script>
-{{ piwik_tag|safe }}
+{% load piwik_tags %}
+{% tracking_code %}
</body>
{% extends "edition1/base.html" %}
-{% load url from future %}
{% block "body" %}
<a href="mailto:radoslaw.czajka@nowoczesnapolska.org.pl">radoslaw.czajka@nowoczesnapolska.org.pl</a>.
Prosimy też o dołączenie do każdego zgłoszenia klauzuli o treści:
<cite>Zgłaszam się do konkursu „Turniej Elektrybałtów” i oświadczam, że
-znam i akceptuję jego <a href="{% url e1_rules_page %}">regulamin</a></cite>.
+znam i akceptuję jego <a href="{% url 'e1_rules_page' %}">regulamin</a></cite>.
</p>
-<p class='more'><a href="{% url e1_main_page %}">Powrót do strony głównej</a></p>
+<p class='more'><a href="{% url 'e1_main_page' %}">Powrót do strony głównej</a></p>
{% endblock %}
-from django.conf.urls.defaults import patterns, include, url
-from django.views.generic.simple import direct_to_template
+from django.conf.urls import patterns, url
+from django.views.generic import TemplateView
urlpatterns = patterns('',
url(r'^$', 'edition1.views.home', name='e1_main_page'),
- url(r'^regulamin/$', direct_to_template, {'template': 'edition1/rules.html'},
+ url(r'^regulamin/$', TemplateView.as_view(template_name='edition1/rules.html'),
name='e1_rules_page'),
- url(r'^wiecej/$', direct_to_template, {'template': 'edition1/more.html'},
+ url(r'^wiecej/$', TemplateView.as_view(template_name='edition1/more.html'),
name='e1_more_page'),
- url(r'^technikalia/$', direct_to_template, {'template': 'edition1/technical.html'},
+ url(r'^technikalia/$', TemplateView.as_view(template_name='edition1/technical.html'),
name='e1_technical_page'),
)
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
<title>Turniej Wolnych Lektur{% block "extratitle" %}{% endblock %}</title>
<a href='http://wolnelektury.pl'><img src='{{ STATIC_URL }}img/wl_black.png' alt='Wolne Lektury' title='Wolne Lektury' /></a>
</footer>
-
-{{ piwik_tag|safe }}
+{% load piwik_tags %}
+{% tracking_code %}
</body>
{% extends "edition2/base.html" %}
-{% load url from future %}
{% block "body" %}
{% block "body" %}
<h1>
- <a href='{% url e2_main_page %}' style="float:left;">
+ <a href='{% url "e2_main_page" %}' style="float:left;">
<img src="{{ STATIC_URL }}img/turniej-maly.png"
style='margin-right: .5em;' /></a>
II Turniej Wolnych Lektur</h1>
<h1>
- <a href='{% url e2_main_page %}' style="float:left;">
+ <a href='{% url "e2_main_page" %}' style="float:left;">
<img src="{{ STATIC_URL }}img/turniej-maly.png"
style='margin-right: .5em;' /></a>
II Turniej Wolnych Lektur</h1>
<h1>
- <a href='{% url e2_main_page %}' style="float:left;">
+ <a href='{% url "e2_main_page" %}' style="float:left;">
<img src="{{ STATIC_URL }}img/turniej-maly.png"
style='margin-right: .5em;' /></a>
II Turniej Wolnych Lektur</h1>
<a href="mailto:turniej@nowoczesnapolska.org.pl">turniej@nowoczesnapolska.org.pl</a>.
Prosimy też o dołączenie do każdego zgłoszenia klauzuli o treści:
<cite>Zgłaszam się do konkursu „II Turniej Wolnych Lektur” i oświadczam, że
- znam i akceptuję jego <a href="{% url e2_rules_page %}">regulamin</a></cite>.
+ znam i akceptuję jego <a href="{% url 'e2_rules_page' %}">regulamin</a></cite>.
</p>
-<p class='more'><a href="{% url e2_main_page %}">Powrót do strony głównej</a></p>
+<p class='more'><a href="{% url 'e2_main_page' %}">Powrót do strony głównej</a></p>
{% endblock %}
-from django.conf.urls.defaults import patterns, include, url
-from django.views.generic.simple import direct_to_template
+from django.conf.urls import patterns, url
+from django.views.generic import TemplateView
urlpatterns = patterns('',
- url(r'^$', direct_to_template, {'template': 'edition2/home.html'},
+ url(r'^$', TemplateView.as_view(template_name='edition2/home.html'),
name='e2_main_page'),
- url(r'^regulamin/$', direct_to_template, {'template': 'edition2/rules.html'},
+ url(r'^regulamin/$', TemplateView.as_view(template_name='edition2/rules.html'),
name='e2_rules_page'),
- url(r'^wiecej/$', direct_to_template, {'template': 'edition2/more.html'},
+ url(r'^wiecej/$', TemplateView.as_view(template_name='edition2/more.html'),
name='e2_more_page'),
- url(r'^technikalia/$', direct_to_template, {'template': 'edition2/technical.html'},
+ url(r'^technikalia/$', TemplateView.as_view(template_name='edition2/technical.html'),
name='e2_technical_page'),
)
{% extends "edition1/base.html" %}
-{% load url from future %}
{% block "body" %}
{% extends "edition1/base.html" %}
-{% load url from future %}
{% block "body" %}
-{% load url from future %}
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
<title>Turniej Elektrybałtów: {{ poem }}</title>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'pl'}
</script>
-{{ piwik_tag|safe }}
+{% load piwik_tags %}
+{% tracking_code %}
</body>
{% extends "edition1/base.html" %}
-{% load url from future %}
{% block "extratitle" %}: {{ poet.name }}{% endblock %}
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
urlpatterns = patterns('poetry.views',
url(r'^wiersz/(?P<slug>[a-zA-Z0-9-]+)/$', 'poem', name='poetry_poem'),
import time
from base64 import urlsafe_b64encode
-from django.utils.hashcompat import sha_constructor
+from hashlib import sha1
def get_hash(seed):
- sha_digest = sha_constructor('%s%s' %
+ sha_digest = sha1('%s%s' %
(time.time(), unicode(seed).encode('utf-8', 'replace'))).digest()
return urlsafe_b64encode(sha_digest).replace('=', '').replace('_', '-').lower()
-from __future__ import with_statement # needed for python 2.5
-from fabric.api import *
-from fabric.contrib import files
+from fnpdjango.deploy import *
-import os
-
-
-# ==========
-# = Config =
-# ==========
-# Globals
env.project_name = 'turniej'
-env.use_south = True
-
-# Servers
-def giewont():
- env.hosts = ['giewont.icm.edu.pl']
- env.user = 'lektury'
- env.path = '/srv/turniej.wolnelektury.pl'
- env.virtualenv = '/usr/bin/virtualenv'
- # This goes to VHost configuration
- env.server_name = 'turniej.wolnelektury.pl'
- env.server_admin = 'Radoslaw Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>'
- # /var/log/apache2/* logs
- env.access_log = 'turniej.log'
- env.error_log = 'turniej-errors.log'
-
-
-servers = [giewont]
-
-# =========
-# = Tasks =
-# =========
-def test():
- "Run the test suite and bail out if it fails"
- require('hosts', 'path', provided_by=servers)
- require('python', provided_by=[find_python])
- result = run('cd %(path)s/%(project_name)s; %(python)s manage.py test' % env)
-
-def setup():
- """
- Setup a fresh virtualenv as well as a few useful directories, then run
- a full deployment. virtualenv with pip should be already installed.
- """
- require('hosts', 'path', 'virtualenv', provided_by=servers)
-
- run('mkdir -p %(path)s; cd %(path)s; %(virtualenv)s ve;' % env, pty=True)
- run('cd %(path)s; mkdir releases; mkdir packages;' % env, pty=True)
- run('cd %(path)s/releases; ln -s . current; ln -s . previous' % env, pty=True)
- upload_default_localsettings()
- deploy()
-
-def deploy():
- """
- Deploy the latest version of the site to the servers,
- install any required third party modules,
- install the virtual host and then restart the webserver
- """
-
- import time
- env.release = time.strftime('%Y-%m-%dT%H%M')
-
- upload_tar_from_git()
- find_python()
- upload_wsgi_script()
- upload_vhost_sample()
- install_requirements()
- copy_localsettings()
- symlink_current_release()
- collectstatic()
- migrate()
- restart_webserver()
-
-def deploy_version(version):
- "Specify a specific version to be made live"
- require('hosts', 'path', provided_by=servers)
- env.version = version
- with cd(env.path):
- run('rm releases/previous; mv releases/current releases/previous;', pty=True)
- run('ln -s %(version)s releases/current' % env, pty=True)
- restart_webserver()
-
-def rollback():
- """
- Limited rollback capability. Simple loads the previously current
- version of the code. Rolling back again will swap between the two.
- """
- require('hosts', 'path', provided_by=servers)
- with cd(env.path):
- run('mv releases/current releases/_previous;', pty=True)
- run('mv releases/previous releases/current;', pty=True)
- run('mv releases/_previous releases/previous;', pty=True)
- restart_webserver()
-
-
-# =====================================================================
-# = Helpers. These are called by other functions rather than directly =
-# =====================================================================
-def upload_tar_from_git():
- "Create an archive from the current Git branch and upload it"
- print '>>> upload tar from git'
- require('path', provided_by=servers)
- require('release', provided_by=[deploy])
- local('/bin/bash lib/git-archive-all.sh --format tar %(release)s.tar' % env)
- local('gzip %(release)s.tar' % env)
- run('mkdir -p %(path)s/releases/%(release)s' % env, pty=True)
- run('mkdir -p %(path)s/packages' % env, pty=True)
- put('%(release)s.tar.gz' % env, '%(path)s/packages/' % env)
- run('cd %(path)s/releases/%(release)s && tar zxf ../../packages/%(release)s.tar.gz' % env, pty=True)
- local('rm %(release)s.tar.gz' % env)
-
-def find_python():
- "Finds where virtualenv Python stuff is"
- print ">>> find Python paths"
- require('path', provided_by=servers)
- env.python = '%(path)s/ve/bin/python' % env
- env.pip = '%(path)s/ve/bin/pip' % env
- env.site_packages = run('%(python)s -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"' % env)
-
-def upload_vhost_sample():
- "Create and upload Apache virtual host configuration sample"
- print ">>> upload vhost sample"
- require('path', 'project_name', 'user', provided_by=servers)
- require('access_log', 'error_log', 'server_admin', 'server_name', provided_by=servers)
- require('site_packages', provided_by=[find_python])
- files.upload_template('%(project_name)s.vhost.template' % env, '%(path)s/%(project_name)s.vhost' % env, context=env)
-
-def upload_wsgi_script():
- "Create and upload a wsgi script sample"
- print ">>> upload wsgi script sample"
- require('path', 'project_name', provided_by=servers)
- require('python', 'site_packages', provided_by=[find_python])
- files.upload_template('%(project_name)s.wsgi.template' % env, '%(path)s/%(project_name)s.wsgi' % env, context=env)
- run('chmod ug+x %(path)s/%(project_name)s.wsgi' % env)
-
-def install_requirements():
- "Install the required packages from the requirements file using pip"
- print '>>> install requirements'
- require('path', provided_by=servers)
- require('release', provided_by=[deploy])
- require('pip', provided_by=[find_python])
- run('%(pip)s install -r %(path)s/releases/%(release)s/requirements.txt' % env, pty=True)
-
-def secret_key():
- """Generates a new SECRET_KEY."""
- from random import Random
- import string
-
- r = Random()
- return "".join(r.choice(string.printable) for i in range(64))
-
-def upload_default_localsettings():
- "Uploads localsettings.py with media paths and stuff"
- print ">>> upload default localsettings.py"
- require('path', provided_by=servers)
-
- env.secret_key = secret_key()
- files.upload_template('%(project_name)s/localsettings.py.template' % env, '%(path)s/localsettings.py' % env, context=env)
-
-def copy_localsettings():
- "Copy localsettings.py from root directory to release directory (if this file exists)"
- print ">>> copy localsettings"
- require('path', 'project_name', provided_by=servers)
- require('release', provided_by=[deploy])
-
- with settings(warn_only=True):
- run('cp %(path)s/localsettings.py %(path)s/releases/%(release)s/%(project_name)s' % env)
-
-def symlink_current_release():
- "Symlink our current release"
- print '>>> symlink current release'
- require('path', provided_by=servers)
- require('release', provided_by=[deploy])
- with cd(env.path):
- run('rm releases/previous; mv releases/current releases/previous')
- run('ln -s %(release)s releases/current' % env)
-
-def collectstatic():
- """Runs collectstatic management command from Django staticfiles."""
- print '>>> collectstatic'
- require('path', 'project_name', provided_by=servers)
- require('python', provided_by=[find_python])
- with cd('%(path)s/releases/current/%(project_name)s' % env):
- run('%(python)s manage.py collectstatic --noinput' % env, pty=True)
-
-def migrate():
- "Update the database"
- print '>>> migrate'
- require('path', 'project_name', provided_by=servers)
- require('python', provided_by=[find_python])
- with cd('%(path)s/releases/current/%(project_name)s' % env):
- run('%(python)s manage.py syncdb --noinput' % env, pty=True)
- if env.use_south:
- run('%(python)s manage.py migrate' % env, pty=True)
-
-def restart_webserver():
- "Restart the web server"
- print '>>> restart webserver'
- require('path', 'project_name', provided_by=servers)
- run('touch %(path)s/%(project_name)s.wsgi' % env)
+env.hosts = ['giewont.icm.edu.pl']
+env.user = 'lektury'
+env.app_path = '/srv/turniej.wolnelektury.pl'
+env.services = [
+ DebianGunicorn('turniej'),
+]
+++ /dev/null
-#!/bin/bash -
-#
-# File: git-archive-all.sh
-#
-# Description: A utility script that builds an archive file(s) of all
-# git repositories and submodules in the current path.
-# Useful for creating a single tarfile of a git super-
-# project that contains other submodules.
-#
-# Examples: Use git-archive-all.sh to create archive distributions
-# from git repositories. To use, simply do:
-#
-# cd $GIT_DIR; git-archive-all.sh
-#
-# where $GIT_DIR is the root of your git superproject.
-#
-# License: GPL3
-#
-###############################################################################
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#
-###############################################################################
-
-# DEBUGGING
-set -e
-set -C # noclobber
-
-# TRAP SIGNALS
-trap 'cleanup' QUIT EXIT
-
-# For security reasons, explicitly set the internal field separator
-# to newline, space, tab
-OLD_IFS=$IFS
-IFS='
- '
-
-function cleanup () {
- rm -f $TMPFILE
- rm -f $TOARCHIVE
- IFS="$OLD_IFS"
-}
-
-function usage () {
- echo "Usage is as follows:"
- echo
- echo "$PROGRAM <--version>"
- echo " Prints the program version number on a line by itself and exits."
- echo
- echo "$PROGRAM <--usage|--help|-?>"
- echo " Prints this usage output and exits."
- echo
- echo "$PROGRAM [--format <fmt>] [--prefix <path>] [--separate|-s] [output_file]"
- echo " Creates an archive for the entire git superproject, and its submodules"
- echo " using the passed parameters, described below."
- echo
- echo " If '--format' is specified, the archive is created with the named"
- echo " git archiver backend. Obviously, this must be a backend that git archive"
- echo " understands. The format defaults to 'tar' if not specified."
- echo
- echo " If '--prefix' is specified, the archive's superproject and all submodules"
- echo " are created with the <path> prefix named. The default is to not use one."
- echo
- echo " If '--separate' or '-s' is specified, individual archives will be created"
- echo " for each of the superproject itself and its submodules. The default is to"
- echo " concatenate individual archives into one larger archive."
- echo
- echo " If 'output_file' is specified, the resulting archive is created as the"
- echo " file named. This parameter is essentially a path that must be writeable."
- echo " When combined with '--separate' ('-s') this path must refer to a directory."
- echo " Without this parameter or when combined with '--separate' the resulting"
- echo " archive(s) are named with a dot-separated path of the archived directory and"
- echo " a file extension equal to their format (e.g., 'superdir.submodule1dir.tar')."
-}
-
-function version () {
- echo "$PROGRAM version $VERSION"
-}
-
-# Internal variables and initializations.
-readonly PROGRAM=`basename "$0"`
-readonly VERSION=0.2
-
-OLD_PWD="`pwd`"
-TMPDIR=${TMPDIR:-/tmp}
-TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress
-TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"`
-OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default
-SEPARATE=0
-
-FORMAT=tar
-PREFIX=
-TREEISH=HEAD
-
-# RETURN VALUES/EXIT STATUS CODES
-readonly E_BAD_OPTION=254
-readonly E_UNKNOWN=255
-
-# Process command-line arguments.
-while test $# -gt 0; do
- case $1 in
- --format )
- shift
- FORMAT="$1"
- shift
- ;;
-
- --prefix )
- shift
- PREFIX="$1"
- shift
- ;;
-
- --separate | -s )
- shift
- SEPARATE=1
- ;;
-
- --version )
- version
- exit
- ;;
-
- -? | --usage | --help )
- usage
- exit
- ;;
-
- -* )
- echo "Unrecognized option: $1" >&2
- usage
- exit $E_BAD_OPTION
- ;;
-
- * )
- break
- ;;
- esac
-done
-
-if [ ! -z "$1" ]; then
- OUT_FILE="$1"
- shift
-fi
-
-# Validate parameters; error early, error often.
-if [ $SEPARATE -eq 1 -a ! -d $OUT_FILE ]; then
- echo "When creating multiple archives, your destination must be a directory."
- echo "If it's not, you risk being surprised when your files are overwritten."
- exit
-elif [ `git config -l | grep -q '^core\.bare=false'; echo $?` -ne 0 ]; then
- echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)."
- exit
-fi
-
-# Create the superproject's git archive
-git archive --format=$FORMAT --prefix="$PREFIX" $TREEISH > $TMPDIR/$(basename $(pwd)).$FORMAT
-echo $TMPDIR/$(basename $(pwd)).$FORMAT >| $TMPFILE # clobber on purpose
-superfile=`head -n 1 $TMPFILE`
-
-# find all '.git' dirs, these show us the remaining to-be-archived dirs
-find . -name '.git' -type d -print | sed -e 's/^\.\///' -e 's/\.git$//' | (grep -v '^$' || echo -n) >> $TOARCHIVE
-
-while read path; do
- TREEISH=$(git submodule | grep "^ .*${path%/} " | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path
- cd "$path"
- git archive --format=$FORMAT --prefix="${PREFIX}$path" ${TREEISH:-HEAD} > "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT
- if [ $FORMAT == 'zip' ]; then
- # delete the empty directory entry; zipped submodules won't unzip if we don't do this
- zip -d "$(tail -n 1 $TMPFILE)" "${PREFIX}${path%/}" >/dev/null # remove trailing '/'
- fi
- echo "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT >> $TMPFILE
- cd "$OLD_PWD"
-done < $TOARCHIVE
-
-# Concatenate archives into a super-archive.
-if [ $SEPARATE -eq 0 ]; then
- if [ $FORMAT == 'tar' ]; then
- sed -e '1d' $TMPFILE | while read file; do
- tar --concatenate -f "$superfile" "$file" && rm -f "$file"
- done
- elif [ $FORMAT == 'zip' ]; then
- sed -e '1d' $TMPFILE | while read file; do
- # zip incorrectly stores the full path, so cd and then grow
- cd `dirname "$file"`
- zip -g "$superfile" `basename "$file"` && rm -f "$file"
- done
- cd "$OLD_PWD"
- fi
-
- echo "$superfile" >| $TMPFILE # clobber on purpose
-fi
-
-while read file; do
- mv "$file" "$OUT_FILE"
-done < $TMPFILE
--- /dev/null
+#!/usr/bin/env python
+import os
+import sys
+
+ROOT = os.path.dirname(os.path.abspath(__file__))
+sys.path = [
+ os.path.join(ROOT, 'apps'),
+] + sys.path
+
+if __name__ == "__main__":
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "turniej.settings")
+
+ from django.core.management import execute_from_command_line
+
+ execute_from_command_line(sys.argv)
-i http://pypi.nowoczesnapolska.org.pl/simple
-Django>=1.4,<1.5
+Django>=1.6,<1.7
South>=0.7.4
-django-pipeline>=1.2,<1.3
-fnpdjango<0.2
+fnpdjango>=0.1.18,<0.2
-piwik
+django-piwik
+++ /dev/null
-<VirtualHost *:80>
- ServerName "%(server_name)s"
- ServerAdmin "%(server_admin)s"
-
- WSGIDaemonProcess %(project_name)s user=%(user)s group=%(user)s processes=2 threads=15 display-name=%%{GROUP} python-path=%(site_packages)s
- WSGIProcessGroup %(project_name)s
-
- WSGIScriptAlias / %(path)s/%(project_name)s.wsgi
- <Directory %(path)s>
- Order allow,deny
- allow from all
- </Directory>
-
- Alias /media %(path)s/media
- <Directory %(path)s/media>
- Options Indexes
- Order allow,deny
- Allow from all
- </Directory>
-
- Alias /static %(path)s/static
- <Directory %(path)s/static>
- Options Indexes
- Order allow,deny
- Allow from all
- </Directory>
-
- LogLevel warn
- ErrorLog /var/log/apache2/%(error_log)s
- CustomLog /var/log/apache2/%(access_log)s combined
-</VirtualHost>
+++ /dev/null
-#!%(python)s
-import site
-site.addsitedir('%(site_packages)s')
-
-import os
-from os.path import abspath, dirname, join
-import sys
-
-# Redirect sys.stdout to sys.stderr for bad libraries like geopy that use
-# print statements for optional import exceptions.
-sys.stdout = sys.stderr
-
-# Add apps and lib directories to PYTHONPATH
-sys.path = [
- '%(path)s/releases/current/%(project_name)s',
- '%(path)s/releases/current',
- '%(path)s/releases/current/apps',
- '%(path)s/releases/current/lib',
- # add paths to submodules here
-] + sys.path
-
-# Run Django
-os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
-
-from django.core.handlers.wsgi import WSGIHandler
-application = WSGIHandler()
+++ /dev/null
-#!/usr/bin/env python
-import os.path
-import sys
-
-ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-
-# Add apps and lib directories to PYTHONPATH
-sys.path = [
- os.path.join(ROOT, 'apps'),
- os.path.join(ROOT, 'lib'),
- # add /lib/* paths here for submodules
-] + sys.path
-
-from django.core.management import execute_manager
-import imp
-try:
- imp.find_module('settings') # Assumed to be in the same directory.
-except ImportError:
- import sys
- sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
- sys.exit(1)
-
-import settings
-
-if __name__ == "__main__":
- execute_manager(settings)
#'django.middleware.csrf.CsrfViewMiddleware',
#'django.contrib.auth.middleware.AuthenticationMiddleware',
#'django.contrib.messages.middleware.MessageMiddleware',
- 'piwik.django.middleware.PiwikMiddleware',
]
ROOT_URLCONF = 'turniej.urls'
# 'django.contrib.admindocs',
'south',
- 'piwik.django',
+ 'piwik',
'fnpdjango',
'poetry',
POETRY_POEMS_FOR_CONTEST = 20
+ALLOWED_HOSTS = [
+ 'turniej.wolnelektury.pl',
+]
+
# Load localsettings, if they exist
try:
from localsettings import *
-<!doctype html>
+<!DOCTYPE html>
<html>
<head>
<title>Turniej Elektrybałtów{% block "extratitle" %}{% endblock %}</title>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: 'pl'}
</script>
-{{ piwik_tag|safe }}
+{% load piwik_tags %}
+{% tracking_code %}
</body>
-from django.conf.urls.defaults import patterns, include, url
-from django.views.generic.simple import direct_to_template
+from django.conf.urls import patterns, include, url
from edition2.urls import urlpatterns as e2_urlpatterns
# from django.contrib import admin
--- /dev/null
+import os
+import os.path
+import sys
+
+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+
+# Add apps and lib directories to PYTHONPATH
+sys.path = [
+ os.path.join(ROOT, 'apps'),
+] + sys.path
+
+
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "turniej.settings")
+
+# This application object is used by the development server
+# as well as any WSGI server configured to use this file.
+from django.core.wsgi import get_wsgi_application
+application = get_wsgi_application()