1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-05-07 07:27:44 +00:00

Add authentication and registration to seahub

This commit is contained in:
plt 2011-04-30 13:18:32 +08:00
parent 8b357aedae
commit e8d2300473
128 changed files with 4893 additions and 6 deletions
base
media
profile
setenv.sh.templatesettings.py
templates
thirdpart

21
base/accounts.py Normal file
View File

@ -0,0 +1,21 @@
from django.conf import settings
from django.contrib.auth.models import User
class EmailOrUsernameModelBackend(object):
def authenticate(self, username=None, password=None):
if '@' in username:
kwargs = {'email': username}
else:
kwargs = {'username': username}
try:
user = User.objects.get(**kwargs)
if user.check_password(password):
return user
except User.DoesNotExist:
return None
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None

BIN
media/avatars/default.png Normal file

Binary file not shown.

After

(image error) Size: 7.3 KiB

View File

@ -29,6 +29,9 @@ table.default tr.first { background-color: #00FF00; }
#right-panel { float:right; width:800px; }
#footer { color:#999; padding-top:2px; margin:25px 0; border-top:1px solid #DDD; }
/* #header */
#header .top_operation { float:right; margin:2px 10px 0 0; color:#ddd; font-size:13px; }
#header .top_operation a { font-weight:normal; font-size:13px; margin-left:2px; text-decoration: none; }
#header .top_operation a:hover { background:#0A0; color:#FFF; }
#logo { margin-top: 4px; }
#header #ident { margin-top: 8px; float: right; font-size: 12px; }
#header #ident p { color: #808; }
@ -42,7 +45,7 @@ div.nav-separator { clear: both; border-top: #FF8C00 1px solid; border-bottom: n
/* footer */
#footer a { color:#333; text-decoration:none; }
/* main */
h2 { font-size:16px; color:#292; padding:4px 0 2px 0px; border-bottom: 2px solid #2B2; background-position:left 22px; margin:10px 0; }
h2 { font-size:16px; color:#292; padding:4px 0 2px 0px; margin:10px 0; }
h3 { font-size: 14px; color: #808; margin: 10px 0px 4px 0; }
p { line-height: 22px; }
ol { margin:0; padding:0px 0 0 2em; list-style-position:inside; }

0
profile/__init__.py Normal file
View File

4
profile/admin.py Normal file
View File

@ -0,0 +1,4 @@
from django.contrib import admin
from profile.models import UserProfile
admin.site.register(UserProfile)

8
profile/forms.py Normal file
View File

@ -0,0 +1,8 @@
from django import forms
class SetUserProfileForm(forms.Form):
status = forms.CharField(max_length=140, required=False)
interests = forms.CharField(max_length=256, required=False)
#signature = forms.CharField()

8
profile/models.py Normal file
View File

@ -0,0 +1,8 @@
from django.db import models
from django.contrib.auth.models import User
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
status = models.CharField(max_length=40, blank=True)

View File

@ -0,0 +1,41 @@
{% extends "profile/profile_base.html" %}
{% block left_panel %}
<ul>
<li><a href="{% url profile_setting %}">修改资料</a></li>
<li><a href="{% url avatar_change %}">修改头像</a></li>
<li><a href="{% url avatar_delete %}">删除不用的头像</a></li>
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改密码</a></li>
</ul>
{% endblock %}
{% block right_panel %}
<h3>当前头像</h3>
{% load avatar_tags %}
{% avatar user 90 %}
<h3>基本信息</h3>
<p>当前状态:{{ user.get_profile.status }}</p>
<p>我的兴趣:{{ user.get_profile.interests }}</p>
{% if peer %}
<h3>Ccnet 当前设置</h3>
<p>Ccnet ID: {{ peer.peer_id }}</p>
<p>Ccnet Name: {{ peer.name }}</p>
{% endif %}
{% if groups %}
<h3>加入的组</h3>
<div id="ccnet-groups">
<ul>
{% for group in groups %}
<li>{{ group.name }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,7 @@
{% extends "myhome_base.html" %}
{% block title %}帐号设置{% endblock %}
{% block subnav %}
{% endblock %}

View File

@ -0,0 +1,20 @@
{% extends "profile/profile_base.html" %}
{% block content %}
<form action="" method="post">
<labeld>当前状态:</label><br/>
{{ profile_form.status }}
{% if profile_form.status.errors %}
{{ profile_form.status.errors }}
{% endif %}<br />
<label for="id_message">兴趣:</label><br />
{{ profile_form.interests }}<br />
{% if profile_form.interests.errors %}
{{ profile_form.interests.errors }}
{% endif %}<br />
<input type="submit" value="更新个人资料" />
</form>
{% endblock %}

23
profile/tests.py Normal file
View File

@ -0,0 +1,23 @@
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.failUnlessEqual(1 + 1, 2)
__test__ = {"doctest": """
Another way to test that 1 + 1 is equal to 2.
>>> 1 + 1 == 2
True
"""}

6
profile/urls.py Normal file
View File

@ -0,0 +1,6 @@
from django.conf.urls.defaults import *
urlpatterns = patterns('profile.views',
url(r'^$', 'show_profile'),
url(r'^edit/$', 'set_profile', name="profile_setting"),
)

47
profile/views.py Normal file
View File

@ -0,0 +1,47 @@
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template.loader import get_template
from django.template import Context, RequestContext
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
import datetime
from forms import SetUserProfileForm
from models import UserProfile
@login_required
def show_profile(request):
groups = []
return render_to_response('profile/profile.html',
{ 'groups': groups, },
context_instance=RequestContext(request))
@login_required
def set_profile(request):
if request.method == 'POST':
form = SetUserProfileForm(request.POST)
if form.is_valid():
try:
profile = request.user.get_profile()
except UserProfile.DoesNotExist:
profile = UserProfile(user=request.user)
profile.save() # save the profile first, otherwise
# status.save() would fail.
profile.save()
return HttpResponseRedirect(reverse(show_profile))
else:
try:
profile = request.user.get_profile()
except UserProfile.DoesNotExist:
profile = UserProfile(user=request.user)
profile_form = SetUserProfileForm(profile.__dict__)
return render_to_response('profile/set_profile.html',
{ 'profile_form': profile_form, },
context_instance=RequestContext(request))

2
setenv.sh.template Normal file
View File

@ -0,0 +1,2 @@
export CCNET_CONF_DIR=/home/plt/dev/ccnet/seafile/tests/basic/conf1
export PYTHONPATH=/opt/lib/python2.6/site-packages:thirdpart

View File

@ -62,6 +62,8 @@ TEMPLATE_LOADERS = (
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
)
@ -94,9 +96,32 @@ INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'seahub.basic',
'django.contrib.admin',
'registration',
'avatar',
'seahub.base',
'seahub.profile',
)
AUTHENTICATION_BACKENDS = (
'seahub.base.accounts.EmailOrUsernameModelBackend',
'django.contrib.auth.backends.ModelBackend'
)
ACCOUNT_ACTIVATION_DAYS = 7
#avatar
AVATAR_STORAGE_DIR = 'avatars'
AVATAR_GRAVATAR_BACKUP = False
AVATAR_DEFAULT_URL = MEDIA_URL + '/avatars/default.png'
LOGIN_URL = SITE_ROOT + 'accounts/login'
# profile
AUTH_PROFILE_MODULE = "profile.UserProfile"
try:
import local_settings
except ImportError:

3
templates/accounts.html Normal file
View File

@ -0,0 +1,3 @@
{% extends "myhome_base.html" %}
{% block title %}帐号设置{% endblock %}

View File

@ -0,0 +1,3 @@
{% extends "accounts.html" %}
{% block title %}个人头像{% endblock %}

View File

@ -0,0 +1,31 @@
{% extends "avatar/base.html" %}
{% load avatar_tags %}
{% block content %}
<div class="avatar_op">
<h2>添加或修改头像</h2>
<div class="pic">
<h3>当前头像:</h3>
{% avatar user %}
</div>
<div class="text">
{% if not avatars %}
<p>您还没有自己的头像。</p>
{% else %}
<h3>从已有头像中选择:</h3>
<form method="POST" action="">
<ul>
{{ primary_avatar_form.as_ul }}
</ul>
<div class="clear"></div>
<input type="submit" value="确定" />
</form>
{% endif %}
<h3>上传新头像:</h3>
<form enctype="multipart/form-data" method="POST" action="">
<input type="file" name="avatar" value="Avatar Image" /><br />
<input type="submit" value="提交" />
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends "avatar/base.html" %}
{% block content %}
<div class="avatar_op">
<h2>删除头像</h2>
{% if not avatars %}
<p>您还没有上传自己的头像。现在 <a href="{% url avatar_change %}">上传一个</a>.</p>
{% else %}
<form method="POST" action="">
<ul>
{{ delete_avatar_form.as_ul }}
</ul>
<div class="clear"></div>
<input type="submit" value="删除" />
</form>
{% endif %}
</div>
{% endblock %}

View File

@ -15,8 +15,24 @@
<div id="wrapper">
<div id="header">
<div class="top_operation">
{% if request.user.is_authenticated %}
欢迎, {{ request.user }}.
<a href="{{ SITE_ROOT }}home/my/">我的页面</a>
<a href="{{ SITE_ROOT }}home/">社区</a>
<a href="{{ SITE_ROOT }}profile/">设置</a>
{% if request.user.is_staff %}
<a href="{{ SITE_ROOT }}admin/">管理</a>
{% endif %}
<a href="{{ SITE_ROOT }}accounts/logout/">退出</a>
{% else %}
<a href="{{ SITE_ROOT }}accounts/login/">登录</a>
<a href="{{ SITE_ROOT }}accounts/register/">注册</a>
{% endif %}
</div>
<img id="logo" src="{{ MEDIA_URL }}img/logo.png" title="Seafile" />
<div class="navs">
{% block nav %}
<ul class="nav">
<li>
<a href="{{ SITE_ROOT }}home/">Home</a>
@ -28,6 +44,7 @@
<a href="{{ SITE_ROOT }}groups/">Groups</a>
</li>
</ul>
{% endblock %}
</div>
<div class="nav-separator"></div>
</div>
@ -39,6 +56,7 @@
{% block right_panel %}{% endblock %}
</div>
<div id="main-panel">
{% block content %}{% endblock %}
</div>
<div class="clear"></div>

1
templates/myhome.html Normal file
View File

@ -0,0 +1 @@
{% extends "myhome_base.html" %}

View File

@ -0,0 +1,17 @@
{% extends "base.html" %}
{% block nav %}
<ul class="nav">
<li>
<a href="{{ SITE_ROOT }}home/my/">Home</a>
</li>
<li>
<a href="{{ SITE_ROOT }}files/">Files</a>
</li>
<li>
<a href="{{ SITE_ROOT }}peers/">Peers</a>
</li>
<li>
<a href="{{ SITE_ROOT }}groups/">Groups</a>
</li>
</ul>
{% endblock %}

View File

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Create an account{% endblock %}
{% block content %}
你的帐号已经激活。 <a href="{{ SITE_ROOT }}accounts/login/">登录</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
您好, 感谢注册 {{ site.name }}。
请点击下面的链接激活您的帐号
http://{{ site.name }}{{ SITE_ROOT }}accounts/activate/{{ activation_key }}/

View File

@ -0,0 +1 @@
请激活你的帐号,完成注册

View File

@ -0,0 +1,30 @@
{% extends "base.html" %}
{% block title %}用户登录{% endblock %}
{% block content %}
<h2>用户登录</h2>
<form action="" method="post" class="login">
<label for="username">帐 号:</label>
<input type="text" name="username" value="" id="username"><br />
<label for="password">密 码:</label>
<input type="password" name="password" value="" id="password"><br />
{% if form.errors %}
<p class="error">抱歉,您输入的用户名或密码不正确</p>
{% endif %}
<input type="submit" value="提交" class="lo-reg" />
<a href="{{ SITE_ROOT }}accounts/password/reset/">忘记密码?</a>
{% if next %}
<input type="hidden" name="next" value="{{ next|escape }}" />
{% else %}
<input type="hidden" name="next" value="{{ SITE_ROOT }}" />
{% endif %}
</form>
<script type="text/javascript">
document.getElementById('username').value = '用户名或注册邮箱';
document.getElementById('username').style.color = '#666';
document.getElementById('username').onclick = function() {
document.getElementById('username').value = '';
document.getElementById('username').style.color = '#000';
}
</script>
{% endblock %}

View File

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block title %}退出{% endblock %}
{% block content %}
<p>感谢参与.</p>
<p><a href="{{ SITE_ROOT }}accounts/login/" class="re_login">重新登录</a></p>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "accounts.html" %}
{% load i18n %}<!--
{% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}{% trans 'Change password' %} / <a href="../../logout/">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %}-->
{% block title %}{% trans 'Password change successful' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password change successful' %}</h2>
<p>{% trans 'Your password was changed.' %}</p>
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends "accounts.html" %}
{% load i18n %}
{% block title %}{% trans 'Password change' %}{% endblock %}
{% block content %}
<div class="pwd_change">
<h2>{% trans 'Password change' %}</h2>
<form action="" method="post">
{{ form.old_password.errors }}
<p><label for="id_old_password">当前密码:</label>{{ form.old_password }}</p>
{{ form.new_password1.errors }}
<p><label for="id_new_password1">新密码:</label>{{ form.new_password1 }}</p>
{{ form.new_password2.errors }}
<p><label for="id_new_password2">新密码确认:</label>{{ form.new_password2 }}</p>
<p><input type="submit" value="提交" class="submit" /></p>
</form>
</div>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset complete' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password reset complete' %}</h2>
<p>{% trans "Your password has been set. You may go ahead and log in now." %}</p>
<p><a href="{{ login_url }}">{% trans 'Log in' %}</a></p>
{% endblock %}

View File

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset confirmation' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset' %}{% endblock %}
{% block content %}
{% if validlink %}
<h2>{% trans 'Enter new password' %}</h2>
<p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
<form action="" method="post">
{{ form.new_password1.errors }}
<p class="aligned wide"><label for="id_new_password1">{% trans 'New password:' %}</label>{{ form.new_password1 }}</p>
{{ form.new_password2.errors }}
<p class="aligned wide"><label for="id_new_password2">{% trans 'Confirm password:' %}</label>{{ form.new_password2 }}</p>
<p><input type="submit" value="{% trans 'Change my password' %}" /></p>
</form>
{% else %}
<h1>{% trans 'Password reset unsuccessful' %}</h1>
<p>{% trans "The password reset link was invalid, possibly because it has already been used. Please request a new password reset." %}
{% endif %}
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans 'Password reset successful' %}{% endblock %}
{% block content %}
<h2>{% trans 'Password reset successful' %}</h2>
<p>{% trans "We've e-mailed you instructions for setting your password to the e-mail address you submitted. You should be receiving it shortly." %}</p>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% load i18n %}{% autoescape off %}
{% trans "You're receiving this e-mail because you requested a password reset" %}
{% blocktrans %}for your user account at {{ site_name }}{% endblocktrans %}.
{% trans "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url django.contrib.auth.views.password_reset_confirm uidb36=uid, token=token %}
{% endblock %}
{% trans "Your username, in case you've forgotten:" %} {{ user.username }}
{% trans "Thanks for using our site!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endautoescape %}

View File

@ -0,0 +1,14 @@
{% extends "base.html" %}
{% load i18n %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password reset' %}</div>{% endblock %}
{% block title %}{% trans "Password reset" %}{% endblock %}
{% block content %}
<h2>{% trans "Password reset" %}</h2>
<p>请在下面输入您的 e-mail 地址,我们会把新密码设置说明通过邮件发送给您。</p>
<form action="" method="post">
<label for="id_email">{% trans 'E-mail address:' %}</label> {{ form.email }}
<input type="submit" value="提交" />
{{ form.email.errors }}
</form>
{% endblock %}

View File

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Create an account{% endblock %}
{% block content %}
Closed.
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends "base.html" %}
{% block title %}感谢注册{% endblock %}
{% block content %}
<p>感谢注册,激活邮件已发往您的邮箱,请查收。如果您在收件箱里没找到,请检查下是否被当成垃圾邮件了。</p>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block title %}用户注册{% endblock %}
{% block content %}
<h2>用户注册</h2>
<form action="" method="post" class="reg">
<label for="id_username">用户名:</label>
{{ form.username }}
{% if form.username.errors %}
{{ form.username.errors }}
{% endif %}<br />
<label for="id_email">邮箱:</label>
{{ form.email }}<span>(我们将给您发送帐号激活邮件.)</span>
{% if form.email.errors %}
{{ form.email.errors }}
{% endif %}<br />
<label for="id_password1">密码:</label>
{{ form.password1 }}
{% if form.password1.errors %}
{{ form.password1.errors }}
{% endif %}<br />
<label for="id_password2">确认密码:</label>
{{ form.password2 }}<br />
<input type="submit" value="提交" class="submit" />
</form>
{% endblock %}

View File

@ -0,0 +1,27 @@
import os.path
from django.conf import settings
try:
from PIL import Image
except ImportError:
import Image
AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (80,))
AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS)
AVATAR_STORAGE_DIR = getattr(settings, 'AVATAR_STORAGE_DIR', 'avatars')
AVATAR_GRAVATAR_BACKUP = getattr(settings, 'AVATAR_GRAVATAR_BACKUP', True)
AVATAR_GRAVATAR_DEFAULT = getattr(settings, 'AVATAR_GRAVATAR_DEFAULT', None)
AVATAR_DEFAULT_URL = getattr(settings, 'AVATAR_DEFAULT_URL',
settings.MEDIA_URL + os.path.join(os.path.dirname(__file__), 'default.jpg'))
from django.db.models import signals
from django.contrib.auth.models import User
from avatar.models import Avatar
def create_default_thumbnails(instance=None, created=False, **kwargs):
if created:
for size in AUTO_GENERATE_AVATAR_SIZES:
instance.create_thumbnail(size)
signals.post_save.connect(create_default_thumbnails, sender=Avatar)

View File

@ -0,0 +1,4 @@
from django.contrib import admin
from avatar.models import Avatar
admin.site.register(Avatar)

Binary file not shown.

After

(image error) Size: 3.4 KiB

31
thirdpart/avatar/forms.py Normal file
View File

@ -0,0 +1,31 @@
from django import forms
from django.forms import widgets
from django.utils.safestring import mark_safe
def avatar_img(avatar, size):
if not avatar.thumbnail_exists(size):
avatar.create_thumbnail(size)
return mark_safe("""<img src="%s" alt="%s" width="%s" height="%s" />""" %
(avatar.avatar_url(size), unicode(avatar), size, size))
class PrimaryAvatarForm(forms.Form):
def __init__(self, *args, **kwargs):
user = kwargs.pop('user')
size = kwargs.pop('size', 80)
super(PrimaryAvatarForm, self).__init__(*args, **kwargs)
avatars = user.avatar_set.all()
self.fields['choice'] = forms.ChoiceField(
choices=[(c.id, avatar_img(c, size)) for c in user.avatar_set.all()],
widget=widgets.RadioSelect)
class DeleteAvatarForm(forms.Form):
def __init__(self, *args, **kwargs):
user = kwargs.pop('user')
size = kwargs.pop('size', 80)
super(DeleteAvatarForm, self).__init__(*args, **kwargs)
avatars = user.avatar_set.all()
self.fields['choices'] = forms.MultipleChoiceField(
choices=[(c.id, avatar_img(c, size)) for c in user.avatar_set.all()],
widget=widgets.CheckboxSelectMultiple)

View File

@ -0,0 +1,14 @@
from django.conf import settings
from django.db.models import signals
from django.utils.translation import ugettext_noop as _
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("avatar_updated", _("Avatar Updated"), _("avatar have been updated"))
notification.create_notice_type("avatar_friend_updated", _("Friend Updated Avatar"), _("a friend has updated his avatar"))
signals.post_syncdb.connect(create_notice_types, sender=notification)
else:
print "Skipping creation of NoticeTypes as notification app not found"

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,15 @@
from django.core.management.base import NoArgsCommand
from django.conf import settings
from avatar.models import Avatar
from avatar import AUTO_GENERATE_AVATAR_SIZES
class Command(NoArgsCommand):
help = "Regenerates avatar thumbnails for the sizes specified in " + \
"settings.AUTO_GENERATE_AVATAR_SIZES."
def handle_noargs(self, **options):
for avatar in Avatar.objects.all():
for size in AUTO_GENERATE_AVATAR_SIZES:
print "Rebuilding Avatar id=%s at size %s." % (avatar.id, size)
avatar.create_thumbnail(size)

View File

@ -0,0 +1,79 @@
import datetime
import os.path
from django.db import models
from django.contrib.auth.models import User
from django.core.files.base import ContentFile
from django.utils.translation import ugettext as _
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from PIL import Image
except ImportError:
import Image
from avatar import AVATAR_STORAGE_DIR, AVATAR_RESIZE_METHOD
def avatar_file_path(instance=None, filename=None, user=None):
user = user or instance.user
return os.path.join(AVATAR_STORAGE_DIR, user.username, filename)
class Avatar(models.Model):
user = models.ForeignKey(User)
primary = models.BooleanField(default=False)
avatar = models.ImageField(max_length=1024, upload_to=avatar_file_path, blank=True)
date_uploaded = models.DateTimeField(default=datetime.datetime.now)
def __unicode__(self):
return _(u'Avatar for %s') % self.user
def save(self, force_insert=False, force_update=False):
if self.primary:
avatars = Avatar.objects.filter(user=self.user, primary=True)\
.exclude(id=self.id)
avatars.update(primary=False)
super(Avatar, self).save(force_insert, force_update)
def thumbnail_exists(self, size):
return self.avatar.storage.exists(self.avatar_name(size))
def create_thumbnail(self, size):
try:
orig = self.avatar.storage.open(self.avatar.name, 'rb').read()
image = Image.open(StringIO(orig))
except IOError:
return # What should we do here? Render a "sorry, didn't work" img?
(w, h) = image.size
if w != size or h != size:
if w > h:
diff = (w - h) / 2
image = image.crop((diff, 0, w - diff, h))
else:
diff = (h - w) / 2
image = image.crop((0, diff, w, h - diff))
image = image.resize((size, size), AVATAR_RESIZE_METHOD)
if image.mode != "RGB":
image = image.convert("RGB")
thumb = StringIO()
image.save(thumb, "JPEG", quality=95)
thumb_file = ContentFile(thumb.getvalue())
else:
thumb_file = ContentFile(orig)
thumb = self.avatar.storage.save(self.avatar_name(size), thumb_file)
def avatar_url(self, size):
return self.avatar.storage.url(self.avatar_name(size))
def avatar_name(self, size):
filename = os.path.basename(self.avatar.name)
idx = filename.rfind('.')
if idx != -1:
filename = filename[:idx] + '.jpg'
else:
filename += '.jpg'
return os.path.join(AVATAR_STORAGE_DIR, self.user.username,
'resized', str(size), filename)

View File

@ -0,0 +1,10 @@
{% extends "accounts.html" %}
<html>
<head>
<title>{% block title %}django-avatar{% endblock %}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

View File

@ -0,0 +1,21 @@
{% extends "avatar/base.html" %}
{% load avatar_tags %}
{% block content %}
<p>Your current avatar: </p>
{% avatar user %}
{% if not avatars %}
<p>You do not yet have an avatar. Please upload one now.</p>
{% else %}
<form method="POST" action="">
<ul>
{{ primary_avatar_form.as_ul }}
</ul>
<input type="submit" value="Choose new Default" />
</form>
{% endif %}
<form enctype="multipart/form-data" method="POST" action="">
<input type="file" name="avatar" value="Avatar Image" />
<input type="submit" value="Upload New Image" />
</form>
{% endblock %}

View File

@ -0,0 +1,15 @@
{% extends "avatar/base.html" %}
{% block content %}
<p>Please select the avatars that you would like to delete.</p>
{% if not avatars %}
<p>You have no avatars to delete. Please <a href="{% url avatar_change %}">upload one</a> now.</p>
{% else %}
<form method="POST" action="">
<ul>
{{ delete_avatar_form.as_ul }}
</ul>
<input type="submit" value="Delete These" />
</form>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,4 @@
{% load i18n %}{% blocktrans with user as avatar_creator and avatar.get_absolute_url as avatar_url %}{{ avatar_creator }} has updated his avatar {{ avatar }}.
http://{{ current_site }}{{ avatar_url }}
{% endblocktrans %}

View File

@ -0,0 +1,2 @@
{% load i18n %}{% url profile_detail username=user.username as user_url %}
{% blocktrans with user as avatar_creator and avatar.get_absolute_url as avatar_url %}<a href="{{ user_url }}">{{ avatar_creator }}</a> has updated his avatar <a href="{{ avatar_url }}">{{ avatar }}</a>.{% endblocktrans %}

View File

@ -0,0 +1,4 @@
{% load i18n %}{% blocktrans with avatar.get_absolute_url as avatar_url %}Avatar {{ avatar }} has been created.
http://{{ current_site }}{{ avatar_url }}
{% endblocktrans %}

View File

@ -0,0 +1,2 @@
{% load i18n %}
{% blocktrans with avatar.get_absolute_url as avatar_url %}A new tribe <a href="{{ avatar_url }}">{{ avatar }}</a> has been created.{% endblocktrans %}

View File

@ -0,0 +1,63 @@
import urllib
from django import template
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from django.utils.hashcompat import md5_constructor
from avatar import AVATAR_DEFAULT_URL, AVATAR_GRAVATAR_BACKUP, AVATAR_GRAVATAR_DEFAULT
register = template.Library()
def avatar_url(user, size=80):
if not isinstance(user, User):
try:
user = User.objects.get(username=user)
except User.DoesNotExist:
return AVATAR_DEFAULT_URL
avatars = user.avatar_set.order_by('-date_uploaded')
primary = avatars.filter(primary=True)
if primary.count() > 0:
avatar = primary[0]
elif avatars.count() > 0:
avatar = avatars[0]
else:
avatar = None
if avatar is not None:
if not avatar.thumbnail_exists(size):
avatar.create_thumbnail(size)
return avatar.avatar_url(size)
else:
if AVATAR_GRAVATAR_BACKUP:
params = {'s': str(size)}
if AVATAR_GRAVATAR_DEFAULT:
params['d'] = AVATAR_GRAVATAR_DEFAULT
return "http://www.gravatar.com/avatar/%s/?%s" % (
md5_constructor(user.email).hexdigest(),
urllib.urlencode(params))
else:
return AVATAR_DEFAULT_URL
register.simple_tag(avatar_url)
def avatar(user, size=80):
if not isinstance(user, User):
try:
user = User.objects.get(username=user)
alt = unicode(user)
url = avatar_url(user, size)
except User.DoesNotExist:
url = AVATAR_DEFAULT_URL
alt = _("Default Avatar")
else:
alt = unicode(user)
url = avatar_url(user, size)
return """<img src="%s" alt="%s" width="%s" height="%s" />""" % (url, alt,
size, size)
register.simple_tag(avatar)
def render_avatar(avatar, size=80):
if not avatar.thumbnail_exists(size):
avatar.create_thumbnail(size)
return """<img src="%s" alt="%s" width="%s" height="%s" />""" % (
avatar.avatar_url(size), str(avatar), size, size)
register.simple_tag(render_avatar)

6
thirdpart/avatar/urls.py Normal file
View File

@ -0,0 +1,6 @@
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('avatar.views',
url('^change/$', 'change', name='avatar_change'),
url('^delete/$', 'delete', name='avatar_delete'),
)

129
thirdpart/avatar/views.py Normal file
View File

@ -0,0 +1,129 @@
import os.path
from avatar.models import Avatar, avatar_file_path
from avatar.forms import PrimaryAvatarForm, DeleteAvatarForm
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.utils.translation import ugettext as _
from django.db.models import get_app
from django.core.exceptions import ImproperlyConfigured
from django.conf import settings
try:
notification = get_app('notification')
except ImproperlyConfigured:
notification = None
friends = False
if 'friends' in settings.INSTALLED_APPS:
friends = True
from friends.models import Friendship
def _get_next(request):
"""
The part that's the least straightforward about views in this module is how they
determine their redirects after they have finished computation.
In short, they will try and determine the next place to go in the following order:
1. If there is a variable named ``next`` in the *POST* parameters, the view will
redirect to that variable's value.
2. If there is a variable named ``next`` in the *GET* parameters, the view will
redirect to that variable's value.
3. If Django can determine the previous page from the HTTP headers, the view will
redirect to that previous page.
"""
next = request.POST.get('next', request.GET.get('next', request.META.get('HTTP_REFERER', None)))
if not next:
next = request.path
return next
def change(request, extra_context={}, next_override=None):
avatars = Avatar.objects.filter(user=request.user).order_by('-primary')
if avatars.count() > 0:
avatar = avatars[0]
kwargs = {'initial': {'choice': avatar.id}}
else:
avatar = None
kwargs = {}
primary_avatar_form = PrimaryAvatarForm(request.POST or None, user=request.user, **kwargs)
if request.method == "POST":
updated = False
if 'avatar' in request.FILES:
path = avatar_file_path(user=request.user,
filename=request.FILES['avatar'].name)
avatar = Avatar(
user = request.user,
primary = True,
avatar = path,
)
new_file = avatar.avatar.storage.save(path, request.FILES['avatar'])
avatar.save()
updated = True
request.user.message_set.create(
message=_("Successfully uploaded a new avatar."))
if 'choice' in request.POST and primary_avatar_form.is_valid():
avatar = Avatar.objects.get(id=
primary_avatar_form.cleaned_data['choice'])
avatar.primary = True
avatar.save()
updated = True
request.user.message_set.create(
message=_("Successfully updated your avatar."))
if updated and notification:
notification.send([request.user], "avatar_updated", {"user": request.user, "avatar": avatar})
if friends:
notification.send((x['friend'] for x in Friendship.objects.friends_for_user(request.user)), "avatar_friend_updated", {"user": request.user, "avatar": avatar})
return HttpResponseRedirect(next_override or _get_next(request))
return render_to_response(
'avatar/change.html',
extra_context,
context_instance = RequestContext(
request,
{ 'avatar': avatar,
'avatars': avatars,
'primary_avatar_form': primary_avatar_form,
'next': next_override or _get_next(request), }
)
)
change = login_required(change)
def delete(request, extra_context={}, next_override=None):
avatars = Avatar.objects.filter(user=request.user).order_by('-primary')
if avatars.count() > 0:
avatar = avatars[0]
else:
avatar = None
delete_avatar_form = DeleteAvatarForm(request.POST or None, user=request.user)
if request.method == 'POST':
if delete_avatar_form.is_valid():
ids = delete_avatar_form.cleaned_data['choices']
if unicode(avatar.id) in ids and avatars.count() > len(ids):
for a in avatars:
if unicode(a.id) not in ids:
a.primary = True
a.save()
if notification:
notification.send([request.user], "avatar_updated", {"user": request.user, "avatar": a})
if friends:
notification.send((x['friend'] for x in Friendship.objects.friends_for_user(request.user)), "avatar_friend_updated", {"user": request.user, "avatar": a})
break
Avatar.objects.filter(id__in=ids).delete()
request.user.message_set.create(
message=_("Successfully deleted the requested avatars."))
return HttpResponseRedirect(next_override or _get_next(request))
return render_to_response(
'avatar/confirm_delete.html',
extra_context,
context_instance = RequestContext(
request,
{ 'avatar': avatar,
'avatars': avatars,
'delete_avatar_form': delete_avatar_form,
'next': next_override or _get_next(request), }
)
)
delete = login_required(delete)

View File

@ -0,0 +1,12 @@
VERSION = (0, 8, 0, 'alpha', 1)
def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION[3] != 'final':
version = '%s %s %s' % (version, VERSION[3], VERSION[4])
return version

View File

@ -0,0 +1,46 @@
from django.contrib import admin
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from registration.models import RegistrationProfile
class RegistrationAdmin(admin.ModelAdmin):
actions = ['activate_users', 'resend_activation_email']
list_display = ('user', 'activation_key_expired')
raw_id_fields = ['user']
search_fields = ('user__username', 'user__first_name')
def activate_users(self, request, queryset):
"""
Activates the selected users, if they are not alrady
activated.
"""
for profile in queryset:
RegistrationProfile.objects.activate_user(profile.activation_key)
activate_users.short_description = _("Activate users")
def resend_activation_email(self, request, queryset):
"""
Re-sends activation emails for the selected users.
Note that this will *only* send activation emails for users
who are eligible to activate; emails will not be sent to users
whose activation keys have expired or who have already
activated.
"""
if Site._meta.installed:
site = Site.objects.get_current()
else:
site = RequestSite(request)
for profile in queryset:
if not profile.activation_key_expired():
profile.send_activation_email(site)
resend_activation_email.short_description = _("Re-send activation emails")
admin.site.register(RegistrationProfile, RegistrationAdmin)

View File

@ -0,0 +1,58 @@
"""
URL patterns for the views included in ``django.contrib.auth``.
Including these URLs (via the ``include()`` directive) will set up the
following patterns based at whatever URL prefix they are included
under:
* User login at ``login/``.
* User logout at ``logout/``.
* The two-step password change at ``password/change/`` and
``password/change/done/``.
* The four-step password reset at ``password/reset/``,
``password/reset/confirm/``, ``password/reset/complete/`` and
``password/reset/done/``.
The default registration backend already has an ``include()`` for
these URLs, so under the default setup it is not necessary to manually
include these views. Other backends may or may not include them;
consult a specific backend's documentation for details.
"""
from django.conf.urls.defaults import *
from django.contrib.auth import views as auth_views
urlpatterns = patterns('',
url(r'^login/$',
auth_views.login,
{'template_name': 'registration/login.html'},
name='auth_login'),
url(r'^logout/$',
auth_views.logout,
{'template_name': 'registration/logout.html'},
name='auth_logout'),
url(r'^password/change/$',
auth_views.password_change,
name='auth_password_change'),
url(r'^password/change/done/$',
auth_views.password_change_done,
name='auth_password_change_done'),
url(r'^password/reset/$',
auth_views.password_reset,
name='auth_password_reset'),
url(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
auth_views.password_reset_confirm,
name='auth_password_reset_confirm'),
url(r'^password/reset/complete/$',
auth_views.password_reset_complete,
name='auth_password_reset_complete'),
url(r'^password/reset/done/$',
auth_views.password_reset_done,
name='auth_password_reset_done'),
)

View File

@ -0,0 +1,32 @@
from django.core.exceptions import ImproperlyConfigured
# Python 2.7 has an importlib with import_module; for older Pythons,
# Django's bundled copy provides it.
try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
def get_backend(path):
"""
Return an instance of a registration backend, given the dotted
Python import path (as a string) to the backend class.
If the backend cannot be located (e.g., because no such module
exists, or because the module does not contain a class of the
appropriate name), ``django.core.exceptions.ImproperlyConfigured``
is raised.
"""
i = path.rfind('.')
module, attr = path[:i], path[i+1:]
try:
mod = import_module(module)
except ImportError, e:
raise ImproperlyConfigured('Error loading registration backend %s: "%s"' % (module, e))
try:
backend_class = getattr(mod, attr)
except AttributeError:
raise ImproperlyConfigured('Module "%s" does not define a registration backend named "%s"' % (module, attr))
return backend_class()

View File

@ -0,0 +1,139 @@
from django.conf import settings
from django.contrib.sites.models import RequestSite
from django.contrib.sites.models import Site
from registration import signals
from registration.forms import RegistrationForm
from registration.models import RegistrationProfile
class DefaultBackend(object):
"""
A registration backend which follows a simple workflow:
1. User signs up, inactive account is created.
2. Email is sent to user with activation link.
3. User clicks activation link, account is now active.
Using this backend requires that
* ``registration`` be listed in the ``INSTALLED_APPS`` setting
(since this backend makes use of models defined in this
application).
* The setting ``ACCOUNT_ACTIVATION_DAYS`` be supplied, specifying
(as an integer) the number of days from registration during
which a user may activate their account (after that period
expires, activation will be disallowed).
* The creation of the templates
``registration/activation_email_subject.txt`` and
``registration/activation_email.txt``, which will be used for
the activation email. See the notes for this backends
``register`` method for details regarding these templates.
Additionally, registration can be temporarily closed by adding the
setting ``REGISTRATION_OPEN`` and setting it to
``False``. Omitting this setting, or setting it to ``True``, will
be interpreted as meaning that registration is currently open and
permitted.
Internally, this is accomplished via storing an activation key in
an instance of ``registration.models.RegistrationProfile``. See
that model and its custom manager for full documentation of its
fields and supported operations.
"""
def register(self, request, **kwargs):
"""
Given a username, email address and password, register a new
user account, which will initially be inactive.
Along with the new ``User`` object, a new
``registration.models.RegistrationProfile`` will be created,
tied to that ``User``, containing the activation key which
will be used for this account.
An email will be sent to the supplied email address; this
email should contain an activation link. The email will be
rendered using two templates. See the documentation for
``RegistrationProfile.send_activation_email()`` for
information about these templates and the contexts provided to
them.
After the ``User`` and ``RegistrationProfile`` are created and
the activation email is sent, the signal
``registration.signals.user_registered`` will be sent, with
the new ``User`` as the keyword argument ``user`` and the
class of this backend as the sender.
"""
username, email, password = kwargs['username'], kwargs['email'], kwargs['password1']
if Site._meta.installed:
site = Site.objects.get_current()
else:
site = RequestSite(request)
new_user = RegistrationProfile.objects.create_inactive_user(username, email,
password, site)
signals.user_registered.send(sender=self.__class__,
user=new_user,
request=request)
return new_user
def activate(self, request, activation_key):
"""
Given an an activation key, look up and activate the user
account corresponding to that key (if possible).
After successful activation, the signal
``registration.signals.user_activated`` will be sent, with the
newly activated ``User`` as the keyword argument ``user`` and
the class of this backend as the sender.
"""
activated = RegistrationProfile.objects.activate_user(activation_key)
if activated:
signals.user_activated.send(sender=self.__class__,
user=activated,
request=request)
return activated
def registration_allowed(self, request):
"""
Indicate whether account registration is currently permitted,
based on the value of the setting ``REGISTRATION_OPEN``. This
is determined as follows:
* If ``REGISTRATION_OPEN`` is not specified in settings, or is
set to ``True``, registration is permitted.
* If ``REGISTRATION_OPEN`` is both specified and set to
``False``, registration is not permitted.
"""
return getattr(settings, 'REGISTRATION_OPEN', True)
def get_form_class(self, request):
"""
Return the default form class used for user registration.
"""
return RegistrationForm
def post_registration_redirect(self, request, user):
"""
Return the name of the URL to redirect to after successful
user registration.
"""
return ('registration_complete', (), {})
def post_activation_redirect(self, request, user):
"""
Return the name of the URL to redirect to after successful
account activation.
"""
return ('registration_activation_complete', (), {})

View File

@ -0,0 +1,54 @@
"""
URLconf for registration and activation, using django-registration's
default backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.default.urls')),
This will also automatically set up the views in
``django.contrib.auth`` at sensible default locations.
If you'd like to customize the behavior (e.g., by passing extra
arguments to the various views) or split up the URLs, feel free to set
up your own URL patterns for these views instead.
"""
from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from registration.views import activate
from registration.views import register
urlpatterns = patterns('',
url(r'^activate/complete/$',
direct_to_template,
{ 'template': 'registration/activation_complete.html' },
name='registration_activation_complete'),
# Activation keys get matched by \w+ instead of the more specific
# [a-fA-F0-9]{40} because a bad activation key should still get to the view;
# that way it can return a sensible "invalid key" message instead of a
# confusing 404.
url(r'^activate/(?P<activation_key>\w+)/$',
activate,
{ 'backend': 'registration.backends.default.DefaultBackend' },
name='registration_activate'),
url(r'^register/$',
register,
{ 'backend': 'registration.backends.default.DefaultBackend' },
name='registration_register'),
url(r'^register/complete/$',
direct_to_template,
{ 'template': 'registration/registration_complete.html' },
name='registration_complete'),
url(r'^register/closed/$',
direct_to_template,
{ 'template': 'registration/registration_closed.html' },
name='registration_disallowed'),
(r'', include('registration.auth_urls')),
)

View File

@ -0,0 +1,131 @@
"""
Forms and validation code for user registration.
"""
from django.contrib.auth.models import User
from django import forms
from django.utils.translation import ugettext_lazy as _
# I put this on all required fields, because it's easier to pick up
# on them with CSS or JavaScript if they have a class of "required"
# in the HTML. Your mileage may vary. If/when Django ticket #3515
# lands in trunk, this will no longer be necessary.
attrs_dict = { 'class': 'required' }
class RegistrationForm(forms.Form):
"""
Form for registering a new user account.
Validates that the requested username is not already in use, and
requires the password to be entered twice to catch typos.
Subclasses should feel free to add any additional validation they
need, but should avoid defining a ``save()`` method -- the actual
saving of collected user data is delegated to the active
registration backend.
"""
username = forms.RegexField(regex=r'^\w+$',
max_length=30,
widget=forms.TextInput(attrs=attrs_dict),
label=_("Username"),
error_messages={ 'invalid': _("This value must contain only letters, numbers and underscores.") })
email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict,
maxlength=75)),
label=_("Email address"))
password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
label=_("Password"))
password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict, render_value=False),
label=_("Password (again)"))
def clean_username(self):
"""
Validate that the username is alphanumeric and is not already
in use.
"""
try:
user = User.objects.get(username__iexact=self.cleaned_data['username'])
except User.DoesNotExist:
return self.cleaned_data['username']
raise forms.ValidationError(_("A user with that username already exists."))
def clean_email(self):
try:
user = User.objects.get(email__iexact=self.cleaned_data['email'])
except User.DoesNotExist:
return self.cleaned_data['email']
raise forms.ValidationError(_("A user with this email alread"))
def clean(self):
"""
Verifiy that the values entered into the two password fields
match. Note that an error here will end up in
``non_field_errors()`` because it doesn't apply to a single
field.
"""
if 'password1' in self.cleaned_data and 'password2' in self.cleaned_data:
if self.cleaned_data['password1'] != self.cleaned_data['password2']:
raise forms.ValidationError(_("The two password fields didn't match."))
return self.cleaned_data
class RegistrationFormTermsOfService(RegistrationForm):
"""
Subclass of ``RegistrationForm`` which adds a required checkbox
for agreeing to a site's Terms of Service.
"""
tos = forms.BooleanField(widget=forms.CheckboxInput(attrs=attrs_dict),
label=_(u'I have read and agree to the Terms of Service'),
error_messages={ 'required': _("You must agree to the terms to register") })
class RegistrationFormUniqueEmail(RegistrationForm):
"""
Subclass of ``RegistrationForm`` which enforces uniqueness of
email addresses.
"""
def clean_email(self):
"""
Validate that the supplied email address is unique for the
site.
"""
if User.objects.filter(email__iexact=self.cleaned_data['email']):
raise forms.ValidationError(_("This email address is already in use. Please supply a different email address."))
return self.cleaned_data['email']
class RegistrationFormNoFreeEmail(RegistrationForm):
"""
Subclass of ``RegistrationForm`` which disallows registration with
email addresses from popular free webmail services; moderately
useful for preventing automated spam registrations.
To change the list of banned domains, subclass this form and
override the attribute ``bad_domains``.
"""
bad_domains = ['aim.com', 'aol.com', 'email.com', 'gmail.com',
'googlemail.com', 'hotmail.com', 'hushmail.com',
'msn.com', 'mail.ru', 'mailinator.com', 'live.com',
'yahoo.com']
def clean_email(self):
"""
Check the supplied email address against a list of known free
webmail domains.
"""
email_domain = self.cleaned_data['email'].split('@')[1]
if email_domain in self.bad_domains:
raise forms.ValidationError(_("Registration using free email addresses is prohibited. Please supply a different email address."))
return self.cleaned_data['email']

Binary file not shown.

View File

@ -0,0 +1,81 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "اسم المستخدم"
#: forms.py:41
msgid "email address"
msgstr "عنوان البريد الالكتروني"
#: forms.py:43
msgid "password"
msgstr "كلمة المرور"
#: forms.py:45
msgid "password (again)"
msgstr "تأكيد كلمة المرور"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "يمكن أن يحتوي اسم المستخدم على احرف، ارقام وشرطات سطرية فقط"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "اسم المستخدم مسجل مسبقا. يرجى اختيار اسم اخر."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "يجب ادخال كلمة المرور مطابقة كل مرة"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "أقر بقراءة والموافقة على شروط الخدمة"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "يجب الموافقة على الشروط للتسجيل"
#: forms.py:124
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "عنوان البريد الالكتروني مسجل مسبقا. يرجى تزويد عنوان بريد الكتروني مختلف."
#: forms.py:149
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "يمنع التسجيل باستخدام عناوين بريد الكترونية مجانية. يرجى تزويد عنوان بريد الكتروني مختلف."
#: models.py:188
msgid "user"
msgstr "مستخدم"
#: models.py:189
msgid "activation key"
msgstr "رمز التفعيل"
#: models.py:194
msgid "registration profile"
msgstr "ملف التسجيل الشخصي"
#: models.py:195
msgid "registration profiles"
msgstr "ملفات التسجيل الشخصية"

Binary file not shown.

View File

@ -0,0 +1,78 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2008-03-05 12:37+0200\n"
"Last-Translator: Vladislav <vladislav.mitov@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-Bookmarks: -1,-1,-1,-1,10,-1,-1,-1,-1,-1\n"
#: forms.py:38
msgid "username"
msgstr "Потребителско име "
#: forms.py:41
msgid "email address"
msgstr "Електронна поща"
#: forms.py:43
msgid "password"
msgstr "Парола"
#: forms.py:45
msgid "password (again)"
msgstr "Парола (проверка)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "Потребителските имена могат да съдържат букви, цифри и подчертавки"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Потребителското име е заето. Моля изберето друго."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Грешка при проверка на паролата."
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "Прочел съм и съм съгласен с условията за експлоатация"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Трябва да сте съгласни с условията за да се регистрирате."
#: forms.py:124
msgid "This email address is already in use. Please supply a different email address."
msgstr "Адреса на електронната поща е използван. Моля въведете друг адрес."
#: forms.py:149
msgid "Registration using free email addresses is prohibited. Please supply a different email address."
msgstr "Регистрациите с безплатни адреси е забранен. Моля въведете различен адрес за електронна поща"
#: models.py:188
msgid "user"
msgstr "Потребител"
#: models.py:189
msgid "activation key"
msgstr "Ключ за активация"
#: models.py:194
msgid "registration profile"
msgstr "регистрационен профил"
#: models.py:195
msgid "registration profiles"
msgstr "регистрационни профили"

Binary file not shown.

View File

@ -0,0 +1,92 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Rune Bromer <rb@konstellation.dk>, 2007-2009.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: django-registration 0.8 \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: Rune Bromer <rb@konstellation.dk>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: admin.py:23
msgid "Activate users"
msgstr "Aktiver brugere"
#: admin.py:43
msgid "Re-send activation emails"
msgstr "Gensend aktiveringsemails"
#: forms.py:35
msgid "Username"
msgstr "Brugernavn"
#: forms.py:36
msgid "This value must contain only letters, numbers and underscores."
msgstr "V¾rdien mŒ kun indeholde bogstaver, tal og underscore."
#: forms.py:39
msgid "Email address"
msgstr "E-mailadresse"
#: forms.py:41
msgid "Password"
msgstr "Password"
#: forms.py:43
msgid "Password (again)"
msgstr "Password (gentag)"
#: forms.py:55
msgid "A user with that username already exists."
msgstr "Der findes allerede en bruger med dette brugernavn."
#: forms.py:67
msgid "The two password fields didn't match."
msgstr "De 2 passwordfelter er ikke ens."
#: forms.py:78
msgid "I have read and agree to the Terms of Service"
msgstr "I har l¾st og accepterer betingelserne."
#: forms.py:79
msgid "You must agree to the terms to register"
msgstr "Du skal acceptere betingelserne for at registere"
#: forms.py:95
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
"Denne emailadresse er allerede i brug. Benyt venligst en anden. "
#: forms.py:122
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"Registrering med gratis emailadresser er ikke muligt. V¾lg venligst en "
"anden emailadresse"
#: models.py:165
msgid "user"
msgstr "bruger"
#: models.py:166
msgid "activation key"
msgstr "Aktiveringsn¿gle"
#: models.py:171
msgid "registration profile"
msgstr "Registreringsprofil"
#: models.py:172
msgid "registration profiles"
msgstr "Registreringprofiler"

Binary file not shown.

View File

@ -0,0 +1,93 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Jannis Leidel <jannis@leidel.info>, 2007-2009.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: django-registration 0.8 \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-18 21:32+0200\n"
"PO-Revision-Date: 2007-09-29 16:50+0200\n"
"Last-Translator: Jannis Leidel <jannis@leidel.info>\n"
"Language-Team: Deutsch <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: admin.py:23
msgid "Activate users"
msgstr "Benutzer aktivieren"
#: admin.py:43
msgid "Re-send activation emails"
msgstr "Aktivierungs-E-Mail erneut senden"
#: forms.py:35
msgid "Username"
msgstr "Benutzername"
#: forms.py:36
msgid "This value must contain only letters, numbers and underscores."
msgstr "Dieser Wert darf nur Buchstaben, Ziffern und Unterstriche enthalten."
#: forms.py:39
msgid "Email address"
msgstr "E-Mail-Adresse"
#: forms.py:41
msgid "Password"
msgstr "Passwort"
#: forms.py:43
msgid "Password (again)"
msgstr "Passwort (wiederholen)"
#: forms.py:55
msgid "A user with that username already exists."
msgstr "Dieser Benutzername ist bereits vergeben."
#: forms.py:67
msgid "The two password fields didn't match."
msgstr "Die beiden Passwörter sind nicht identisch."
#: forms.py:78
msgid "I have read and agree to the Terms of Service"
msgstr "Ich habe die Nutzungsvereinbarung gelesen und stimme ihr zu"
#: forms.py:79
msgid "You must agree to the terms to register"
msgstr "Sie müssen der Nutzungsvereinbarung zustimmen, um sich zu registrieren"
#: forms.py:95
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
"Diese E-Mail-Adresse wird schon genutzt. Bitte geben Sie eine andere E-Mail-"
"Adresse an."
#: forms.py:122
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"Die Registrierung mit einer kostenlosen E-Mail-Adresse ist untersagt. Bitte "
"geben Sie eine andere E-Mail-Adresse an."
#: models.py:165
msgid "user"
msgstr "Benutzer"
#: models.py:166
msgid "activation key"
msgstr "Aktivierungsschlüssel"
#: models.py:171
msgid "registration profile"
msgstr "Registrierungsprofil"
#: models.py:172
msgid "registration profiles"
msgstr "Registrierungsprofile"

Binary file not shown.

View File

@ -0,0 +1,84 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Panos Laganakos <panos.laganakos@gmail.com>, 2007.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2007-11-14 21:50+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "όνομα χρήστη"
#: forms.py:41
msgid "email address"
msgstr "διεύθυνση ηλεκτρονικού ταχυδρομείου"
#: forms.py:43
msgid "password"
msgstr "συνθηματικό"
#: forms.py:45
msgid "password (again)"
msgstr "συνθηματικό (ξανά)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "Τα ονόματα χρηστών μπορούν να περιλαμβάνουν μόνο γράμματα, αριθμούς και υπογραμμίσεις"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Αυτό το όνομα χρήστη χρησιμοποίειται ήδη. Παρακαλώ διαλέξτε ένα άλλο."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Πρέπει να εισάγετε το ίδιο συνθηματικό κάθε φορά"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "Διάβασα και συμφωνώ με τους Όρους της Υπηρεσίας"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Πρέπει να συμφωνείται με τους όρους για να εγγραφείτε"
#: forms.py:124
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
"Η συγκεκριμένη διεύθυνση ηλεκτρονικού ταχυδρομείου χρησιμοποιείται ήδη. "
"Παρακαλώ δώστε κάποια άλλη."
#: forms.py:149
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"Η εγγραφή μέσω δωρεάν διευθύνσεων ηλεκτρονικού ταχυδρομείου απαγορεύεται. ""Παρακαλώ δώστε κάποια άλλη."
#: models.py:188
msgid "user"
msgstr "χρήστης"
#: models.py:189
msgid "activation key"
msgstr "κλειδί ενεργοποίησης"
#: models.py:194
msgid "registration profile"
msgstr "προφίλ εγγραφής"
#: models.py:195
msgid "registration profiles"
msgstr "προφίλ εγγραφών"

Binary file not shown.

View File

@ -0,0 +1,89 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-12 14:09-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: admin.py:23
msgid "Activate users"
msgstr ""
#: admin.py:43
msgid "Re-send activation emails"
msgstr ""
#: forms.py:35
msgid "username"
msgstr ""
#: forms.py:36
msgid "This value must contain only letters, numbers and underscores."
msgstr ""
#: forms.py:39
msgid "Email address"
msgstr ""
#: forms.py:41
msgid "Password"
msgstr ""
#: forms.py:43
msgid "Password (again)"
msgstr ""
#: forms.py:55
msgid "A user with that username already exists."
msgstr ""
#: forms.py:67
msgid "The two password fields didn't match."
msgstr ""
#: forms.py:78
msgid "I have read and agree to the Terms of Service"
msgstr ""
#: forms.py:79
msgid "You must agree to the terms to register"
msgstr ""
#: forms.py:95
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
#: forms.py:122
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
#: models.py:165
msgid "user"
msgstr ""
#: models.py:166
msgid "activation key"
msgstr ""
#: models.py:171
msgid "registration profile"
msgstr ""
#: models.py:172
msgid "registration profiles"
msgstr ""

Binary file not shown.

View File

@ -0,0 +1,85 @@
# Spanish translation for django-registration.
# Copyright (C) 2007, James Bennet
# This file is distributed under the same license as the registration package.
# Ernesto Rico Schmidt <e.rico.schmidt@gmail.com>, 2008.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: django-registration 0.3 \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-03-11 00:19-0400\n"
"PO-Revision-Date: 2008-03-11 00:19-0400\n"
"Last-Translator: Ernesto Rico Schmidt <e.rico.schmidt@gmail.com>\n"
"Language-Team: Español <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "nombre de usuario"
#: forms.py:41
msgid "email address"
msgstr "dirección de coreo electrónico"
#: forms.py:43
msgid "password"
msgstr "contraseña"
#: forms.py:45
msgid "password (again)"
msgstr "contraseña (otra vez)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "Los nombres de usuarios sólo pueden contener letras, números y guiones bajos"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Este nombre de usuario ya está ocupado. Por favor escoge otro"
#: forms.py:71
msgid "You must type the same password each time"
msgstr "Tienes que introducir la misma contraseña cada vez"
#: forms.py:100
msgid "I have read and agree to the Terms of Service"
msgstr "He leído y acepto los términos de servicio"
#: forms.py:109
msgid "You must agree to the terms to register"
msgstr "Tienes que aceptar los términos para registrarte"
#: forms.py:128
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
"La dirección de correo electrónico ya está siendo usada. Por favor"
"proporciona otra dirección."
#: forms.py:153
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"El registro usando una dirección de correo electrónico gratis está prohibido."
"Por favor proporciona otra dirección."
#: models.py:188
msgid "user"
msgstr "usuario"
#: models.py:189
msgid "activation key"
msgstr "clave de activación"
#: models.py:194
msgid "registration profile"
msgstr "perfil de registro"
#: models.py:195
msgid "registration profiles"
msgstr "perfiles de registro"

View File

@ -0,0 +1,83 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2008 Leonardo Manuel Rocha
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <l e o m a r o at g m a i l dot c o m>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "nombre de usuario"
#: forms.py:41
msgid "email address"
msgstr "dirección de e-mail"
#: forms.py:43
msgid "password"
msgstr "contraseña"
#: forms.py:45
msgid "password (again)"
msgstr "contraseña (nuevamente)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "El nombre de usuario solo puede contener letras, números y guiones bajos"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Ese nombre de usuario ya está asignado. Por favor elija otro."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Debe tipear la misma contraseña cada vez"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "He leído y estoy de acuerdo con las Condiciones de Servicio"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Debe estar de acuerdo con las Condiciones para poder registrarse"
#: forms.py:124
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "Esa dirección de e-mail ya está en uso. Por favor provea otra "
"dirección."
#: forms.py:149
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "La registración con un e-mail gratuito está prohibida. Por favor "
"de una dirección de e-mail diferente."
#: models.py:188
msgid "user"
msgstr "usuario"
#: models.py:189
msgid "activation key"
msgstr "clave de activación"
#: models.py:194
msgid "registration profile"
msgstr "perfil de registro"
#: models.py:195
msgid "registration profiles"
msgstr "perfiles de registro"

Binary file not shown.

View File

@ -0,0 +1,81 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Samuel Adam <samuel.adam@gmail.com>, 2007.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: django-registration 0.3 \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2007-09-20 10:30+0100\n"
"Last-Translator: Samuel Adam <samuel.adam@gmail.com>\n"
"Language-Team: Français <fr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "pseudo"
#: forms.py:41
msgid "email address"
msgstr "adresse email"
#: forms.py:43
msgid "password"
msgstr "mot de passe"
#: forms.py:45
msgid "password (again)"
msgstr "mot de passe (vérification)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "Le pseudo ne peut contenir que des lettres, chiffres et le caractère souligné."
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Ce pseudo est déjà utilisé. Veuillez en choisir un autre."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Veuillez indiquer le même mot de passe dans les deux champs"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "J'ai lu et accepté les Conditions Générales d'Utilisation"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Vous devez accepter les conditions d'utilisation pour vous inscrire"
#: forms.py:124
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "Cette adresse email est déjà utilisée. Veuillez en indiquer une autre."
#: forms.py:149
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "L'inscription avec une adresse email d'un compte gratuit est interdite. Veuillez en indiquer une autre."
#: models.py:188
msgid "user"
msgstr "utilisateur"
#: models.py:189
msgid "activation key"
msgstr "clé d'activation"
#: models.py:194
msgid "registration profile"
msgstr "profil d'inscription"
#: models.py:195
msgid "registration profiles"
msgstr "profils d'inscription"

Binary file not shown.

View File

@ -0,0 +1,86 @@
# translation of registration.
# Copyright (C) 2008 THE registration'S COPYRIGHT HOLDER
# This file is distributed under the same license as the registration package.
# <>, 2008.
# , fuzzy
# <>, 2008.
#
#
msgid ""
msgstr ""
"Project-Id-Version: registration\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-02-10 02:01+0200\n"
"PO-Revision-Date: 2008-02-10 02:05+0200\n"
"Last-Translator: Meir Kriheli <meir@mksoft.co.il>\n"
"Language-Team: Hebrew\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit"
#: forms.py:38
msgid "username"
msgstr "שם משתמש"
#: forms.py:41
msgid "email address"
msgstr "דואר אלקטרוני"
#: forms.py:43
msgid "password"
msgstr "סיסמה"
#: forms.py:45
msgid "password (again)"
msgstr "סיסמה (שוב)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "שמות משתמש יכולים להכיל רק אותיות, ספרות וקווים תחתונים"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "שם המשתמש תפוס כבר. נא לבחור אחר."
#: forms.py:64
msgid "You must type the same password each time"
msgstr "יש להקליד את אותה הסיסמה פעמיים"
#: forms.py:93
msgid "I have read and agree to the Terms of Service"
msgstr "קראתי והסכמתי לתנאי השימוש"
#: forms.py:102
msgid "You must agree to the terms to register"
msgstr "עליך להסכים לתנאי השימוש"
#: forms.py:121
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr ""
"כתובת הדואר האלקטרוני תפוסה כבר. נא לספק כתובת דואר אחרת."
#: forms.py:146
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"הרישום בעזרת תיבת דואר אלקטרוני חינמית אסור. נא לספק כתובת אחרת."
#: models.py:188
msgid "user"
msgstr "משתמש"
#: models.py:189
msgid "activation key"
msgstr "מפתח הפעלה"
#: models.py:194
msgid "registration profile"
msgstr "פרופיל רישום"
#: models.py:195
msgid "registration profiles"
msgstr "פרופילי רישום"

Binary file not shown.

View File

@ -0,0 +1,74 @@
# Icelandic translation of django-registration
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the django-registration
# package.
# Björn Kristinsson <bjornkri@gmail.com>, 2009.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-01-22 12:49+0100\n"
"PO-Revision-Date: 2009-01-22 12:49+0100\n"
"Last-Translator: Björn Kristinsson <bjornkri@gmail.com>\n"
"Language-Team: Icelandic\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:36
msgid "username"
msgstr "notandanafn"
#: forms.py:39
msgid "email address"
msgstr "netfang"
#: forms.py:41
msgid "password"
msgstr "lykilorð"
#: forms.py:43
msgid "password (again)"
msgstr "lykilorð (aftur)"
#: forms.py:55
msgid "This username is already taken. Please choose another."
msgstr "Þetta notendanafn er þegar á skrá. Vinsamlega reyndu annað."
#: forms.py:67
msgid "You must type the same password each time"
msgstr "Lykilorðin verða að vera eins "
#: forms.py:90
msgid "I have read and agree to the Terms of Service"
msgstr "Ég hef lesið og samþykki skilmálana"
#: forms.py:107
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "Þetta netfang er þegar á skrá. Vinsamlegast notaðu annað netfang."
#: forms.py:133
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "Óheimilt er að nota ókeypis netföng. Vinsamlegast notaðu annað netfang."
#: models.py:218
msgid "user"
msgstr "notandi"
#: models.py:219
msgid "activation key"
msgstr "einkennislykill"
#: models.py:224
msgid "registration profile"
msgstr "skráningarprófíll"
#: models.py:225
msgid "registration profiles"
msgstr "skráningarprófílar"

Binary file not shown.

View File

@ -0,0 +1,82 @@
# translation of django.po to Italiano
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Nicola Larosa <nico@tekNico.net>, 2008.
msgid ""
msgstr ""
"Project-Id-Version: django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2008-05-27 15:05+0200\n"
"Last-Translator: Nicola Larosa <nico@tekNico.net>\n"
"Language-Team: Italiano\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forms.py:38
msgid "username"
msgstr "nome utente"
#: forms.py:41
msgid "email address"
msgstr "indirizzo email"
#: forms.py:43
msgid "password"
msgstr "password"
#: forms.py:45
msgid "password (again)"
msgstr "password (di nuovo)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "I nomi utente possono contenere solo lettere, numeri e sottolineature"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Questo nome utente è già usato. Scegline un altro."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Bisogna inserire la stessa password ogni volta"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "Dichiaro di aver letto e di approvare le Condizioni di Servizio"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Per registrarsi bisogna approvare le condizioni"
#: forms.py:124
msgid "This email address is already in use. Please supply a different email "
"address."
msgstr "Questo indirizzo email è già in uso. Inserisci un altro indirizzo email."
#: forms.py:149
msgid "Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "La registrazione con indirizzi email gratis non è permessa. "
"Inserisci un altro indirizzo email."
#: models.py:188
msgid "user"
msgstr "utente"
#: models.py:189
msgid "activation key"
msgstr "chiave di attivazione"
#: models.py:194
msgid "registration profile"
msgstr "profilo di registrazione"
#: models.py:195
msgid "registration profiles"
msgstr "profili di registrazione"

Binary file not shown.

View File

@ -0,0 +1,78 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Shinya Okano <xxshss@yahoo.co.jp>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: django-registration 0.4 \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2008-01-31 10:20+0900\n"
"Last-Translator: Shinya Okano <xxshss@yahoo.co.jp>\n"
"Language-Team: Japanese <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "ユーザ名"
#: forms.py:41
msgid "email address"
msgstr "メールアドレス"
#: forms.py:43
msgid "password"
msgstr "パスワード"
#: forms.py:45
msgid "password (again)"
msgstr "パスワード (確認)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "ユーザ名には半角英数とアンダースコアのみが使用できます。"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "このユーザ名は既に使用されています。他のユーザ名を指定してください。"
#: forms.py:68
msgid "You must type the same password each time"
msgstr "同じパスワードを入力する必要があります。"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "サービス利用規約を読み、同意します。"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "登録するためには規約に同意する必要があります。"
#: forms.py:124
msgid "This email address is already in use. Please supply a different email address."
msgstr "このメールアドレスは既に使用されています。他のメールアドレスを指定して下さい。"
#: forms.py:149
msgid "Registration using free email addresses is prohibited. Please supply a different email address."
msgstr "自由なメールアドレスを使用した登録は禁止されています。他のメールアドレスを指定してください。"
#: models.py:188
msgid "user"
msgstr "ユーザ"
#: models.py:189
msgid "activation key"
msgstr "アクティベーションキー"
#: models.py:194
msgid "registration profile"
msgstr "登録プロファイル"
#: models.py:195
msgid "registration profiles"
msgstr "登録プロファイル"

Binary file not shown.

View File

@ -0,0 +1,89 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Young Gyu Park <ygpark2@gmail.com>, 2009.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-10-12 14:09-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Young Gyu Park <ygpark2@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: admin.py:23
msgid "Activate users"
msgstr "활동 사용자"
#: admin.py:43
msgid "Re-send activation emails"
msgstr "이 메일 제 전송"
#: forms.py:35
msgid "username"
msgstr "사용자 아이디"
#: forms.py:36
msgid "This value must contain only letters, numbers and underscores."
msgstr "이 곳에는 숫자, _, 영문 글자만 가능합니다."
#: forms.py:39
msgid "Email address"
msgstr "이메일 주소"
#: forms.py:41
msgid "Password"
msgstr "사용자 패스워드"
#: forms.py:43
msgid "Password (again)"
msgstr "패스워드 (재입력)"
#: forms.py:55
msgid "A user with that username already exists."
msgstr "이미 같은 아이디로 사용자가 등록되어 있습니다."
#: forms.py:67
msgid "The two password fields didn't match."
msgstr "패스워드가 서로 일치하지 않습니다."
#: forms.py:78
msgid "I have read and agree to the Terms of Service"
msgstr "약관을 읽었고 그 내용에 동의합니다."
#: forms.py:79
msgid "You must agree to the terms to register"
msgstr "약관에 동의 하셔야만 합니다."
#: forms.py:95
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "이메일이 이미 사용중입니다. 다른 이메일을 등록해 주세요."
#: forms.py:122
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr "무료 이메일 계정으로 등록하실 수 없습니다. 다른 이메일을 등록해 주세요"
#: models.py:165
msgid "user"
msgstr "사용자"
#: models.py:166
msgid "activation key"
msgstr "활성화 키"
#: models.py:171
msgid "registration profile"
msgstr "등록 프로파일"
#: models.py:172
msgid "registration profiles"
msgstr "등록 프로파일"

Binary file not shown.

View File

@ -0,0 +1,77 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: registration\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-08-14 13:25+0200\n"
"PO-Revision-Date: 2008-08-14 13:25+0200\n"
"Last-Translator: Joost Cassee <joost@cassee.net>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: forms.py:38
msgid "username"
msgstr "gebruikersnaam"
#: forms.py:41
msgid "email address"
msgstr "e-mail adres"
#: forms.py:43
msgid "password"
msgstr "wachtwoord"
#: forms.py:45
msgid "password (again)"
msgstr "wachtwoord (opnieuw)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr "Gebruikersnamen kunnen alleen letters, nummer en liggende streepjes bevatten."
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Deze gebruikersnaam is reeds in gebruik. Kiest u alstublieft een andere gebruikersnaam."
#: forms.py:71
msgid "You must type the same password each time"
msgstr "U moet twee maal hetzelfde wachtwoord typen."
#: forms.py:100
msgid "I have read and agree to the Terms of Service"
msgstr "Ik heb de servicevoorwaarden gelezen en ga akkoord."
#: forms.py:109
msgid "You must agree to the terms to register"
msgstr "U moet akkoord gaan met de servicevoorwaarden om u te registreren."
#: forms.py:125
msgid "This email address is already in use. Please supply a different email address."
msgstr "Dit e-mail adres is reeds in gebruik. Kiest u alstublieft een ander e-mail adres."
#: forms.py:151
msgid "Registration using free email addresses is prohibited. Please supply a different email address."
msgstr "U kunt u niet registreren met een gratis e-mail adres. Kiest u alstublieft een ander e-mail adres."
#: models.py:191
msgid "user"
msgstr "gebruiker"
#: models.py:192
msgid "activation key"
msgstr "activatiecode"
#: models.py:197
msgid "registration profile"
msgstr "registratieprofiel"
#: models.py:198
msgid "registration profiles"
msgstr "registratieprofielen"

Binary file not shown.

View File

@ -0,0 +1,84 @@
# Polish translation for django-registration.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the django-registration package.
# Jarek Zgoda <jarek.zgoda@gmail.com>, 2007.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 0.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-19 19:30-0500\n"
"PO-Revision-Date: 2007-12-15 12:45+0100\n"
"Last-Translator: Jarek Zgoda <jarek.zgoda@gmail.com>\n"
"Language-Team: Polish <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: forms.py:38
msgid "username"
msgstr "nazwa użytkownika"
#: forms.py:41
msgid "email address"
msgstr "adres email"
#: forms.py:43
msgid "password"
msgstr "hasło"
#: forms.py:45
msgid "password (again)"
msgstr "hasło (ponownie)"
#: forms.py:54
msgid "Usernames can only contain letters, numbers and underscores"
msgstr ""
"Nazwa użytkownika może zawierać tylko litery, cyfry i znaki podkreślenia"
#: forms.py:59
msgid "This username is already taken. Please choose another."
msgstr "Ta nazwa użytkownika jest już zajęta. Wybierz inną."
#: forms.py:68
msgid "You must type the same password each time"
msgstr "Musisz wpisać to samo hasło w obu polach"
#: forms.py:96
msgid "I have read and agree to the Terms of Service"
msgstr "Przeczytałem regulamin i akceptuję go"
#: forms.py:105
msgid "You must agree to the terms to register"
msgstr "Musisz zaakceptować regulamin, aby się zarejestrować"
#: forms.py:124
msgid ""
"This email address is already in use. Please supply a different email "
"address."
msgstr "Ten adres email jest już używany. Użyj innego adresu email."
#: forms.py:149
msgid ""
"Registration using free email addresses is prohibited. Please supply a "
"different email address."
msgstr ""
"Nie ma możliwości rejestracji przy użyciu darmowego adresu email. Użyj "
"innego adresu email."
#: models.py:188
msgid "user"
msgstr "użytkownik"
#: models.py:189
msgid "activation key"
msgstr "klucz aktywacyjny"
#: models.py:194
msgid "registration profile"
msgstr "profil rejestracji"
#: models.py:195
msgid "registration profiles"
msgstr "profile rejestracji"

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