User registration

This commit is contained in:
Subhodip Biswas 2012-08-19 19:13:23 +05:30
parent 6c5da14dc4
commit f60dee1ee3
4 changed files with 53 additions and 19 deletions

View File

@ -134,30 +134,58 @@ INSTALLED_APPS = (
#'socialregistration.contrib.facebook',
'emailconfirmation',
# 'uni_form',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.twitter',
'allauth.socialaccount.providers.openid',
'allauth.socialaccount.providers.facebook',
# 'allauth',
# 'allauth.account',
# 'allauth.socialaccount',
# 'allauth.socialaccount.providers.twitter',
# 'allauth.socialaccount.providers.openid',
# 'allauth.socialaccount.providers.facebook',
#'allauth.socialaccount.providers.google',
'users',
'profiles',
'userena',
'guardian',
'easy_thumbnails',
'south',
'django_extensions',
'userena.contrib.umessages',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
'django.contrib.auth.context_processors.auth',
"allauth.context_processors.allauth",
"allauth.account.context_processors.account"
#"allauth.context_processors.allauth",
#"allauth.account.context_processors.account",
"django.contrib.messages.context_processors.messages"
)
AUTHENTICATION_BACKENDS = (
"allauth.account.auth_backends.AuthenticationBackend",
# "allauth.account.auth_backends.AuthenticationBackend",
"userena.backends.UserenaAuthenticationBackend",
"guardian.backends.ObjectPermissionBackend",
"django.contrib.auth.backends.ModelBackend",
)
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST ='smtp.gmail.com'
EMAIL_HOST_USER = 'subhodipbiswas@gmail.com'
EMAIL_HOST_PASSWORD ='doaxhentai'
EMAIL_HOST_USER = 'abc@abc.com'
EMAIL_HOST_PASSWORD ='somepassword'
EMAIL_PORT =587
EMAIL_USE_TLS =True
SERVER_EMAIL = EMAIL_HOST_USER
DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
DEFAULT_FROM_EMAIL=EMAIL_HOST_USER
AUTH_PROFILE_MODULE = "users.UserProfile"
#AUTH_PROFILE_MODULE = 'profiles.Profile'
LOGIN_REDIRECT_URL ='/accounts/%(username)s/'
LOGIN_URL = '/accounts/signin/'
LOGOUT_URL = '/accounts/signout/'
#LOGIN_REDIRECT_URL = '/profiles/profile/'
USERENA_DISABLE_PROFILE_LIST = False
USERENA_MUGSHOT_SIZE = 140
USERENA_MUGSHOT_GRAVATAR=True
USERENA_MUGSHOT_DEFAULT='monsterid'
ANONYMOUS_USER_ID = -1
try:
from local_settings import *
except:

View File

@ -42,10 +42,10 @@ body,html {
{% block body %}
<ul>
{% if user.is_authenticated %}
<li><a href="{% url account_logout %}">Sign Out</a></li>
<li><a href="{% url userena_signout %}">Sign Out</a></li>
{% else %}
<li><a href="{% url account_login %}">Sign In</a></li>
<li><a href="{% url account_signup %}">Sign Up</a></li>
<li><a href="{% url userena_signin %}">Sign In</a></li>
<li><a href="{% url userena_signup %}">Sign Up</a></li>
{% endif %}
</ul>
{% block content %}

View File

@ -11,10 +11,10 @@
{% block body %}
<ul>
{% if user.is_authenticated %}
<li><a href="{% url account_logout %}">Sign Out</a></li>
<li><a href="{% url userena_signout %}">Sign Out</a></li>
{% else %}
<li><a href="{% url account_login %}">Sign In</a></li>
<li><a href="{% url account_signup %}">Sign Up</a></li>
<li><a href="{% url userena_signin %}">Sign In</a></li>
<li><a href="{% url userena_signup %}">Sign Up</a></li>
{% endif %}
</ul>
{% block content %}

View File

@ -25,7 +25,7 @@ urlpatterns = patterns('',
# (r'^stop/(?P<slug>.*?)/georss/$', StopFeed()),
(r'^buseditor/$', 'mumbai.views.buseditor'),
(r'^editstops/$', 'mumbai.views.editstops'),
(r'^accounts/', include('allauth.urls')),
#(r'^accounts/', include('allauth.urls')),
(r'^1.0/', include('mumbai.apiurls')),
#url(r'^login/', include('socialregistration.urls',namespace='socialregistration')),
# Uncomment the admin/doc line below to enable admin documentation:
@ -35,6 +35,12 @@ urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^matchstops/$', 'mumbai.views.fuzzystops'),
(r'^fuzzystops_edit/$', 'mumbai.views.fuzzystops_edit'),
url(r'^accounts/', include('userena.urls')),
#(r'^accounts/signup/$', 'userena.views.signup',
#{'signup_form': SignupFormExtra}),
url(r'^messages/',include('userena.contrib.umessages.urls')),
)