Django 1.6
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 2 Apr 2014 13:48:00 +0000 (15:48 +0200)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Wed, 2 Apr 2014 13:48:00 +0000 (15:48 +0200)
contact/admin.py
contact/forms.py
contact/urls.py
prawokultury/settings.d/30-apps.py
prawokultury/settings.d/40-auth.py
prawokultury/settings.d/40-middleware.py
prawokultury/settings.d/50-contrib.py
prawokultury/templates/base.html
requirements.txt

index 3776fc4..ee1623d 100644 (file)
@@ -7,7 +7,7 @@ from django.template import Template
 from django.utils.safestring import mark_safe
 
 
-class ContactAdminMeta(admin.ModelAdmin.__metaclass__):
+class ContactAdminMeta(admin.ModelAdmin.__class__):
     def __getattr__(cls, name):
         if name.startswith('admin_list_'):
             return lambda self: ""
index d2df1f7..142d209 100644 (file)
@@ -1,7 +1,8 @@
 from django.contrib.sites.models import Site
+from django.core.exceptions import ValidationError
 from django.core.files.uploadedfile import UploadedFile
 from django.core.mail import send_mail, mail_managers
-from django.core.validators import email_re
+from django.core.validators import validate_email
 from django import forms
 from django.template.loader import render_to_string
 from django.template import RequestContext
@@ -11,7 +12,7 @@ from .models import Attachment, Contact
 
 contact_forms = {}
 admin_list_width = 0
-class ContactFormMeta(forms.Form.__metaclass__):
+class ContactFormMeta(forms.Form.__class__):
     def __new__(cls, *args, **kwargs):
         global admin_list_width
         model = super(ContactFormMeta, cls).__new__(cls, *args, **kwargs)
@@ -68,7 +69,11 @@ class ContactForm(forms.Form):
         mail_managers(mail_managers_subject, mail_managers_body, 
             fail_silently=True)
 
-        if email_re.match(contact.contact):
+        try:
+            validate_email(contact.contact)
+        except ValidationError:
+            pass
+        else:
             mail_subject = render_to_string([
                     'contact/%s/mail_subject.txt' % self.form_tag,
                     'contact/mail_subject.txt', 
index de72e82..7f8d4c4 100644 (file)
@@ -1,4 +1,4 @@
-from django.conf.urls.defaults import *
+from django.conf.urls import patterns, url
 from . import views
 
 urlpatterns = patterns('contact.views',
index 374cd3c..5e2abf4 100644 (file)
@@ -9,7 +9,7 @@ INSTALLED_APPS = (
     'chunks',
 
     'sponsors',
-    'gravatar',
+    'django_gravatar',
     'south',
     'django.contrib.comments',
     'django_comments_xtd',
@@ -17,7 +17,7 @@ INSTALLED_APPS = (
     'haystack',
     'pagination',
     'sorl.thumbnail',
-    'piwik.django',
+    'piwik',
     'django_cas',
 
     'django.contrib.auth',
index 675db9d..14847ac 100644 (file)
@@ -1,5 +1,5 @@
 if 'django_cas' in INSTALLED_APPS:
     AUTHENTICATION_BACKENDS = (
         'django.contrib.auth.backends.ModelBackend',
-        'django_cas.backends.CASBackend',
+        'fnpdjango.auth_backends.AttrCASBackend',
     )
index 530e34a..e55f98a 100644 (file)
@@ -15,7 +15,6 @@ if 'django_cas' in INSTALLED_APPS:
 
 MIDDLEWARE_CLASSES += (
     'django.contrib.messages.middleware.MessageMiddleware',
-    'piwik.django.middleware.PiwikMiddleware',
     # Uncomment the next line for simple clickjacking protection:
     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
     'pagination.middleware.PaginationMiddleware',
index 97aa2f3..61c2ed0 100644 (file)
@@ -13,8 +13,11 @@ THUMBNAIL_QUALITY = 95
 
 GRAVATAR_DEFAULT_IMAGE = 'http://localhost:8000/static/img/avatar.png'
 
-CAS_SERVER_URL = 'http://logowanie.nowoczesnapolska.org.pl/cas/'
-CAS_VERSION = '1'
+CAS_SERVER_URL = 'https://logowanie.nowoczesnapolska.org.pl/cas/'
+CAS_VERSION = '3'
 
 
 SPONSORS_THUMB_HEIGHT = None
+
+PIWIK_URL = ''
+PIWIK_SITE_ID = 0
index 7b5a4b0..80d162c 100755 (executable)
@@ -1,10 +1,10 @@
 <!DOCTYPE html>
-{% load url from future %}
 {% load i18n %}
 {% load static from staticfiles %}
 {% load fnp_common migdal_tags fnp_share fnp_lang menu_tags %}
 {% load sponsor_tags %}
 {% load compressed %}
+{% load piwik_tags %}
 <html prefix="og: http://ogp.me/ns#">
     <head>
        <title>{% block "titleextra" %}{% endblock %}CopyCamp</title>
@@ -93,6 +93,6 @@
     </div>
     <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js" charset="utf-8"></script>
     {% compressed_js 'base' %}
-    {{ piwik_tag|safe }}
+    {% tracking_code %}
     </body>
 </html>
index 005a2d9..0b8887a 100644 (file)
@@ -1,31 +1,29 @@
-Django>=1.4,<1.5
-#django_cas
--e hg+https://bitbucket.org/cpcc/django-cas@197f156ee943#egg=django_cas
+-i http://pypi.nowoczesnapolska.org.pl/simple
+
+Django>=1.6,<1.7
+fnpdjango
+django_cas>=2.1,<2.2
 South>=0.7.4
 PIL
 sorl-thumbnail>=11.09,<12
 django-pagination
+django-migdal>=0.4,<0.5
+pytz
 
--e git+git://github.com/fnp/fnpdjango.git@9a5b05c52311da4f726fec29d8be7d173f695352#egg=fnpdjango
--e git+git://github.com/fnp/django-migdal.git@734cd58d3f12c5397b42c1ae122c947500386014#egg=django-migdal
-
-#django-jsonfield
--e git+git://github.com/bradjasper/django-jsonfield.git@2f427368ad70bf8d9a0580df58ec0eb0654d62ae#egg=django-jsonfield
-
--e git+git://github.com/fnp/django-migdal.git@734cd58d3f12c5397b42c1ae122c947500386014#egg=django-migdal
+jsonfield>=0.9.20
 
 textile
-django-markupfield<1.1  # 1.1 wants Django-1.5
-django-gravatar
-django_comments_xtd
+django-markupfield>=1.2,<1.3
+django-gravatar2
+django-comments-xtd>=1.2,<1.3
 django-pipeline>=1.2,<1.3
 
 #pyScss
 #git+git://github.com/Kronuz/pyScss.git@d8f4da23a3c87696a75b3830ed4ab49b75550a93#egg=pyScss
 #TODO: pyScss support, for now just install sass
 
--e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack
+django-haystack>=2.1,<2.2
 pysolr
-piwik
+django-piwik
 
--e git+https://github.com/fnp/django-sponsors.git@master#egg=django-sponsors
+django-sponsors