Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit e01d8f30c604bae1f499e4cb4d7a4c6b4c69d94c @pennersr committed Oct 13, 2010
Showing with 3,143 additions and 0 deletions.
  1. +3 −0 AUTHORS
  2. +22 −0 LICENSE
  3. +4 −0 MANIFEST.in
  4. +2 −0 README.rst
  5. 0 allauth/__init__.py
  6. 0 allauth/account/__init__.py
  7. +8 −0 allauth/account/admin.py
  8. +6 −0 allauth/account/app_settings.py
  9. +36 −0 allauth/account/auth_backends.py
  10. +6 −0 allauth/account/context_processors.py
  11. +420 −0 allauth/account/forms.py
  12. +37 −0 allauth/account/models.py
  13. +4 −0 allauth/account/signals.py
  14. +1 −0 allauth/account/templatetags/__init__.py
  15. +52 −0 allauth/account/templatetags/account_tags.py
  16. +31 −0 allauth/account/urls.py
  17. +56 −0 allauth/account/utils.py
  18. +386 −0 allauth/account/views.py
  19. +9 −0 allauth/app_settings.py
  20. 0 allauth/facebook/__init__.py
  21. +10 −0 allauth/facebook/admin.py
  22. +5 −0 allauth/facebook/forms.py
  23. +3 −0 allauth/facebook/login.py
  24. +109 −0 allauth/facebook/migrations/0001_initial.py
  25. 0 allauth/facebook/migrations/__init__.py
  26. +41 −0 allauth/facebook/models.py
  27. +21 −0 allauth/facebook/templates/facebook/fbconnect.html
  28. 0 allauth/facebook/templatetags/__init__.py
  29. +11 −0 allauth/facebook/templatetags/facebook_tags.py
  30. +7 −0 allauth/facebook/urls.py
  31. +42 −0 allauth/facebook/views.py
  32. 0 allauth/openid/__init__.py
  33. +9 −0 allauth/openid/admin.py
  34. +7 −0 allauth/openid/forms.py
  35. +122 −0 allauth/openid/migrations/0001_initial.py
  36. 0 allauth/openid/migrations/__init__.py
  37. +42 −0 allauth/openid/models.py
  38. +8 −0 allauth/openid/urls.py
  39. +76 −0 allauth/openid/utils.py
  40. +61 −0 allauth/openid/views.py
  41. 0 allauth/socialaccount/__init__.py
  42. +5 −0 allauth/socialaccount/app_settings.py
  43. +21 −0 allauth/socialaccount/auth.py
  44. +8 −0 allauth/socialaccount/defs.py
  45. +64 −0 allauth/socialaccount/forms.py
  46. +84 −0 allauth/socialaccount/helpers.py
  47. +73 −0 allauth/socialaccount/migrations/0001_initial.py
  48. 0 allauth/socialaccount/migrations/__init__.py
  49. +35 −0 allauth/socialaccount/models.py
  50. +188 −0 allauth/socialaccount/oauth.py
  51. +9 −0 allauth/socialaccount/urls.py
  52. +36 −0 allauth/socialaccount/views.py
  53. +27 −0 allauth/templates/account/base.html
  54. +76 −0 allauth/templates/account/email.html
  55. +22 −0 allauth/templates/account/language_change.html
  56. +40 −0 allauth/templates/account/login.html
  57. +11 −0 allauth/templates/account/logout.html
  58. +19 −0 allauth/templates/account/password_change.html
  59. +14 −0 allauth/templates/account/password_delete.html
  60. +10 −0 allauth/templates/account/password_delete_done.html
  61. +35 −0 allauth/templates/account/password_reset.html
  62. +16 −0 allauth/templates/account/password_reset_done.html
  63. +28 −0 allauth/templates/account/password_reset_from_key.html
  64. +7 −0 allauth/templates/account/password_reset_key_message.txt
  65. +16 −0 allauth/templates/account/password_reset_message.txt
  66. +20 −0 allauth/templates/account/password_set.html
  67. +32 −0 allauth/templates/account/signup.html
  68. +5 −0 allauth/templates/account/snippets/already_logged_in.html
  69. +22 −0 allauth/templates/account/timezone_change.html
  70. +12 −0 allauth/templates/account/verification_sent.html
  71. +15 −0 allauth/templates/emailconfirmation/confirm_email.html
  72. +1 −0 allauth/templates/openid/base.html
  73. +24 −0 allauth/templates/openid/login.html
  74. +11 −0 allauth/templates/socialaccount/account_inactive.html
  75. +11 −0 allauth/templates/socialaccount/authentication_error.html
  76. +2 −0 allauth/templates/socialaccount/base.html
  77. +56 −0 allauth/templates/socialaccount/connections.html
  78. +38 −0 allauth/templates/socialaccount/login.html
  79. +4 −0 allauth/templates/socialaccount/snippets/login_extra.html
  80. +9 −0 allauth/templates/socialaccount/snippets/provider_list.html
  81. 0 allauth/twitter/__init__.py
  82. +10 −0 allauth/twitter/admin.py
  83. +113 −0 allauth/twitter/migrations/0001_initial.py
  84. 0 allauth/twitter/migrations/__init__.py
  85. +40 −0 allauth/twitter/models.py
  86. +23 −0 allauth/twitter/tests.py
  87. +9 −0 allauth/twitter/urls.py
  88. +13 −0 allauth/twitter/utils.py
  89. +86 −0 allauth/twitter/views.py
  90. +16 −0 allauth/urls.py
  91. +35 −0 allauth/utils.py
  92. +4 −0 requirements.txt
  93. +31 −0 setup.py
@@ -0,0 +1,3 @@
+django-allauth was started by Raymond Penners in October 2010,
+inspired by and partly based on existing projects such as Pinax
+(account app), Django-Socialauth, django-socialregistration.
@@ -0,0 +1,22 @@
+Copyright (c) 2010 Raymond Penners and contributors
+
+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.
@@ -0,0 +1,4 @@
+include AUTHORS
+include LICENSE
+include README.rst
+recursive-include allauth/templates *.html
@@ -0,0 +1,2 @@
+TBD
+
No changes.
No changes.
@@ -0,0 +1,8 @@
+from django.contrib import admin
+
+# from models import PasswordReset
+#
+# class PasswordResetAdmin(admin.ModelAdmin):
+# list_display = ["user", "temp_key", "timestamp", "reset"]
+#
+# admin.site.register(PasswordReset, PasswordResetAdmin)
@@ -0,0 +1,6 @@
+from django.conf import settings
+
+EMAIL_REQUIRED = getattr(settings, "ACCOUNT_EMAIL_REQUIRED", False)
+EMAIL_VERIFICATION = getattr(settings, "ACCOUNT_EMAIL_VERIFICATION", False)
+EMAIL_AUTHENTICATION = getattr(settings, "ACCOUNT_EMAIL_AUTHENTICATION", False)
+UNIQUE_EMAIL = getattr(settings, "ACCOUNT_UNIQUE_EMAIL", False)
@@ -0,0 +1,36 @@
+from django.conf import settings
+
+from django.contrib.auth.backends import ModelBackend
+from django.contrib.auth.models import User
+
+
+class AuthenticationBackend(ModelBackend):
+
+ def authenticate(self, **credentials):
+ lookup_params = {}
+ if settings.ACCOUNT_EMAIL_AUTHENTICATION:
+ lookup_params["email"] = credentials["email"]
+ else:
+ lookup_params["username"] = credentials["username"]
+ try:
+ user = User.objects.get(**lookup_params)
+ except User.DoesNotExist:
+ return None
+ else:
+ if user.check_password(credentials["password"]):
+ return user
+
+ def has_perm(self, user, perm):
+ # @@@ allow all users to add wiki pages
+ wakawaka_perms = [
+ "wakawaka.add_wikipage",
+ "wakawaka.add_revision",
+ "wakawaka.change_wikipage",
+ "wakawaka.change_revision"
+ ]
+ if perm in wakawaka_perms:
+ return True
+ return super(AuthenticationBackend, self).has_perm(user, perm)
+
+
+EmailModelBackend = AuthenticationBackend
@@ -0,0 +1,6 @@
+from django.conf import settings
+
+def account(request):
+ return {
+ "CONTACT_EMAIL": getattr(settings, "CONTACT_EMAIL", "support@example.com")
+ }
Oops, something went wrong.

0 comments on commit e01d8f3

Please sign in to comment.