本文整理汇总了Python中registration.backends.simple.views.RegistrationView.as_view方法的典型用法代码示例。如果您正苦于以下问题:Python RegistrationView.as_view方法的具体用法?Python RegistrationView.as_view怎么用?Python RegistrationView.as_view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类registration.backends.simple.views.RegistrationView
的用法示例。
在下文中一共展示了RegistrationView.as_view方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: patterns
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic.base import TemplateView
from registration.backends.simple.views import RegistrationView
from opendata.views import Home
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', Home.as_view(), name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('registration.auth_urls')),
url(r'^accounts/register/$', RegistrationView.as_view(),
name='registration_register'),
url(r'^accounts/register/closed/$',
TemplateView.as_view(template_name='registration/registration_closed.html'),
name='registration_disallowed'),
url(r'^catalog/', include("catalog.urls")),
url(r'^comments/', include('django.contrib.comments.urls')),
url(r'^selectable/', include('selectable.urls')),
url(r'^scribbler/', include('scribbler.urls')),
url(r'^request-data/', include('suggestions.urls')),
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例2: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url, patterns
from django.contrib import admin
from django.views.generic.base import RedirectView
from registration.backends.simple.views import RegistrationView
class MyRegistrationView(RegistrationView):
def get_success_url(self, request=None, user=None):
return "/rango/"
urlpatterns = patterns(
"",
url(r"^admin/", include(admin.site.urls)),
url(r"^rango/", include("rango.urls")),
url(r"^$", RedirectView.as_view(url="http://127.0.0.1:8000/rango")),
url(r"^accounts/register/$", RegistrationView.as_view(), name="registration_register"),
(r"^accounts/", include("registration.backends.simple.urls")),
)
示例3: user_passes_test
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.contrib.auth.views import login
from registration.backends.simple.views import RegistrationView
from django.contrib.auth.views import password_reset,password_reset_done,password_reset_confirm,password_reset_complete
login_forbidden = user_passes_test(lambda u:u.is_anonymous(), '/')
urlpatterns = [
url(r'^$', 'insta.views.index'),
url(r'^image/', include('insta.urls')),
url(r'^admin/', admin.site.urls),
url(r'^ratings/', include('star_ratings.urls', namespace='ratings', app_name='ratings')),
url(r'^accounts/login/$',login_forbidden(login),name='registration_login',),
url(r'^accounts/register/$',login_forbidden(RegistrationView.as_view()),name='registration_register'),
url(r'^accounts/logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'},name='registration_logout'),
url(r'^accounts/password/reset/$', password_reset,{'template_name': 'registration/password_reset.html'},name='password_reset'),
url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',password_reset_confirm,{'template_name': 'registration/password_reset_confirm_.html'},name='password_reset_confirm'),
url(r'^password/reset/done/$',password_reset_done,{'template_name': 'registration/password_reset_done_.html'},name='password_reset_done'),
url(r'^password/reset/complete/$',password_reset_complete,{'template_name': 'registration/password_reset_complete_.html'},name='password_reset_complete'),
url(r'^account/profile/$', 'insta.views.profile',name='account_profile'),
url(r'^top/$', 'insta.views.get_top',name='top_users'),
url(r'^accounts/', include('registration.backends.simple.urls')),
]
示例4: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
"""
from django.conf.urls import include, url
from django.contrib import admin
from plank.forms import PlankRegistrationForm
from plank.forms import PlankUserCreationForm
from plank.forms import PlankUserRegistrationForm
# from registration.backends.default.views import RegistrationView
from registration.backends.simple.views import RegistrationView
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^plank/', include('plank.urls')),
# url(r'^accounts/register/$', RegistrationView.as_view(form_class = PlankRegistrationForm), name = 'registration_register'),
# url(r'^accounts/register/$', RegistrationView.as_view(form_class = PlankUserCreationForm), name = 'registration_register'),
url(r'^accounts/register/$', RegistrationView.as_view(form_class = PlankUserRegistrationForm), name = 'registration_register'),
url(r'^accounts/', include('registration.backends.simple.urls')), # One-step registration
# url(r'^accounts/', include('registration.backends.default.urls')), #Two-step registratoin
]
示例5: include
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
This will also automatically set up the views in
``django.contrib.auth`` at sensible default locations.
If you'd like to customize registration behavior, feel free to set up
your own URL patterns for these views instead.
"""
from django.conf.urls import include
from django.conf.urls import patterns
from django.conf.urls import url
from django.views.generic.base import TemplateView
from registration.backends.simple.views import RegistrationView
urlpatterns = patterns('',
url(r'^register/$',
RegistrationView.as_view(),
name='registration_register'),
url(r'^register/closed/$',
TemplateView.as_view(template_name='registration/registration_closed.html'),
name='registration_disallowed'),
(r'', include('registration.auth_urls')),
)
示例6: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from registration.backends.simple.views import RegistrationView
from shopping.forms import MyCustomUserForm
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/register/$',
RegistrationView.as_view(
form_class=MyCustomUserForm
),
name='registration_register',
),
url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'', include('shopping.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例7: MyRegistration
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings ##settings allows us to access vars in our projs settings.py file
from registration.backends.simple.views import RegistrationView
class MyRegistration(RegistrationView):
def get_success_url(self, request, user):
return '/rango/'
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'tango_with_django_project1.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^rango/', include('rango.urls')),
url(r'^accounts/register/$', RegistrationView.as_view(), name='registration_register'),
url(r'^accounts/', include('registration.backends.simple.urls')),
)
if settings.DEBUG: ##Checks if the Django project is being run in DEBUG
urlpatterns += patterns( ##if DEBUG is true, additional URL patterns are appended to the urlpatterns tuple
'django.views.static',
(r'^media/(?P<path>.*)', ##any file requested with a URL starting with media/
'serve',
{'document_root': settings.MEDIA_ROOT}), )
示例8: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.contrib import admin
from django.conf import settings
from registration.backends.simple.views import RegistrationView
from .apps.core.registration_forms import RegistrationFormExtra
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^', include('core.urls')),
]
# django-registration
# set a different form
if getattr(settings, 'INCLUDE_REGISTER_URL', True):
urlpatterns += [
url(r'^accounts/register/$',
RegistrationView.as_view(form_class=RegistrationFormExtra),
name='registration_register',
),
]
# include rest of registration normally
urlpatterns += [
url(r'^accounts/', include('registration.backends.simple.urls')), # use simple to avoid emails in local #TODO 2step
]
admin.site.site_header = 'Django Lotto Administration'
示例9: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
url(r"^charities/(?P<charity_id>\w+)/edit/$", "charity_app.views.edit_charity", name="edit_charity"),
url(r"^charities/(?P<charity_id>\w+)/delete/$", "charity_app.views.delete_charity", name="delete_charity"),
url(r"^videos/$", "charity_app.views.videos", name="videos"),
url(r"^videos/new/$", "charity_app.views.new_video", name="new_video"),
url(r"^videos/(?P<video_id>\w+)/$", "charity_app.views.view_video", name="view_video"),
url(r"^videos/(?P<video_id>\w+)/edit/$", "charity_app.views.edit_video", name="edit_video"),
url(r"^videos/(?P<video_id>\w+)/delete/$", "charity_app.views.delete_video", name="delete_video"),
# url(r'^signup$', 'auth_app.views.signup', name='signup'),
url(r"^admin/", include(admin.site.urls)),
url(r"^secret/$", "charity_app.views.special_page", name="secret"),
# url(r'^accounts/login$', 'auth_app.views.login1', name='login'),
url(r"^accounts/", include("registration.backends.default.urls")),
url(r"^$", "charity_app.views.index", name="index"),
url(
r"^register/charity/$",
RegistrationView.as_view(success_url="/charity/new/"),
name="registration_register_charity",
),
url(r"^register/giver/$", RegistrationView.as_view(success_url="/giver/new/"), name="registration_register_giver"),
url(r"^register/user/$", RegistrationView.as_view(success_url="/user/home/"), name="registration_register_giver"),
url(r"^accounts/password/change/$", auth_views.password_change, name="password_change"),
url(r"^accounts/password/change/done/$", auth_views.password_change_done, name="password_change_done"),
url(r"^accounts/password/reset/$", auth_views.password_reset, name="password_reset"),
url(r"^accounts/password/reset/done/$", auth_views.password_reset_done, name="password_reset_done"),
url(r"^accounts/password/reset/complete/$", auth_views.password_reset_complete, name="password_reset_complete"),
url(
r"^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$",
auth_views.password_reset_confirm,
name="password_reset_confirm",
),
url(r"", include("registration.backends.default.urls")),
示例10: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
#from registration.backends.hmac.views import RegistrationView
#from registration.backends.model_activation.views import RegistrationView
from registration.backends.simple.views import RegistrationView
from registration.forms import RegistrationForm
from editor.forms import UserRegistrationForm
from editor import views
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^', include('editor.urls')),
url(r'^editor/', include('editor.urls')),
url(r'^internal/content/', include('content.urls')),
url(r'^internal/library/', include('library.urls')),
url(r'^internal/', include('jhome.urls')),
# url(r'^accounts/', include('registration.backends.hmac.urls')),
# url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^accounts/profile/$', views.dispatch_ad_source, name='dispatch_ad_source'),
url(r'^accounts/register/$',
RegistrationView.as_view(
form_class = UserRegistrationForm
),
name='registration_register',
),
url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^admin/', admin.site.urls),
]
示例11: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
"""
from django.conf.urls import include
from django.conf.urls import url
from django.conf import settings
from django.views.generic.base import TemplateView
from registration.backends.simple.views import RegistrationView
urlpatterns = [
url(
r"^register/closed/$",
TemplateView.as_view(template_name="registration/registration_closed.html"),
name="registration_disallowed",
),
url(
r"^register/complete/$",
TemplateView.as_view(template_name="registration/registration_complete.html"),
name="registration_complete",
),
]
if getattr(settings, "INCLUDE_REGISTER_URL", True):
urlpatterns += [url(r"^register/$", RegistrationView.as_view(), name="registration_register")]
if getattr(settings, "INCLUDE_AUTH_URLS", True):
urlpatterns += [url(r"", include("registration.auth_urls"))]
示例12: patterns
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.conf.urls import patterns, include, url
from django.contrib import admin
from registration.backends.simple.views import RegistrationView
from core.views import UserProfileDetailView
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views
from core.views import UserProfileEditView
from core.models import UserProfile
from core.forms import UserProfileForm
from core import views
urlpatterns = patterns('',
url(r'^$','core.views.home', name = 'home' ),
url(r'^admin/', include(admin.site.urls)),
url(r'^activities/',include('core.urls', namespace = 'core')),
url(r'^users/(?P<slug>\w+)/$', UserProfileDetailView.as_view(), name="profile"),
url(r'^edit_profile/$', login_required(UserProfileEditView.as_view()), name="edit_profile"),
url(r'^accounts/register/$', RegistrationView.as_view(form_class = UserProfileForm ) , name = 'registration_register'),
url(r'^accounts/logout/$', auth_views.logout, {'template_name': 'registration/logout.html', 'next_page':'home'}, name='auth_logout'),
url(r'^accounts/', include('registration.backends.simple.urls')),
)
示例13: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
# fbUsers in user_app
url(r'^fbusers/$', 'user_app.views.fbusers', name='fbusers'),
url(r'^fbusers/add_profile/$', 'user_app.views.fbaddprofile', name='fbadd_profile'),
url(r'^fbusers/newsfeed/$', 'user_app.views.fbnewsfeed', name='fbnewsfeed'),
url(r'^fbusers/home/$', 'user_app.views.fbusers_home', name='fbusers_home'),
url(r'^fbusers/profile/$', 'user_app.views.fbuser_profile', name='fbuser_profile'),
# Admin
url(r'^admin/', include(admin.site.urls)),
# Django Auth
url(r'^accounts/', include('registration.backends.default.urls')),
url(r'^register/charity/$',
RegistrationView.as_view(success_url='/charity/new/'),
name='registration_register_charity', ),
url(r'^register/giver/$',
RegistrationView.as_view(success_url='/giver/new/'),
name='registration_register_giver', ),
url(r'^register/user/$',
RegistrationView.as_view(success_url='/user/home/'),
name='registration_register_giver', ),
url(r'^accounts/password/change/$',
auth_views.password_change,
name='password_change'),
url(r'^accounts/password/change/done/$',
auth_views.password_change_done,
示例14: patterns
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', views.index, name='home'),
url(r'^admin/', include(admin.site.urls)),
url(r'^edit/$', views.edit, name="edit"),
url(r'^authorize/$', views.authorize, name='authorize'),
url(r'^farmers/buy/(?P<pk>\d+)/$',
views.buy, name='buy'),
url(r'^farmers/(?P<pk>\d+)/$',
views.profile, name='profile'),
url(r'^register/$', RegistrationView.as_view(
form_class=CustomRegistrationForm),
name='registration_register'),
url(r'^', include(
'registration.backends.simple.urls')),
)
urlpatterns += staticfiles_urlpatterns()
示例15: url
# 需要导入模块: from registration.backends.simple.views import RegistrationView [as 别名]
# 或者: from registration.backends.simple.views.RegistrationView import as_view [as 别名]
url(r'^accounts/password/reset/$',
auth_views.password_reset,
name='password_reset'),
url(r'^accounts/password/reset/done/$',
auth_views.password_reset_done,
name='password_reset_done'),
url(r'^accounts/password/reset/complete/$',
auth_views.password_reset_complete,
name='password_reset_complete'),
url(r'^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
auth_views.password_reset_confirm,
name='password_reset_confirm'),
# url(r'^accounts/', include('registration.backends.simple.urls')),
url(r'^accounts/register/$',
RegistrationView.as_view(template_name='nbip/registration_form.html'),
name='registration_register'),
url(r'^accounts/register/closed/$',
TemplateView.as_view(template_name='nbip/registration_closed.html'),
name='registration_disallowed'),
url(r'^admin/', include(admin.site.urls)),
url(r'', include('nbip.urls')),
)
if settings.DEBUG:
import debug_toolbar
urlpatterns += patterns('',
url(r'^__debug__/', include(debug_toolbar.urls)),
)