django-gravatar2-1.4.4/0000755000076500000240000000000013616063566015474 5ustar tristanstaff00000000000000django-gravatar2-1.4.4/LICENSE0000644000076500000240000000210513607006776016477 0ustar tristanstaff00000000000000Copyright (c) 2013 Tristan Waddington Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. django-gravatar2-1.4.4/MANIFEST.in0000644000076500000240000000011413616063152017215 0ustar tristanstaff00000000000000include README include README.rst include LICENSE include example_project/* django-gravatar2-1.4.4/PKG-INFO0000644000076500000240000001102213616063566016565 0ustar tristanstaff00000000000000Metadata-Version: 1.1 Name: django-gravatar2 Version: 1.4.4 Summary: Essential Gravatar support for Django. Features helper methods, templatetags and a full test suite! Home-page: https://github.com/twaddington/django-gravatar Author: Tristan Waddington Author-email: tristan.waddington@gmail.com License: MIT Description: django-gravatar ================ .. image:: https://travis-ci.org/twaddington/django-gravatar.svg?branch=master :target: https://travis-ci.org/twaddington/django-gravatar A lightweight django-gravatar app. Includes helper methods for interacting with gravatars outside of template code. Features -------- - Helper methods for constructing a gravatar url and checking an email for an existing gravatar - Templatetags for generating a gravatar url or gravatar tag. - Full test suite! Installing ---------- Install from PyPi: You can pip install the app directly from GitHub: :: $ pip install git+git://github.com/twaddington/django-gravatar.git#egg=DjangoGravatar Alternatively, you can now install directly from PyPi! :: $ pip install django-gravatar2 Make sure you install `django-gravatar2 `_ as there are several other incompatible django-gravatar libraries available. Add django_gravatar to your INSTALLED_APPS in settings.py: :: INSTALLED_APPS = ( # ... 'django_gravatar', ) Basic Usage ----------- Use in code: :: from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash url = get_gravatar_url('alice@example.com', size=150) gravatar_exists = has_gravatar('bob@example.com') profile_url = get_gravatar_profile_url('alice@example.com') email_hash = calculate_gravatar_hash('alice@example.com') Use in templates: :: {% load gravatar %} {% gravatar_url user.email 150 %} # https://secure.gravatar.com/avatar/hash.jpg?size=150 {% gravatar user.email 150 %} # {% gravatar user.email 150 "user@example.com" %} # user@example.com {% gravatar_profile_url user.email %} # https://secure.gravatar.com/hash Configuring ----------- The following options can be configured in your settings.py: GRAVATAR_URL # Gravatar base url. Defaults to 'http://www.gravatar.com/' GRAVATAR_SECURE_URL # Gravatar base secure https url. Defaults to 'https://secure.gravatar.com/' GRAVATAR_DEFAULT_SIZE # Gravatar size in pixels. Defaults to '80' GRAVATAR_DEFAULT_IMAGE # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. Defaults to 'mm' GRAVATAR_DEFAULT_RATING # One of the following: 'g', 'pg', 'r', 'x'. Defaults to 'g' GRAVATAR_DEFAULT_SECURE # True to use https by default, False for plain http. Defaults to True Contributing ------------ Feel free to `fork django-gravatar `_ on GitHub! We'd love to see your pull requests. Please make sure you run tests before submitting a patch. Run tests: :: $> cd example_project $> ./manage.py test django_gravatar Keywords: django gravatar avatar Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Framework :: Django django-gravatar2-1.4.4/README0000644000076500000240000000002713607006776016353 0ustar tristanstaff00000000000000Please see README.rst. django-gravatar2-1.4.4/README.rst0000644000076500000240000000571713616063175017171 0ustar tristanstaff00000000000000django-gravatar ================ .. image:: https://travis-ci.org/twaddington/django-gravatar.svg?branch=master :target: https://travis-ci.org/twaddington/django-gravatar A lightweight django-gravatar app. Includes helper methods for interacting with gravatars outside of template code. Features -------- - Helper methods for constructing a gravatar url and checking an email for an existing gravatar - Templatetags for generating a gravatar url or gravatar tag. - Full test suite! Installing ---------- Install from PyPi: You can pip install the app directly from GitHub: :: $ pip install git+git://github.com/twaddington/django-gravatar.git#egg=DjangoGravatar Alternatively, you can now install directly from PyPi! :: $ pip install django-gravatar2 Make sure you install `django-gravatar2 `_ as there are several other incompatible django-gravatar libraries available. Add django_gravatar to your INSTALLED_APPS in settings.py: :: INSTALLED_APPS = ( # ... 'django_gravatar', ) Basic Usage ----------- Use in code: :: from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash url = get_gravatar_url('alice@example.com', size=150) gravatar_exists = has_gravatar('bob@example.com') profile_url = get_gravatar_profile_url('alice@example.com') email_hash = calculate_gravatar_hash('alice@example.com') Use in templates: :: {% load gravatar %} {% gravatar_url user.email 150 %} # https://secure.gravatar.com/avatar/hash.jpg?size=150 {% gravatar user.email 150 %} # {% gravatar user.email 150 "user@example.com" %} # user@example.com {% gravatar_profile_url user.email %} # https://secure.gravatar.com/hash Configuring ----------- The following options can be configured in your settings.py: GRAVATAR_URL # Gravatar base url. Defaults to 'http://www.gravatar.com/' GRAVATAR_SECURE_URL # Gravatar base secure https url. Defaults to 'https://secure.gravatar.com/' GRAVATAR_DEFAULT_SIZE # Gravatar size in pixels. Defaults to '80' GRAVATAR_DEFAULT_IMAGE # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. Defaults to 'mm' GRAVATAR_DEFAULT_RATING # One of the following: 'g', 'pg', 'r', 'x'. Defaults to 'g' GRAVATAR_DEFAULT_SECURE # True to use https by default, False for plain http. Defaults to True Contributing ------------ Feel free to `fork django-gravatar `_ on GitHub! We'd love to see your pull requests. Please make sure you run tests before submitting a patch. Run tests: :: $> cd example_project $> ./manage.py test django_gravatar django-gravatar2-1.4.4/django_gravatar/0000755000076500000240000000000013616063566020625 5ustar tristanstaff00000000000000django-gravatar2-1.4.4/django_gravatar/__init__.py0000644000076500000240000000000013607006776022724 0ustar tristanstaff00000000000000django-gravatar2-1.4.4/django_gravatar/compat.py0000644000076500000240000000120113607006776022454 0ustar tristanstaff00000000000000""" This module provides compatibility with older versions of Django and Python """ try: from urllib.parse import urlparse, parse_qs, quote_plus, urlencode except ImportError: # Python 2 from urlparse import urlparse, parse_qs from urllib import quote_plus, urlencode try: from urllib.request import Request, urlopen except ImportError: # Python 2 from urllib2 import Request, urlopen try: from urllib.error import HTTPError except ImportError: # Python 2 from urllib2 import HTTPError try: from urllib.error import URLError except ImportError: # Python 2 from urllib2 import URLError django-gravatar2-1.4.4/django_gravatar/helpers.py0000644000076500000240000000653313607006776022650 0ustar tristanstaff00000000000000import hashlib from django.conf import settings from .compat import urlencode, urlopen, Request, HTTPError, URLError # These options can be used to change the default image if no gravatar is found GRAVATAR_DEFAULT_IMAGE_404 = '404' GRAVATAR_DEFAULT_IMAGE_MYSTERY_MAN = 'mm' GRAVATAR_DEFAULT_IMAGE_IDENTICON = 'identicon' GRAVATAR_DEFAULT_IMAGE_MONSTER = 'monsterid' GRAVATAR_DEFAULT_IMAGE_WAVATAR = 'wavatar' GRAVATAR_DEFAULT_IMAGE_RETRO = 'retro' # These options can be used to restrict gravatar content GRAVATAR_RATING_G = 'g' GRAVATAR_RATING_PG = 'pg' GRAVATAR_RATING_R = 'r' GRAVATAR_RATING_X = 'x' # Get Gravatar base url from settings.py GRAVATAR_URL = getattr(settings, 'GRAVATAR_URL', 'http://www.gravatar.com/') GRAVATAR_SECURE_URL = getattr(settings, 'GRAVATAR_SECURE_URL', 'https://secure.gravatar.com/') # Get user defaults from settings.py GRAVATAR_DEFAULT_SIZE = getattr(settings, 'GRAVATAR_DEFAULT_SIZE', 80) GRAVATAR_DEFAULT_IMAGE = getattr(settings, 'GRAVATAR_DEFAULT_IMAGE', GRAVATAR_DEFAULT_IMAGE_MYSTERY_MAN) GRAVATAR_DEFAULT_RATING = getattr(settings, 'GRAVATAR_DEFAULT_RATING', GRAVATAR_RATING_G) GRAVATAR_DEFAULT_SECURE = getattr(settings, 'GRAVATAR_DEFAULT_SECURE', True) def calculate_gravatar_hash(email): # Calculate the email hash enc_email = email.strip().lower().encode("utf-8") email_hash = hashlib.md5(enc_email).hexdigest() return email_hash def get_gravatar_url(email, size=GRAVATAR_DEFAULT_SIZE, default=GRAVATAR_DEFAULT_IMAGE, rating=GRAVATAR_DEFAULT_RATING, secure=GRAVATAR_DEFAULT_SECURE): """ Builds a url to a gravatar from an email address. :param email: The email to fetch the gravatar for :param size: The size (in pixels) of the gravatar to fetch :param default: What type of default image to use if the gravatar does not exist :param rating: Used to filter the allowed gravatar ratings :param secure: If True use https, otherwise plain http """ if secure: url_base = GRAVATAR_SECURE_URL else: url_base = GRAVATAR_URL # Calculate the email hash email_hash = calculate_gravatar_hash(email) # Build querystring query_string = urlencode({ 's': str(size), 'd': default, 'r': rating, }) # Build url url = '{base}avatar/{hash}.jpg?{qs}'.format(base=url_base, hash=email_hash, qs=query_string) return url def has_gravatar(email): """ Returns True if the user has a gravatar, False if otherwise """ # Request a 404 response if the gravatar does not exist url = get_gravatar_url(email, default=GRAVATAR_DEFAULT_IMAGE_404) # Verify an OK response was received try: request = Request(url) request.get_method = lambda: 'HEAD' return 200 == urlopen(request).code except (HTTPError, URLError): return False def get_gravatar_profile_url(email, secure=GRAVATAR_DEFAULT_SECURE): """ Builds a url to a gravatar profile from an email address. :param email: The email to fetch the gravatar for :param secure: If True use https, otherwise plain http """ if secure: url_base = GRAVATAR_SECURE_URL else: url_base = GRAVATAR_URL # Calculate the email hash email_hash = calculate_gravatar_hash(email) # Build url url = '{base}{hash}'.format(base=url_base, hash=email_hash) return url django-gravatar2-1.4.4/django_gravatar/models.py0000644000076500000240000000002513607006776022457 0ustar tristanstaff00000000000000"""Stub models.py""" django-gravatar2-1.4.4/django_gravatar/templatetags/0000755000076500000240000000000013616063566023317 5ustar tristanstaff00000000000000django-gravatar2-1.4.4/django_gravatar/templatetags/__init__.py0000644000076500000240000000000013607006776025416 0ustar tristanstaff00000000000000django-gravatar2-1.4.4/django_gravatar/templatetags/gravatar.py0000644000076500000240000000304513607016156025473 0ustar tristanstaff00000000000000from django import template from django.utils.html import escape from django.utils.safestring import mark_safe from ..helpers import GRAVATAR_DEFAULT_SIZE, get_gravatar_profile_url, get_gravatar_url # Get template.Library instance register = template.Library() def gravatar_url(user_or_email, size=GRAVATAR_DEFAULT_SIZE): """ Builds a gravatar url from an user or email """ if hasattr(user_or_email, 'email'): email = user_or_email.email else: email = user_or_email try: return escape(get_gravatar_url(email=email, size=size)) except: return '' def gravatar(user_or_email, size=GRAVATAR_DEFAULT_SIZE, alt_text='', css_class='gravatar'): """ Builds an gravatar tag from an user or email """ if hasattr(user_or_email, 'email'): email = user_or_email.email else: email = user_or_email try: url = escape(get_gravatar_url(email=email, size=size)) except: return '' return mark_safe( '{alt}'.format( css_class=css_class, src=url, width=size, height=size, alt=alt_text ) ) def gravatar_profile_url(user_or_email): if hasattr(user_or_email, 'email'): email = user_or_email.email else: email = user_or_email try: return escape(get_gravatar_profile_url(email)) except: return '' register.simple_tag(gravatar_url) register.simple_tag(gravatar) register.simple_tag(gravatar_profile_url) django-gravatar2-1.4.4/django_gravatar/tests.py0000644000076500000240000001306213607006776022343 0ustar tristanstaff00000000000000from django.template import Context, Template from django.test import TestCase from django.utils.html import escape from .compat import parse_qs, quote_plus, urlparse from .helpers import * class TestGravatarHelperMethods(TestCase): def test_gravatar_hash_generation(self): """ Verify the generation of hash from email string. """ email = "MyEmailAddress@example.com" email_hash = "0bc83cb571cd1c50ba6f3e8a78ef1346" self.assertEqual(calculate_gravatar_hash(email), email_hash) self.assertEqual(calculate_gravatar_hash(email), calculate_gravatar_hash(email.lower())) def test_gravatar_url(self): """ Verify that the gravatar_url method returns the expected output. """ email = "joe@example.com" email_upper = "JOE@example.com" email_strip = " JOE@example.com " # Construct the url url = get_gravatar_url(email) # Verify email is properly sanitized self.assertEqual(url, get_gravatar_url(email_upper)) self.assertEqual(url, get_gravatar_url(email_strip)) # Parse query string from url urlp = urlparse(url) qs = parse_qs(urlp.query) # Verify the correct query arguments are included with the proper defaults self.assertTrue('s' in qs) self.assertTrue('d' in qs) self.assertTrue('r' in qs) self.assertEqual(qs.get('s').pop(), str(GRAVATAR_DEFAULT_SIZE)) self.assertEqual(qs.get('d').pop(), GRAVATAR_DEFAULT_IMAGE) self.assertEqual(qs.get('r').pop(), GRAVATAR_DEFAULT_RATING) # Verify the correct protocol is used if GRAVATAR_DEFAULT_SECURE: self.assertTrue(GRAVATAR_SECURE_URL in url) else: self.assertTrue(GRAVATAR_URL in url) # Verify that a url value for default is urlencoded default_url = 'https://www.example.com/default.jpg' url = get_gravatar_url(email, default=default_url) # Verify urlencoding self.assertTrue(quote_plus(default_url) in url) def test_has_gravatar(self): """ Verify that the has_gravatar helper method correctly determines if a user has a gravatar or not. """ bad_email = 'eve@example.com' good_email = 'matt@automattic.com' self.assertFalse(has_gravatar(bad_email)) self.assertTrue(has_gravatar(good_email)) def test_gravatar_profile_url(self): """ Verify that the get_gravatar_profile_url helper method correctly generates a profile url for gravatar user. """ email = 'joe@example.com' profile_url = get_gravatar_profile_url(email) email_hash = calculate_gravatar_hash(email) self.assertTrue(profile_url.endswith(email_hash)) class TestGravatarTemplateTags(TestCase): def test_gravatar_url(self): email = 'matt@automattic.com' context = Context({'email': email}) t = Template("{% load gravatar %}{% gravatar_url email %}") rendered = t.render(context) self.assertEqual(rendered, escape(get_gravatar_url(email))) def test_gravatar_img(self): # Some defaults for testing email = 'matt@automattic.com' alt_text = 'some alt text' css_class = 'gravatar-thumb' size = 250 # Build context context = Context({ 'email': email, 'size': size, 'alt_text': alt_text, 'css_class': css_class, }) # Default behavior t = Template("{% load gravatar %}{% gravatar email %}") rendered = t.render(context) self.assertTrue(escape(get_gravatar_url(email)) in rendered) self.assertTrue('class="gravatar"' in rendered) self.assertTrue('alt=""' in rendered) t = Template("{% load gravatar %}{% gravatar email size alt_text css_class %}") rendered = t.render(context) self.assertTrue('width="%s"' % (size,) in rendered) self.assertTrue('height="%s"' % (size,) in rendered) self.assertTrue('alt="%s"' % (alt_text,) in rendered) self.assertTrue('class="%s"' % (css_class,) in rendered) def test_gravatar_user_url(self): # class with email attribute class user: email = 'bouke@webatoom.nl' context = Context({'user': user}) t = Template("{% load gravatar %}{% gravatar_url user %}") rendered = t.render(context) self.assertEqual(rendered, escape(get_gravatar_url(user.email))) def test_gravatar_user_img(self): # class with email attribute class user: email = 'bouke@webatoom.nl' context = Context({'user': user}) t = Template("{% load gravatar %}{% gravatar user %}") rendered = t.render(context) self.assertTrue(escape(get_gravatar_url(user.email)) in rendered) def test_invalid_input(self): context = Context({'email': None}) t = Template("{% load gravatar %}{% gravatar email %}") rendered = t.render(context) self.assertEqual("", rendered, "Invalid input should return empty result") def test_gravatar_profile_url(self): """ Verify the profile url generated from template gravatar_profile_url tag. """ # class with email attribute class user: email = 'bouke@webatoom.nl' context = Context({'user': user}) t = Template("{% load gravatar %}{% gravatar_profile_url user %}") rendered = t.render(context) self.assertEqual(rendered, escape(get_gravatar_profile_url(user.email))) django-gravatar2-1.4.4/django_gravatar/views.py0000644000076500000240000000002413607006776022330 0ustar tristanstaff00000000000000"""Stub views.py""" django-gravatar2-1.4.4/django_gravatar2.egg-info/0000755000076500000240000000000013616063566022401 5ustar tristanstaff00000000000000django-gravatar2-1.4.4/django_gravatar2.egg-info/PKG-INFO0000644000076500000240000001102213616063566023472 0ustar tristanstaff00000000000000Metadata-Version: 1.1 Name: django-gravatar2 Version: 1.4.4 Summary: Essential Gravatar support for Django. Features helper methods, templatetags and a full test suite! Home-page: https://github.com/twaddington/django-gravatar Author: Tristan Waddington Author-email: tristan.waddington@gmail.com License: MIT Description: django-gravatar ================ .. image:: https://travis-ci.org/twaddington/django-gravatar.svg?branch=master :target: https://travis-ci.org/twaddington/django-gravatar A lightweight django-gravatar app. Includes helper methods for interacting with gravatars outside of template code. Features -------- - Helper methods for constructing a gravatar url and checking an email for an existing gravatar - Templatetags for generating a gravatar url or gravatar tag. - Full test suite! Installing ---------- Install from PyPi: You can pip install the app directly from GitHub: :: $ pip install git+git://github.com/twaddington/django-gravatar.git#egg=DjangoGravatar Alternatively, you can now install directly from PyPi! :: $ pip install django-gravatar2 Make sure you install `django-gravatar2 `_ as there are several other incompatible django-gravatar libraries available. Add django_gravatar to your INSTALLED_APPS in settings.py: :: INSTALLED_APPS = ( # ... 'django_gravatar', ) Basic Usage ----------- Use in code: :: from django_gravatar.helpers import get_gravatar_url, has_gravatar, get_gravatar_profile_url, calculate_gravatar_hash url = get_gravatar_url('alice@example.com', size=150) gravatar_exists = has_gravatar('bob@example.com') profile_url = get_gravatar_profile_url('alice@example.com') email_hash = calculate_gravatar_hash('alice@example.com') Use in templates: :: {% load gravatar %} {% gravatar_url user.email 150 %} # https://secure.gravatar.com/avatar/hash.jpg?size=150 {% gravatar user.email 150 %} # {% gravatar user.email 150 "user@example.com" %} # user@example.com {% gravatar_profile_url user.email %} # https://secure.gravatar.com/hash Configuring ----------- The following options can be configured in your settings.py: GRAVATAR_URL # Gravatar base url. Defaults to 'http://www.gravatar.com/' GRAVATAR_SECURE_URL # Gravatar base secure https url. Defaults to 'https://secure.gravatar.com/' GRAVATAR_DEFAULT_SIZE # Gravatar size in pixels. Defaults to '80' GRAVATAR_DEFAULT_IMAGE # An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. Defaults to 'mm' GRAVATAR_DEFAULT_RATING # One of the following: 'g', 'pg', 'r', 'x'. Defaults to 'g' GRAVATAR_DEFAULT_SECURE # True to use https by default, False for plain http. Defaults to True Contributing ------------ Feel free to `fork django-gravatar `_ on GitHub! We'd love to see your pull requests. Please make sure you run tests before submitting a patch. Run tests: :: $> cd example_project $> ./manage.py test django_gravatar Keywords: django gravatar avatar Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 Classifier: Framework :: Django django-gravatar2-1.4.4/django_gravatar2.egg-info/SOURCES.txt0000644000076500000240000000103113616063566024260 0ustar tristanstaff00000000000000LICENSE MANIFEST.in README README.rst setup.cfg setup.py django_gravatar/__init__.py django_gravatar/compat.py django_gravatar/helpers.py django_gravatar/models.py django_gravatar/tests.py django_gravatar/views.py django_gravatar/templatetags/__init__.py django_gravatar/templatetags/gravatar.py django_gravatar2.egg-info/PKG-INFO django_gravatar2.egg-info/SOURCES.txt django_gravatar2.egg-info/dependency_links.txt django_gravatar2.egg-info/top_level.txt example_project/__init__.py example_project/manage.py example_project/settings.pydjango-gravatar2-1.4.4/django_gravatar2.egg-info/dependency_links.txt0000644000076500000240000000000113616063566026447 0ustar tristanstaff00000000000000 django-gravatar2-1.4.4/django_gravatar2.egg-info/top_level.txt0000644000076500000240000000002013616063566025123 0ustar tristanstaff00000000000000django_gravatar django-gravatar2-1.4.4/example_project/0000755000076500000240000000000013616063566020655 5ustar tristanstaff00000000000000django-gravatar2-1.4.4/example_project/__init__.py0000644000076500000240000000000013607006776022754 0ustar tristanstaff00000000000000django-gravatar2-1.4.4/example_project/manage.py0000755000076500000240000000036213607006776022463 0ustar tristanstaff00000000000000#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) django-gravatar2-1.4.4/example_project/settings.py0000644000076500000240000001321413607006776023070 0ustar tristanstaff00000000000000# Django settings for {{ project_name }} project. import os PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'sqlite.db', # Or path to database file if using sqlite3. 'USER': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. } } DOCKIT_BACKENDS = { 'default': { 'ENGINE': 'dockit.backends.mongo.backend.MongoDocumentStorage', 'USER': 'travis', 'PASSWORD': 'test', 'DB': 'mydb_test', 'HOST': '127.0.0.1', 'PORT': 27017, } } # 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. TIME_ZONE = 'America/Chicago' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en-us' # 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 = os.path.join(PROJECT_DIR, '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 = '' # URL prefix for static files. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/' # URL prefix for admin static files -- CSS, JavaScript and images. # Make sure to use a trailing slash. # Examples: "http://foo.com/static/admin/", "/static/admin/". ADMIN_MEDIA_PREFIX = '/static/admin/' # 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. ) # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', # 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) # Make this unique, and don't share it with anybody. SECRET_KEY = 'example_project_test_key' # 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', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) MIDDLEWARE = MIDDLEWARE_CLASSES # ROOT_URLCONF = 'urls' TEMPLATE_DIRS = ( # 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. ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_gravatar', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs', ) # 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. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } } TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': TEMPLATE_DIRS, 'OPTIONS': { 'debug': TEMPLATE_DEBUG, 'loaders': TEMPLATE_LOADERS, 'context_processors': ( 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ) }, }, ] django-gravatar2-1.4.4/setup.cfg0000644000076500000240000000007513616063566017317 0ustar tristanstaff00000000000000[wheel] universal = 1 [egg_info] tag_build = tag_date = 0 django-gravatar2-1.4.4/setup.py0000644000076500000240000000204613616063250017176 0ustar tristanstaff00000000000000try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='django-gravatar2', version='1.4.4', description='Essential Gravatar support for Django. Features helper' ' methods, templatetags and a full test suite!', long_description=open('README.rst').read(), keywords='django gravatar avatar', license='MIT', author='Tristan Waddington', author_email='tristan.waddington@gmail.com', url='https://github.com/twaddington/django-gravatar', packages=['django_gravatar', 'django_gravatar.templatetags'], classifiers=[ 'Development Status :: 5 - Production/Stable', # 4 Beta, 5 Production/Stable 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Framework :: Django', ] )