From f60dee1ee321562e0c21632c55d919f68470ed20 Mon Sep 17 00:00:00 2001 From: Subhodip Biswas Date: Sun, 19 Aug 2012 19:13:23 +0530 Subject: [PATCH] User registration --- chaloBEST/settings.py | 52 ++++++++++++++++++++++++++-------- chaloBEST/templates/base.html | 6 ++-- chaloBEST/templates/index.html | 6 ++-- chaloBEST/urls.py | 8 +++++- 4 files changed, 53 insertions(+), 19 deletions(-) diff --git a/chaloBEST/settings.py b/chaloBEST/settings.py index 67b6364..730adc8 100644 --- a/chaloBEST/settings.py +++ b/chaloBEST/settings.py @@ -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: diff --git a/chaloBEST/templates/base.html b/chaloBEST/templates/base.html index 2333471..33b4571 100644 --- a/chaloBEST/templates/base.html +++ b/chaloBEST/templates/base.html @@ -42,10 +42,10 @@ body,html { {% block body %} {% block content %} diff --git a/chaloBEST/templates/index.html b/chaloBEST/templates/index.html index 283f0e2..2310d50 100644 --- a/chaloBEST/templates/index.html +++ b/chaloBEST/templates/index.html @@ -11,10 +11,10 @@ {% block body %} {% block content %} diff --git a/chaloBEST/urls.py b/chaloBEST/urls.py index a4e43a7..ee53bf0 100644 --- a/chaloBEST/urls.py +++ b/chaloBEST/urls.py @@ -25,7 +25,7 @@ urlpatterns = patterns('', # (r'^stop/(?P.*?)/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')), + )