class ActivationResource(ModelResource): """ Activation Resource. Uses ``activation_view``, which must be an intance of class from ``registration`` package. Of course you also can write your own activation-view class, see https://django-registration.readthedocs.org/en/latest/views.html The resource expects a data POST with ``activation_key`` key. """ activation_view = ActivationView() class Meta: queryset = RegistrationProfile.objects.all() authorization = Authorization() allowed_methods = ['post'] def obj_create(self, bundle, **kwargs): if 'activation_key' not in bundle.data: raise BadRequest('You must pass activation_key') activated_user = self.activation_view.activate( bundle.request, bundle.data['activation_key']) if activated_user: return bundle raise BadRequest('Wrong activation_key')
from django.conf.urls import patterns, url from django.contrib.auth import views as auth_views from django.views.generic.base import TemplateView from registration.backends.default.views import ActivationView from registration.backends.default.views import RegistrationView from .forms import AppUserForm from .views import CustomRegistrationView urlpatterns = patterns('', url(r'^accounts/register/$', CustomRegistrationView.as_view( form_class=AppUserForm), {'title': 'Registration'}, name='register'), url(r'^accounts/login/$', auth_views.login, {'template_name': 'registration/login.html'}, name='auth_login'), url(r'^accounts/logout/$', auth_views.logout, {'template_name': 'registration/logout.html'}, name='auth_logout'), url(r'^accounts/activate/complete/$', TemplateView.as_view( template_name='registration/activation_complete.html'), name='registration_activation_complete'), url(r'^accounts/activate/(?P<activation_key>\w+)/$', ActivationView.as_view(), name='registration_activate'), url(r'^accounts/register/$', RegistrationView.as_view(), name='registration_register'), url(r'^accounts/register/complete/$', TemplateView.as_view( template_name='registration/registration_complete.html'), name='registration_complete'), )
url('^practise/', include('quizzer.urls')), # Steal some django-registration url so I can shoe horn my backend url(r'^accounts/register/$', QuizzerRegistrationView.as_view(), name='registration_register' ), # This is the default however have to do this else the next url will # also catch /accounts/activate/complete/ which is meant for this url url(r'^accounts/activate/complete/$', TemplateView.as_view(template_name='registration/activation_complete.html'), name='registration_activation_complete'), url(r'^accounts/activate/(?P<activation_key>\w+)/$', ActivationView.as_view(), name='registration_activate' ), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^change/', include('accounts.urls')), url(r'^videos/', include('videos.urls')), url('^$', TemplateView.as_view(template_name='home.html'), name='home' ), # Uncomment the next line to enable the admin: url(r'^admin/', include(admin.site.urls)), )
CreateUserEmailModificationRequest.as_view(), name="django_email_changer_change_view"), # django-registration url(r'^accounts/$', RedirectView.as_view(url='/', )), # Fix for password reset url(r'^accounts/password/reset/confirm/(?P<uidb64>[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='password_reset_complete'), url(r'^password/change/done/$', auth_views.password_change_done, name='password_change_done'), url(r'^accounts/password/reset/confirm/$', RedirectView.as_view(url='/', )), url(r'^accounts/password/reset/$', 'django.contrib.auth.views.password_reset', {'post_reset_redirect': '/accounts/password/reset/done/'}, name="password_reset"), url('^accounts/activate/$', ActivationView.as_view(), {'activation_key': 'None'}, name='registration_activate'), # enable unique email registration feature url(r'^accounts/register/$', RegistrationView.as_view(form_class=RegistrationFormWithName), name='registration_register'), url(r'^accounts/', include('registration.backends.default.urls')), ]
url(r'^applications/$', views.applications, name='applications'), url(r'^applications/feed/$', feeds.ApplicationFeed(), name='applications_feed'), url(r'^technical/(?P<slug>[^/]*)/$', views.techiead_item, name='techiead-item'), url(r'^auditions/(?P<slug>[^/]*)/$', views.audition_item, name='audition-item'), url(r'^applications/(?P<slug>[^/]*)/$', views.application_item, name='application-item'), url(r'^(?P<show_slug>[^/]*)/(?P<role_slug>[^/]*)/$', views.ad_role, name='ad_role'), ] simple_register_patterns = [ url(r'^activate/complete/$', TemplateView.as_view(template_name='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+)/$', ActivationView.as_view(), name='registration_activate'), url(r'^register/$', views.EmailRegistrationView.as_view(), name='registration_register'), url(r'^register/complete/$', TemplateView.as_view(template_name='registration/registration_complete.html'), name='registration_complete'), url(r'^register/closed/$', TemplateView.as_view(template_name='registration/registration_closed.html'), name='registration_disallowed'), url(r'', include('django.contrib.auth.urls')), ] urlpatterns = [ url(r'^$', views.index, name='home'), url(r'^', include(router.urls)), url(r'^auth/', include(simple_register_patterns)), url(r'^diary/$', views.diary, name='diary'), url(r'^diary_week$', views.diary_week, name='diary_week'), url(r'^diary/(?P<week>[-0-9]+)$', views.diary, name='diary'), url(r'^diary_jump$', views.diary_jump, name='diary_jump'),
password_reset_error, name='password_reset_error'), url(r'^accounts/password/reset/$', password_reset_email, { 'template_name': 'registration/password_reset_form.html', 'email_template_name': 'registration/password_reset_email.html', 'subject_template_name': 'registration/password_reset_email_subject.txt' }, name='password_reset'), url(r'^accounts/activate/(?P<activation_key>\w+)/$', ActivationView.as_view( template_name='registration/activation_complete.html', get_success_url=getattr( settings, 'REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL', lambda request, user: '******'), ), name='registration_activate'), url(r'^accounts/register/$', RegistrationView.as_view( form_class=GstudioEmailRegistrationForm, get_success_url=getattr( settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL', lambda request, user: '******'), ), name='registration_register'), # url(r'^accounts/login/$', auth_views.login ,{'template_name': login_template}, name='login'), url(r'^accounts/login/$', auth_views.login, {
""" import warnings warnings.warn( "include('registration.urls') is deprecated; use include('registration.backends.default.urls') instead.", DeprecationWarning) from registration.backends.default.urls import * #from registration.view import activate from registration.backends.default.views import RegistrationView from registration.backends.default.views import ActivationView from registration.forms import RegistrationFormUniqueEmail class RegistrationViewUniqueEmail(RegistrationView): form_class = RegistrationFormUniqueEmail urlpatterns = patterns( '', #url(r'^accounts/', include('django.contrib.auth.urls')), # enable unique email registration feature url(r'^register/$', RegistrationView.as_view(form_class=RegistrationFormUniqueEmail), name='registration_register'), url('accounts/', include('registration.backends.default.urls')), url(r'^activate/$', ActivationView.as_view(), name='registration_activate'), )
CreateUserEmailModificationRequest.as_view(), name="django_email_changer_change_view"), # django-registration url(r'^accounts/$', RedirectView.as_view(url='/', )), # Fix for password reset url(r'^accounts/password/reset/confirm/(?P<uidb64>[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='password_reset_complete'), url(r'^password/change/done/$', auth_views.password_change_done, name='password_change_done'), url(r'^accounts/password/reset/confirm/$', RedirectView.as_view(url='/', )), url(r'^accounts/password/reset/$', 'django.contrib.auth.views.password_reset', {'post_reset_redirect': '/accounts/password/reset/done/'}, name="password_reset"), url('^accounts/activate/$', ActivationView.as_view(), {'activation_key': 'None'}, name='registration_activate'), # enable unique email registration feature url(r'^accounts/register/$', RegistrationView.as_view(form_class=RegistrationFormWithName), name='registration_register'), url(r'^accounts/', include('registration.backends.default.urls')), )
url(r"^zaloguj$", "log_in", name="log_in"), url(r"^wyloguj$", "log_out", name="log_out"), ) # urls connected with registration of user urlpatterns += patterns( "registration.backends.default.views", url( r"^zarejestruj$", RegistrationView.as_view(form_class=RegistrationForm, template_name="registration/registration.html"), name="register_user", ), url( r"^aktywacja/(?P<activation_key>\w+)/$", ActivationView.as_view(template_name="registration/activate.html"), name="registration_activate", ), ) urlpatterns += patterns( "", url( r"^rejestracja_zakonczona$", TemplateView.as_view(template_name="registration/registration_complete.html"), name="registration_complete", ), url( r"^aktywacja_zakonczona$", TemplateView.as_view(template_name="registration/activation_complete.html"), name="registration_activation_complete",
'template_name': 'user_auth/change_password.html', 'post_change_redirect': 'dashboard', }, name='change_password' ), url( r'^activate/complete/$', TemplateView.as_view( template_name='user_auth/activation/complete.html' ), name='registration_activation_complete' ), url( r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view( template_name='user_auth/activation/activate.html' ), name='registration_activate' ), url( r'^register/$', authenticated_redirect( RegistrationView.as_view( form_class=RegistrationFormUniqueEmail, template_name='user_auth/registration/form.html' ) ), name='register' ), url( r'^register/email_sent/$',
name='message_count_view'), url(r'^message/(?P<message_id>\d+)/$', MessageDetailAPIView.as_view(), name='message_detail_view'), url(r'^email/sent/$', EmailSentView.as_view(), name='email_sent'), url(r'^password/change/$', "wanglibao_account.views.password_change", name='password_change'), url(r'^password/change/done/$', TemplateView.as_view(template_name='html/password_change_done.html'), name='password_change_done'), url(r'^activate/complete/$', TemplateView.as_view(template_name='activation_complete.jade'), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(template_name="activate.jade"), name='registration_activate'), url(r'^password/reset/$', PasswordResetGetIdentifierView.as_view(), name="password_reset_url"), url(r'^password/reset/identifier/$', PasswordResetGetIdentifierView.as_view(), name="password_reset"), url(r'^password/reset/validate/$', PasswordResetGetIdentifierView.as_view(), name="password_reset_validate"), url(r'^password/reset/send_mail/$', "wanglibao_account.views.send_validation_mail", name="send_validation_mail"), url(r'^password/reset/send_validate_code/$', "wanglibao_account.views.send_validation_phone_code",
url(r'^logout/$', login_required(add_lang(auth_views.logout)), {'template_name': 'accounts/logout.html'}, name='logout'), url(r'^userlist/$', tableUser, name='userlist'), url(r'^userlist/(?P<pk>[0-9]+)/$', UserDeleteView.as_view(), name='user_del'), url(r'^password/change/$', login_required(add_lang(auth_views.password_change)), {'post_change_redirect': reverse_lazy('auth_password_change_done'), 'template_name': 'accounts/password_change_form.html'},name='auth_password_change'), url(r'^password/change/done/$', login_required(add_lang(auth_views.password_change_done)), {'template_name': 'accounts/password_change_done.html'}, name='auth_password_change_done'), url(r'^password/reset/$', add_lang(auth_views.password_reset), {'template_name': 'accounts/password_reset_form.html', 'post_reset_redirect': reverse_lazy('auth_password_reset_done')},name='auth_password_reset'), url(r'^password/reset/complete/$', login_required(add_lang(auth_views.password_reset_complete)), {'template_name': 'accounts/password_reset_complete.html'}, name='auth_password_reset_complete'), url(r'^password/reset/done/$', login_required(add_lang(auth_views.password_reset_done)), {'template_name': 'accounts/password_reset_done.html'},name='auth_password_reset_done'), url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', login_required(add_lang(auth_views.password_reset_confirm)), {'post_reset_redirect': reverse_lazy('auth_password_reset_complete')}, name='auth_password_reset_confirm'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(template_name='accounts/activation_complete.html'),name='registration_activate'), url(r'^activate/complete/$', MyTemplateView.as_view(template_name='accounts/activation_complete.html'), name='registration_activation_complete'), ]
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf.urls.static import static from tastypie.api import Api from app.api.resources import DonationResource v1_api = Api(api_name='v1') v1_api.register(DonationResource()) from app.views import Register from app.forms import UserRegistrationForm from registration.backends.default.views import RegistrationView, ActivationView urlpatterns = patterns('', # Examples: # url(r'^blog/', include('blog.urls')), url(r'^$', 'app.views.home', name='home'), url(r'^about/$', 'app.views.about', name='about'), url(r'accounts/register/$', RegistrationView.as_view(form_class = UserRegistrationForm), name = 'registration_register'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(get_success_url='/admin'), name="registration_activate"), url(r'^accounts/', include('registration.backends.default.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^donations/', include('app.urls', namespace="app")), url(r'^api/', include(v1_api.urls)), )
url(r'^register/$', RegistrationView.as_view(), name='registration_register'), url(r'^register/complete/$', TemplateView.as_view(template_name='registration/extended/registration_complete.html'), name='registration_complete'), url(r'^register/closed/$', TemplateView.as_view(template_name='registration/extended/registration_closed.html'), name='registration_disallowed'), # activation url(r'^activate/complete/$', TemplateView.as_view(template_name='registration/extended/activation_complete.html'), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(template_name='registration/extended/activation_page.html'), name='registration_activate'), # login/logout url(r'^login/$', 'accounts.views.login', {'template_name': 'registration/extended/login.html'}, name='auth_login'), url(r'^logout/$', auth_views.logout, {'template_name': 'registration/extended/logged_out.html'}, name='auth_logout'), # override the default urls url(r'^password/change/$', auth_views.password_change, {'template_name': 'registration/extended/password_reset_form.html', }, name='password_change'), url(r'^password/change/done/$', auth_views.password_change_done, {'template_name': 'registration/extended/password_reset_confirm.html', }, name='password_change_done'),
r'^profile/password/$', views.PasswordChangeView.as_view( **{ 'template_name': 'user_auth/change_password.html', # 'post_change_redirect': 'dashboard', }), name='change_password'), url(r'profile/password/done', djauth_v.PasswordChangeDoneView.as_view(), name='password_change_done'), url(r'^activate/complete/$', TemplateView.as_view( template_name='user_auth/activation/complete.html'), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view( template_name='user_auth/activation/activate.html'), name='registration_activate'), url(r'^register/$', authenticated_redirect( RegistrationView.as_view( form_class=RegistrationFormUniqueEmail, template_name='user_auth/registration/form.html')), name='register'), url(r'^register/email_sent/$', TemplateView.as_view( template_name='user_auth/registration/complete.html'), name='registration_complete'), url(r'^register/not_allowed/$', TemplateView.as_view( template_name='user_auth/registration/disallowed.html'), name='registration_disallowed'),
from django.views.generic.base import TemplateView from registration.backends.default.views import ActivationView from registration.backends.default.views import RegistrationView, FrameRegistrationView urlpatterns = [ url(r'^activate/complete/$', TemplateView.as_view(template_name='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+)/$', ActivationView.as_view(), name='registration_activate'), url(r'^sign-up/$', RegistrationView.as_view(), name='registration_register'), # url(r'^sign-up/complete/$', # TemplateView.as_view(template_name='registration/registration_complete.html'), # name='registration_complete'), # url(r'^sign-up/closed/$', # TemplateView.as_view(template_name='registration/registration_closed.html'), # name='registration_disallowed'), url(r'', include('registration.auth_urls')), # alternates for frames
'password_reset', {'password_reset_form': PasswordForm}, name='password_reset'), url(UIDB, 'password_reset_confirm', name='password_reset_confirm'), url(r'^done/$', 'password_reset_complete', name='password_reset_complete'), url(r'^sent/$', 'password_reset_done', name='password_reset_done'), ), url_tree( r'^register/', '', url(r'^$', RG, name='auth_register'), url(r'^complete/$', RC, name='registration_complete'), url(r'^closed/$', RK, name='registration_disallowed'), url(r'^activate/(?P<activation_key>\w+)/$', AV.as_view(), name='registration_activate'), url(r'^activated/$', AC, name='registration_activation_complete'), ), ), url_tree( r'', 'person.views', url(r'^user/$', MyProfile.as_view(), name='my_profile'), url(r'^user/edit/$', EditProfile.as_view(), name='edit_profile'), url(r'^user/cla-agree/$', AgreeToCla.as_view(), name='agree_to_cla'), url(r'^user/welcome/$', Welcome.as_view(), name='welcome'), url(r'^teams/$', TeamList.as_view(), name='teams'), ), USER_URLS, TEAM_URLS,
ActivationView, RegistrationView, ) from registration_email.forms import EmailRegistrationForm urlpatterns = [ # django-registration views url(r'^activate/complete/$', TemplateView.as_view( template_name='registration/activation_complete.html'), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view( template_name='registration/activate.html', get_success_url=getattr( settings, 'REGISTRATION_EMAIL_ACTIVATE_SUCCESS_URL', lambda request, user: '******'), ), name='registration_activate'), url(r'^register/$', RegistrationView.as_view( form_class=EmailRegistrationForm, get_success_url=getattr( settings, 'REGISTRATION_EMAIL_REGISTER_SUCCESS_URL', lambda request, user: '******'), ), name='registration_register'), url(r'^register/complete/$', TemplateView.as_view( template_name='registration/registration_complete.html'), name='registration_complete'),
from registration.backends.default.views import ActivationView registration_form_kw = {"form_class": AppUserRegisterationForm} urlpatterns = patterns( "", url( r"^activate/complete/$", TemplateView.as_view(template_name="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+)/$", ActivationView.as_view(), name="registration_activate"), url(r"^register/$", AppUserRegistrationView.as_view(**registration_form_kw), name="registration_register"), url( r"^register/complete/$", TemplateView.as_view(template_name="registration/registration_complete.html"), name="registration_complete", ), url( r"^register/closed/$", TemplateView.as_view(template_name="registration/registration_closed.html"), name="registration_disallowed", ), (r"", include("registration.auth_urls")), )
name='user_profile'), url( r'^accounts/profile/edit/$', 'core.views.user_profile_edit', name='user_profile_edit' ), url( r'^accounts/register/$', RegistrationView.as_view(), name='registration.views.register' ), url( r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view(), name='registration.views.activate' ), url(r'^accounts/', include('registration.backends.default.urls')), # NG: tastypie API urls url(r'^api/', include(v1_api.urls)), # NG: Haystack (searching and querying) urls # url(r'^search/', include('haystack.urls')), url( r'^search/', FacetedSearchView( form_class=FacetedSearchForm, searchqueryset=sqs
urlpatterns = patterns( 'wafer.registration.views', url(r'^profile/$', 'redirect_profile'), url(r'^github-login/$', 'github_login'), url(r'^debian-login/$', 'debian_login'), # registration.backends.default.urls, but Django 1.5 compatible url(r'^activate/complete/$', TemplateView.as_view( template_name='registration/activation_complete.html' ), name='registration_activation_complete'), url(r'^activate/(?P<activation_key>\w+)/$', ActivationView.as_view( template_name='registration/activate.html' ), name='registration_activate'), url(r'^register/$', RegistrationView.as_view( template_name='registration/registration_form.html' ), name='registration_register'), url(r'^register/complete/$', TemplateView.as_view( template_name='registration/registration_complete.html' ), name='registration_complete'), url(r'^register/closed/$', TemplateView.as_view( template_name='registration/registration_closed.html' ), name='registration_disallowed'), url(r'', include('registration.auth_urls')),
from registration.api import RegistrationValidation urlpatterns = patterns( '', #url(r'^activate/complete/$', # TemplateView.as_view(template_name='registration/activation_complete.html'), # name='registration_activation_complete'), url(r'^activate/complete/$', 'registration.backends.default.views.registrationActivateComplete', 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+)/$', ActivationView.as_view(), name='registration_activate'), url(r'^register/$', RegistrationView.as_view(), name='registration_register'), url(r'^register/validation/$', RegistrationValidation.as_view(), name='registration_register_validation'), #url(r'^register/complete/$', # TemplateView.as_view(template_name='registration/registration_complete.html'), # name='registration_complete'), url(r'^register/complete/$', 'registration.backends.default.views.signupComplete', name="registration_complete"), url(r'^register/complete/facebook/$', 'registration.backends.default.views.signupCompleteFacebook',
def action(self, request, activation_key): _n = NormalActivationView() return _n.activate(request, activation_key)