Exemple #1
0
    # password reset/recover feature
    path('accounts/password/reset/',
         PasswordResetView.as_view(
             template_name='registration/password_reset_form.html'),
         name='password_reset'),
    path('accounts/password/reset/done/',
         PasswordResetDoneView.as_view(
             template_name='registration/password_reset_done.html'),
         name='password_reset_done'),
    path('accounts/password/reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='registration/password_reset_confirm.html'),
         name='password_reset_confirm'),
    path('accounts/password/done/',
         PasswordResetDoneView.as_view(
             template_name='registration/password_reset_complete.html'),
         name='password_reset_complete'),

    # additional registration page so when a new user signs up, they'll also set up their Project
    path('accounts/register/',
         MyRegistrationView.as_view(),
         name='registration_register'),
    path('accounts/create_project/',
         views.create_project,
         name='registration_create_project'),

    # for any URL path starting with accounts/, search for an matching URL path in django-registratiom\n-redux URL's
    path('accounts/', include('registration.backends.default.urls')),
    path('admin/', admin.site.urls),
]
Exemple #2
0
from django.contrib import admin
from django.contrib.auth.views import (
    password_change,
    password_change_done,
    password_reset,
    password_reset_done,
    password_reset_confirm,
    password_reset_complete)
from django.views.generic import (TemplateView, RedirectView, )
from collection import views

urlpatterns = [
    url(r'^$', views.index, name='home'),
    url(r'^about/$', TemplateView.as_view(template_name='about.html'),
        name='about'),
    url(r'^accounts/register/$', MyRegistrationView.as_view(),
        name='registration_register'),
    url(r'^accounts/create_thing/$', views.create_thing,
        name='registration_create_thing'),
    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^contact/$', TemplateView.as_view(template_name='contact.html'),
        name='contact'),
    url(r'^things/$', RedirectView.as_view(pattern_name='browse',
                                           permanent=True)),
    url(r'^things/(?P<slug>[-\w]+)/$', views.thing_detail,
        name='thing_detail'),
    url(r'^things/(?P<slug>[-\w]+)/edit/$', views.edit_thing,
        name='edit_thing'),
    url(r'^accounts/password/change/$', password_change,
        {'template_name': 'registration/password_change_form.html'},
Exemple #3
0
from collection.backends import MyRegistrationView

urlpatterns = [
    url(r'^$', views.index, name='home'),
    url(r'^about/$', TemplateView.as_view(template_name='about.html'), name='about'),
    url(r'^contact/$', TemplateView.as_view(template_name='contact.html'), name='contact'),
    url(r'^problems/$', RedirectView.as_view(pattern_name='browse', permanent=True)),
    url(r'^problems/(?P<slug>[-\w]+)/$', views.problem_detail, name='problem_detail'),
    url(r'^problems/(?P<slug>[-\w]+)/edit/$', views.edit_problem, name='edit_problem'),

    # browse flow
    url(r'^browse/$', RedirectView.as_view(pattern_name='browse', permanent=True)),
    url(r'^browse/name/$', views.browse_by_name, name='browse'),
    url(r'^browse/name/(?P<initial>[-\w]+)/$', views.browse_by_name, name="browse_by_name"),

    # password reset URLs
    url(r'^accounts/password/reset/$', password_reset, {'template_name': 'registration/password_reset_form.html'}, name="password_reset"),
    url(r'^accounts/password/reset/done/$', password_reset_done, {'template_name': 'registration/password_reset_done.html'}, name='password_reset_done'),
    url(r'^accounts/password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', password_reset_confirm,{'template_name': 'registration/password_reset_confirm.html'}, name="password_reset_confirm"),
    url(r'^accounts/password/done/$', password_reset_complete, {'template_name': 'registration/password_reset_complete.html'}, name="passwor_reset_complete"),

    # password change URLs
    url(r'^accounts/password/change/$', password_change, {'template_name': 'registration/password_change_form.html'}, name="password_change"),
    url(r'^accounts/password/change/$', password_change_done, {'template_name': 'registration/password_change_done.html'}, name='password_change_done'),
    
    url(r'^accounts/register/$', MyRegistrationView.as_view(), name='registration_register'),
    url(r'^accounts/create_problem/$', views.create_problem, name='registration_create_problem'),
    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^admin/', include(admin.site.urls)),
]
Exemple #4
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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. 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 include, url
from django.contrib import admin
from collection.backends import MyRegistrationView
from collection import views

urlpatterns = [
    url(r'', include('collection.urls')),
    
    url(r'^accounts/register/$', 
        MyRegistrationView.as_view(), name='registration_register'),
    url(r'^accounts/create_thing/$', 
        views.create_thing, name='registration_create_thing'),

    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^admin/', include(admin.site.urls)),
]
Exemple #5
0
        password_reset_confirm,
        {"template_name": "registration/password_reset_confirm.html"},
        name="password_reset_confirm",
    ),
    url(
        r"^accounts/password/done/$",
        password_reset_complete,
        {"template_name": "registration/password_reset_complete.html"},
        name="password_reset_complete",
    ),
    url(
        r"^accounts/password/change/$",
        password_change,
        {"template_name": "registration/password_change_form.html"},
        name="password_change",
    ),
    url(r"^accounts/register/$", MyRegistrationView.as_view(), name="registration_register"),
    url(r"^accounts/", include("registration.backends.simple.urls")),
    url(r"^admin/", include(admin.site.urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)


"""if settings.DEBUG:
    urlpatterns += patterns('',
        url(r'^media/(?P<slug>.*)/download/$', views.file_download, name='file_download'),
        )"""
Exemple #6
0
					   
					   
	#Browse				   
	url(r'^browse/$', RedirectView.as_view(pattern_name='browse')),
	url(r'^browse/name/$', 'collection.views.browse_by_name', name='browse'),
	url(r'^browse/name/(?P<initial>[-\w]+)/$', 'collection.views.browse_by_name', name='browse_by_name'),
					   
	#password reset urls					   
	url(r'^accounts/password/reset/$', password_reset,
	   {'template_name':'registration/password_reset_form.html'}, name="password_reset"),
	url(r'^accounts/password/reset/done/$', password_reset_done,
	   {'template_name':'registration/password_reset_done.html'}, name="password_reset_done"),
	url(r'^accounts/password/reset/(?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'^accounts/password/done/$', password_reset_complete,
		{'templane_name':'registration/password_reset_complete.html'}, name="password_reset_complete"),
					   
					   
	#Accounts
	#in the book this shows ", include('registration.backends.simple.urls')" pg24
	url(r'^accounts/register/$', MyRegistrationView.as_view(), name='registration_register'),
	url(r'^accounts/create_thing/$', 'collection.views.create_thing', name='registration_create_thing'),
	url(r'^accounts/', include('registration.backends.simple.urls')),
					   
	
	#edited this url so it looks like the book, but initially this was 
    #url(r'^admin/', admin.site.urls), this is because in django 1.10 we don't need include
	url(r'^admin/', include(admin.site.urls)),
	)
Exemple #7
0
    url(r'^acccouts/password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        password_reset_confirm,
        {'template_name': 'registration/password_reset_confirm.html'},
        name="password_reset_confirm"),

    url(r'^acccouts/password/done/$',
        password_reset_complete,
        {'template_name': 'registration/password_reset_complete.html'},
        name="password_reset_complete"),



    # registration
    url(r'^accounts/register/$',
        MyRegistrationView.as_view(),
        name='registration_register'),

    url(r'^accounts/create_thing/$',
        'collection.views.create_thing',
        name='registration_create_thing'),

    # browse
    url(r'^browse/$',
        RedirectView.as_view(pattern_name='browse')),
    url(r'^browse/name/$',
        'collection.views.browse_by_name',
        name="browse"),
    url(r'^browse/name/(?P<initial>[-\w]+)$',
        'collection.views.browse_by_name',
        name="browse_by_name"),
Exemple #8
0
        TemplateView.as_view(template_name='powerwall.html'),
        name='powerwall'),
    url(r'^pricing/$',
        TemplateView.as_view(template_name='pricing.html'),
        name='pricing'),
    url(r'^solarpanels/$',
        TemplateView.as_view(template_name='solarpanels.html'),
        name='solarpanels'),
    url(r'^profiles/(?P<slug>[-\w]+)/$', views.profile_detail,
       name='profile_detail'),
    url(r'^profiles/(?P<slug>[-\w]+)/edit/$', views.edit_profile,
       name='edit_profile'),
    url(r'^myaccount/$',
        TemplateView.as_view(template_name='myaccount.html'),
        name='myaccount'),
    url(r'^accounts/register/$', MyRegistrationView.as_view(),
            name='registration_register'),
    url(r'^accounts/create_my_solar/$',
            views.create_my_solar,
            name='registration_create_my_solar'),

    # the new browse flow
    url(r'^browse/name/$',
        views.browse_by_name, name='browse'),
    url(r'^browse/name/(?P<initial>[-\w]+)/$',
        views.browse_by_name, name='browse_by_name'),
    # the new password reset URLs
    url(r'^accounts/password/reset/$', password_reset,
        {'template_name': 'registration/password_reset_form.html'},
        name="password_reset"),
     url(r'^accounts/password/reset/done/$',