summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlxf <lxf@d1stkfactory>2014-05-21 18:21:03 +0000
committerlxf <lxf@d1stkfactory>2014-05-21 18:21:03 +0000
commitf787e348df5aae0d53053b3e4cce3fb1ffbeccb2 (patch)
tree7976b716ae74cfec10e0f85481b2116b7799149e
parent750746d3d6f3cd297902a8d8ccd5d7519a9956e0 (diff)
additional fixes to run under python 3.2
-rw-r--r--app/blog/widgets.py4
-rw-r--r--app/lib/pagination/templatetags/pagination_tags.py12
-rw-r--r--app/projects/shortcuts.py2
-rw-r--r--config/requirements.txt14
-rw-r--r--config/settings/settings.py6
5 files changed, 24 insertions, 14 deletions
diff --git a/app/blog/widgets.py b/app/blog/widgets.py
index 33b2d9a..64509c2 100644
--- a/app/blog/widgets.py
+++ b/app/blog/widgets.py
@@ -8,7 +8,7 @@ import os
def thumbnail(image_path):
absolute_url = os.path.join(settings.IMAGES_URL, image_path[7:])
print(absolute_url)
- return u'<img style="max-width: 400px" src="%s" alt="%s" />' % (absolute_url, image_path)
+ return '<img style="max-width: 400px" src="%s" alt="%s" />' % (absolute_url, image_path)
class AdminImageWidget(AdminFileWidget):
"""
@@ -23,4 +23,4 @@ class AdminImageWidget(AdminFileWidget):
output.append('<a target="_blank" href="%s">%s</a>' % (file_path, thumbnail(file_name)))
output.append(super(AdminFileWidget, self).render(name, value, attrs))
- return mark_safe(u''.join(output))
+ return mark_safe(''.join(output))
diff --git a/app/lib/pagination/templatetags/pagination_tags.py b/app/lib/pagination/templatetags/pagination_tags.py
index dd47009..75c23f6 100644
--- a/app/lib/pagination/templatetags/pagination_tags.py
+++ b/app/lib/pagination/templatetags/pagination_tags.py
@@ -50,17 +50,17 @@ def do_autopaginate(parser, token):
try:
paginate_by = int(split[2])
except ValueError:
- raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2])
+ raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[2])
return AutoPaginateNode(split[1], paginate_by=paginate_by)
elif len(split) == 4:
try:
paginate_by = int(split[2])
except ValueError:
- raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[2])
+ raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[2])
try:
orphans = int(split[3])
except ValueError:
- raise template.TemplateSyntaxError(u'Got %s, but expected integer.' % split[3])
+ raise template.TemplateSyntaxError('Got %s, but expected integer.' % split[3])
return AutoPaginateNode(split[1], paginate_by=paginate_by, orphans=orphans)
else:
raise template.TemplateSyntaxError('%r tag takes one required argument and one optional argument' % split[0])
@@ -105,7 +105,7 @@ class AutoPaginateNode(template.Node):
try:
model = value[0].__class__
except IndexError:
- return u''
+ return ''
paginator_class = Paginator
paginator = paginator_class(value, self.paginate_by, self.orphans)
try:
@@ -113,13 +113,13 @@ class AutoPaginateNode(template.Node):
except InvalidPage:
context[key] = []
context['invalid_page'] = True
- return u''
+ return ''
context[key] = page_obj.object_list
context['paginator'] = paginator
context['page_obj'] = page_obj
if hasattr(context['request'], 'page_url'):
context['use_page_path'] = True
- return u''
+ return ''
def paginate(context, window=DEFAULT_WINDOW):
"""
diff --git a/app/projects/shortcuts.py b/app/projects/shortcuts.py
index d54410c..600e56d 100644
--- a/app/projects/shortcuts.py
+++ b/app/projects/shortcuts.py
@@ -1,7 +1,7 @@
from django.contrib.gis.db.models.fields import GeometryField
#from django.contrib.gis.gdal import Envelope
from django.contrib.gis.geos import Polygon
-from django.utils import simplejson
+import json as simplejson
from django.http import HttpResponse
#from django.db.models.fields.related import ManyRelatedManager
diff --git a/config/requirements.txt b/config/requirements.txt
index 15caa91..cea18cf 100644
--- a/config/requirements.txt
+++ b/config/requirements.txt
@@ -16,4 +16,16 @@ pep8
smartypants
-
+Markdown==2.4
+Pillow==2.4.0
+django-taggit==0.12
+django-typogrify==1.3.1
+flickr-api==0.5
+gunicorn==18.0
+jsmin==2.0.9
+oauth==1.0.1
+pep8==1.5.6
+psycopg2==2.5.3
+smartypants==1.8.3
+wsgiref==0.1.2
+
diff --git a/config/settings/settings.py b/config/settings/settings.py
index 8ad5f83..4af223c 100644
--- a/config/settings/settings.py
+++ b/config/settings/settings.py
@@ -18,6 +18,7 @@ DATABASES = {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'USER': 'luxagraf',
'PASSWORD': 'translinguis#',
+ 'HOST': '127.0.0.1',
}
}
@@ -134,10 +135,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
ROOT_URLCONF = 'config.base_urls'
TEMPLATE_DIRS = (
- os.path.join(PROJ_ROOT, 'design/templates')
- # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
- # Always use forward slashes, even on Windows.
- # Don't forget to use absolute paths, not relative paths.
+ os.path.join(PROJ_ROOT, 'design/templates'),
)