Ejemplo n.º 1
0
def reactivate(request):
    if request.method == 'POST':
        form = ReactivateForm(request.POST)
        if form.is_valid():
            view = RegistrationView(request=request)
            view.send_activation_email(form.user)
            return redirect(reactivate_sent)
    else:
        form = ReactivateForm()
    return {'form': form}
Ejemplo n.º 2
0
 def test_register_view_status(self):
     """Test register view status code is 200."""
     from registration.backends.hmac.views import RegistrationView
     req = self.request.get(reverse_lazy('home'))
     reg_view = RegistrationView.as_view()
     response = reg_view(req)
     self.assertEqual(response.status_code, 200)
Ejemplo n.º 3
0
def send_never_activated_account_reminder():
    users = never_activated_accounts()

    for user in users:
        if not hasattr(user, 'userprofile'):
            user.delete()
            continue

        push_notification(
            [user], None, 'never_activated_account', {
                'date':
                user.date_joined,
                'username':
                user.username,
                'activation_link':
                '%s/%s' % (
                    settings.BASE_URL,
                    reverse(
                        'registration_activate',
                        args=(RegistrationView().get_activation_key(user), )),
                )
            })

        user.userprofile.never_activated_account_reminder_sent = timezone.now()
        user.userprofile.save(keep_deleted=True)

        logger.debug("Sent 'never activated account reminder' to %d" % user.pk)
Ejemplo n.º 4
0
 def register(self, form):
     new_user = BaseRegistrationView.register(self, form)
     acc = Account()
     acc.name = form.cleaned_data['name']
     acc.user = new_user
     acc.status = 'created'
     acc.save()
Ejemplo n.º 5
0
    def get_context_data(self, **kwargs):
        c = RegistrationView.get_context_data(self, **kwargs)
        c.update({'free_trial_code': settings.TRIAL_REGISTRATION_CODE})
        form = c['form']
        acc = form.fields['ad_campaign_code']
        acc.initial = self.request.session.get('ad_campaign_code')

        return c
Ejemplo n.º 6
0
from django.contrib import admin, staticfiles, messages
from registration.backends.hmac.views import RegistrationView

from web.forms import UserForm
from . import settings

def activation_complete(request):
    messages.success(request, "Congratulations, your account is now activated! Login and submit!")
    return redirect("auth_login")

def registration_complete(request):
    messages.success(request, "Thanks for registering! Please check your email to activate your account.")
    return redirect("home")

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/register/$', RegistrationView.as_view(form_class=UserForm, success_url='/submissions/'),
        name='registration_register',
       ),
    url(r'^accounts/register/complete/$', registration_complete, name='registration_complete',),
    url(r'^accounts/activate/complete/$', activation_complete, name='registration_activation_complete',),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'', include('web.urls')),
]
if settings.DEBUG and hasattr(staticfiles, 'views'):
    urlpatterns += [
        url(r'^static/(?P<path>.*)$', staticfiles.views.serve),
    ]
handler404 = 'web.views.handle404'
handler500 = 'web.views.handle500'
Ejemplo n.º 7
0
    url(r'^video/', include('signbank.video.urls', namespace='video')),

    # Hardcoding a number of special urls:
    url(r'^signs/search/$',
        permission_required('dictionary.search_gloss')(
            GlossListView.as_view()),
        name='admin_gloss_list'),
    url(r'^signs/add/$', dictionary_views.add_new_sign, name='create_gloss'),
    # TODO: Remove this in the future
    # url(r'^signs/import_csv/$', dictionary_views.import_csv, name='old_import_csv'),

    # Registration urls for login, logout, registration, activation etc.
    # C:\Users\localperla331\AppData\Local\Programs\Python\Python36\Lib\site-packages\registration\backends\hmac
    url(
        r'^accounts/register/$',
        RegistrationView.as_view(form_class=CustomUserForm),
        name='registration_register',
    ),
    url(
        r'^accounts/',
        include('registration.backends.hmac.urls'),
        name='registration_site',
    ),

    # Django-contrib-comments urls
    url(r'^comments/', include('django_comments.urls')),
    # Custom functionality added to comments app. Comment editing.
    url(r'^comments/update/(?P<id>\d+)/$',
        login_required(edit_comment, login_url='/accounts/login/')),
    # Feed for latest comments.
    url(r'^comments/latest/$',
Ejemplo n.º 8
0
# ViewSets define the view behavior.
class UserViewSet(viewsets.ModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer


# Routers provide an easy way of automatically determining the URL conf.
router = routers.DefaultRouter()
router.register(r'users', UserViewSet)

urlpatterns = [

                  url(r'^admin/filebrowser/', include(site.urls)),
                  url(r'^admin/', include(admin.site.urls)),
                  url(r'^accounts/register/$', RegistrationView.as_view(form_class=RegistrationFormTOSAndEmail),
                      name='registration_register'),
                  url(r'^accounts/', include('registration.backends.hmac.urls')),
                  url(r'^accounts/profile/$', RedirectView.as_view(url='/profile/', permanent=False),
                      name='ProfilePage'),
                  url(r'^profile/', include('user_profile.urls', namespace='profile')),
                  url(r'^cart/$', CartView.as_view(), name='cart'),
                  url(r'^cart/count/$', ItemCountView.as_view(), name='item_count'),
                  url(r'^checkout/$', CheckoutView.as_view(), name='checkout'),
                  url(r'^checkout/success/$', CheckoutSuccessView.as_view(), name='checkout_success'),
                  url(r'^service/', include('service.urls', namespace='service')),
                  url(r'^messages/', include('postman.urls', namespace='postman', app_name='postman')),
                  # url(r'^api/', include(router.urls)),
                  # url(r'^api/api-auth/', include('rest_framework.urls', namespace='rest_framework')),
                  url(r'^', include('main.urls', namespace='main')),
                  # ALL URLS AFTER 'cms.ursl' WILL NOT WORK!!!
Ejemplo n.º 9
0
from .views import ActivateWithComplexRedirect

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(
            template_name='registration/activation_complete.html'),
        name='simple_activation_redirect'),
    url(r'^activate/complete/$',
        TemplateView.as_view(
            template_name='registration/activation_complete.html'),
        name='registration_activation_complete'),
    # The activation key can make use of any character from the
    # URL-safe base64 alphabet, plus the colon as a separator.
    url(r'^activate/(?P<activation_key>[-:\w]+)/$',
        ActivateWithComplexRedirect.as_view(),
        name='registration_activate'),
    url(r'^register/$',
        RegistrationView.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')),
]
Ejemplo n.º 10
0
    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 import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from registration.backends.hmac.views import RegistrationView

from website.forms import PersonUserRegistrationForm
from website.views import LoginView, LogoutView, ActivationView

urlpatterns = [
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    url(r'^', include('website.urls', namespace='website')),
    url(r'^', include('backend.urls')),
    url(r'^admin/', admin.site.urls),
    # Overwrite some views defined by the registration plugin;
    # e.g. logged in users should not be able to log in again
    url(r'^accounts/login/', LoginView.as_view()),
    url(r'^accounts/logout/', LogoutView.as_view()),
    url(r'^accounts/activate/(?P<activation_key>[-:\w]+)/$',
        ActivationView.as_view(),
        name='registration_activate'),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=PersonUserRegistrationForm),
        name='registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Ejemplo n.º 11
0
from personal import views
from django.conf.urls.static import static
from personal.forms import MyRegistrationForm
from registration.backends.hmac.views import RegistrationView
from django.views.generic.base import RedirectView

favicon_view = RedirectView.as_view(url='/static/images/favicon.ico',
                                    permanent=True)

urlpatterns = [
    url(r'^', include('personal.urls')),
    url(r'^favicon\.ico$', favicon_view),
    url(r'^admin/', admin.site.urls),
    # accounts
    url(r'accounts/register/$',
        RegistrationView.as_view(form_class=MyRegistrationForm),
        name='registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^accounts/resend_email/',
        views.resend_activation_email,
        name="resend_activation_email"),
    # deprecated
    url(r'^accounts/settings/$', views.edit_settings),
    url(r'^accounts/profile/$', views.view_profile),
    url(r'^accounts/profile/(?P<username>\w+)/$', views.view_profile),
    # new
    url(r'^profile/$', views.view_profile, name="view_profile"),
    url(r'^profile/(?P<username>\w+)/$',
        views.view_profile,
        name="view_other_profile"),
    url(r'^settings/$', views.edit_settings, name="edit_settings"),
Ejemplo n.º 12
0
from registration.backends.hmac.views import ActivationView, RegistrationView

from hitchike.forms import EmailDomainFilterRegistrationForm

urlpatterns = [
    url(r'^activate/complete/$',
        TemplateView.as_view(
            template_name='registration/activation_complete.html'
        ),
        name='registration_activation_complete'),
    # The activation key can make use of any character from the
    # URL-safe base64 alphabet, plus the colon as a separator.
    url(r'^activate/(?P<activation_key>[-:\w]+)/$',
        ActivationView.as_view(),
        name='registration_activate'),
    url(r'^register/$',
        RegistrationView.as_view(form_class=EmailDomainFilterRegistrationForm),
        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')),
]
Ejemplo n.º 13
0
class RegistrationFormWithTerms(RegistrationForm):
    # Subclass of ``RegistrationForm`` which adds a required checkbox
    # for agreeing to a site's Terms of Service.

    tos = forms.BooleanField(
        widget=forms.CheckboxInput,
        label=filters.safe(("I have read and agree to the " "<a href=%s>Terms of Service<a>") % url_tos),
        error_messages={"required": TOS_REQUIRED},
    )


urlpatterns = [
    url(r"^admin/", admin.site.urls),
    url(
        r"^accounts/register/$",
        RegistrationView.as_view(form_class=RegistrationFormWithTerms),
        name="registration_register",
    ),
    url(r"^tos/", RedirectView.as_view(url=url_tos), name="tos"),
    url(r"^about/", RedirectView.as_view(url=url_about), name="about"),
    url(r"^feedback/", RedirectView.as_view(url=url_feedback), name="feedback"),
    url(r"^accounts/", include("registration.backends.hmac.urls")),
    url(r"^notification/", include("notification.urls")),
    url(r"", include("goal.urls")),
]

if settings.DEBUG:
    urlpatterns += [
        url(r"^media/(?P<path>.*)$", static.serve, {"document_root": settings.MEDIA_ROOT, "show_indexes": True})
    ]
Ejemplo n.º 14
0
from grid import urls as grid_urls
from map import urls as map_urls
from charts import urls as charts_urls
from editor import urls as editor_urls
from landmatrix.views import *
from landmatrix.forms import CustomRegistrationForm


handler500 = 'landmatrix.views.handler500'

CACHE_TIMEOUT = 24*3600

urlpatterns = [
    #url(r'^accounts/register/$', RegistrationView.as_view(), name='registration_register'),
    url(r'^accounts/register/$', RegistrationView.as_view(
        form_class=CustomRegistrationForm
    ), name='registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^impersonate/', include('impersonate.urls')),

    url(r'^language/(?P<language>[^/]+)/$', SwitchLanguageView.as_view(), name='switch_language'),

    url(r'^api/docs/', include('rest_framework_docs.urls')),
    url(r'^api/', include(api_urls)),

    # Wagtail
    url(r'^cms/', include(wagtailadmin_urls)),
    url(r'^news/', include('blog.urls', namespace='news')),
    url(r'^documents/', include(wagtaildocs_urls)),
Ejemplo n.º 15
0
    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 django.shortcuts import render
from registration.backends.hmac.views import RegistrationView

from .users.forms import UserRegistrationForm

urlpatterns = [
    url(r'^user/', include('django.contrib.auth.urls')),
    url(r'^accounts/register/$', RegistrationView.as_view(form_class=UserRegistrationForm)),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^', include('imagetagger.base.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^administration/', include('imagetagger.administration.urls')),
    url(r'^annotations/', include('imagetagger.annotations.urls')),
    url(r'^images/', include('imagetagger.images.urls')),
    url(r'^users/', include('imagetagger.users.urls')),
    url(r'^tagger_messages/', include('imagetagger.tagger_messages.urls')),
    url(r'^tools/', include('imagetagger.tools.urls')),
]


def handler500(request):
    """500 error handler which includes ``request`` in the context.
Ejemplo n.º 16
0
from django.contrib import admin
from personal import views
from django.conf.urls.static import static
from personal.forms import MyRegistrationForm
from registration.backends.hmac.views import RegistrationView
from django.views.generic.base import RedirectView

favicon_view = RedirectView.as_view(url='/static/images/favicon.ico', permanent=True)

urlpatterns = [
    url(r'^', include('personal.urls')),
    url(r'^favicon\.ico$', favicon_view),
    url(r'^admin/', admin.site.urls),
    # accounts
    url(r'accounts/register/$', 
        RegistrationView.as_view(form_class = MyRegistrationForm), 
        name = 'registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^accounts/resend_email/', views.resend_activation_email, name="resend_activation_email"),
    # deprecated
    url(r'^accounts/settings/$', views.edit_settings),
    url(r'^accounts/profile/$', views.view_profile),
    url(r'^accounts/profile/(?P<username>\w+)/$', views.view_profile),
    # new
    url(r'^profile/$', views.view_profile, name="view_profile"),
    url(r'^profile/(?P<username>\w+)/$', views.view_profile, name="view_other_profile"),
    url(r'^settings/$', views.edit_settings, name="edit_settings"),
    # apps
    url(r'^blog/', include('blog.urls')),
    url(r'^forum/', include('forum.urls')),
    url(r'^inbox/', include('privatemessages.urls')),
Ejemplo n.º 17
0
from core.views import HomepageView

from profiles.views import MyActivationView, logout_view, project_add,user_page, idea_add, project_update, idea_list, call_list
from profiles.forms import ErehwonUserSignUpForm
from registration.backends.hmac.views import RegistrationView

from messagesApp.views import MessagesProfileView, MessagesIndexView, MessagesWidgetView
import notifications.urls

import postman.urls
from messagesApp.views import api_send_message, api_get_conversation, api_get_correspondents

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^search/', include( 'ajaxsearch.urls' ) ),
    url(r'^accounts/register/$', RegistrationView.as_view(form_class=ErehwonUserSignUpForm), name="registration_register"),
    url(r'^accounts/activate/$', MyActivationView.as_view, name='activation'),
    url(r'^accounts/', include('registration.backends.hmac.urls')), # This line includes automatically all views and urls for registration/activation/password reset
    url(r'^accounts/login$', auth_views.login, name='login'),   
    url(r'^$', HomepageView.as_view(), name="index"),
    url(r'^accounts/logout/$', logout_view, name="logout"), # {'next_page': 'homepage'}, name="logout"),
    url(r'^home/$', user_page, name="user_page"),
    url(r'^home/addproject/$', project_add, name="project_add"),
    url(r'^home/add-ideas/$', idea_add, name="idea_add"),
    url(r'^ideas/$', idea_list, name="idea_list"),
    url(r'^calls/$', call_list, name="call_list"),

    # django-postman
    url(r'^messages/erehwon/$', MessagesIndexView.as_view(), name='MessagesIndex View'),
    url(r'^messages/messageprofile/$', MessagesProfileView.as_view(), name='MessagesProfile View'),
    url(r'^messages/widget/$', MessagesWidgetView, name='Messages Widget View'),
Ejemplo n.º 18
0
    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 django.conf import settings
from django.conf.urls.static import static
from registration.backends.hmac.views import RegistrationView
from django.views.generic import TemplateView

from custom_user.forms import EmailUserCreationForm

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^', include('Authors.urls')),
    url(r'^', include('Members.urls')),
    url(r'^summernote/', include('django_summernote.urls')),
    url(
        r'^accounts/register/$',
        RegistrationView.as_view(form_class=EmailUserCreationForm),
        name='registration_register',
    ),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
]

if settings.DEBUG is True:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.MEDIA_ROOT,
                          document_root=settings.MEDIA_ROOT)
Ejemplo n.º 19
0
from register.course.views import download, assignment_download, assignment_submission_download

urlpatterns = [
    url(r'^$', views.home, name='index'),
    url(r'^markdownx/', include('markdownx.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^campus-admin/', include('register.campus_admin.urls', namespace='campus_admin')),
    url(r'^faculty/course/', include('register.course.urls', namespace='course')),
    # url(r'^faculty/course/(?P<pk>.+)/assignment/', include('register.assignment.urls', namespace='assignment')),
    url(r'^faculty/', include('register.faculty.urls', namespace='faculty')),
    url(r'^student/courses/(?P<course_no>.+)/forum/', include('register.qa.urls', namespace='qa')),
    url(r'^faculty/courses/(?P<course_no>.+)/forum/', include('register.qa.urls', namespace='facultyqa')),
    url(r'^forum/', include('register.qaforum.urls', namespace='qaforum')),
    url(r'^student/', include('register.student.urls', namespace='student')),
    url(r'^announcements/', include('register.announcements.urls', namespace='announcements')),
    url(r'^accounts/register/$', RegistrationView.as_view(form_class=NewRegistrationForm), name='registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^download/course-material/(?P<file_name>.+)$', download, name='course_material_download'),
    url(r'^download/assignment-material/(?P<file_name>.+)$', assignment_download, name='course_material_download'),
    url(r'^download/assignment-submission/(?P<file_name>.+)$', assignment_submission_download, name='course_material_download'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

urlpatterns += staticfiles_urlpatterns()

if not settings.DEBUG:
    urlpatterns += [
        url(r'^staticfiles/(?P<path>.*)$', serve, {
            'document_root': settings.STATIC_ROOT,
        }),
    ]
Ejemplo n.º 20
0
from django.conf.urls import url, include
from registration.backends.hmac.views import RegistrationView

from .forms import CustomUserForm
from .views import CustomUserDetailView

urlpatterns = [
    url(r'register/$',
        RegistrationView.as_view(
            form_class=CustomUserForm
        ),
        name='registration_register',
        ),
    url(r'profile/$', CustomUserDetailView.as_view(), name='profile'),
    url(r'', include('registration.backends.hmac.urls')),
    url(r'', include('django.contrib.auth.urls')),
]
Ejemplo n.º 21
0
from django.conf.urls import url, include
from django.contrib import admin
from registration.backends.hmac.views import RegistrationView
from accounts.forms import FamoUserForm
from . import views

app_name = 'accounts'
urlpatterns = [
    url(r'^signup/', views.signup, name='signup'),
    # url(r'^registration/', include('registration.backends.default.urls')),
    url(r'^register/$', RegistrationView.as_view(form_class=FamoUserForm), name='registration_register'),
    # url(r'^$', include('registration.backends.hmac.urls')),
]
Ejemplo n.º 22
0
"""myclient URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/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 url, include
from django.contrib import admin
from django.views.generic import RedirectView
from myclient.forms import MyUniqueEmailRegistrationForm
from registration.backends.hmac.views import RegistrationView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', RedirectView.as_view(url='accounts/login'), name='login'),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=MyUniqueEmailRegistrationForm),
        name='registration_register'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^profile/', include('profiles.urls'))
]
Ejemplo n.º 23
0
Archivo: urls.py Proyecto: kopsti/iblog
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
from registration.backends.hmac.views import RegistrationView
from registration.forms import RegistrationFormUniqueEmail

urlpatterns = [
    url(r'^$',
        TemplateView.as_view(template_name="pages/index.html"),
        name='home'),
    url(r'^about/$',
        TemplateView.as_view(template_name="pages/about.html"),
        name='about'),
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=RegistrationFormUniqueEmail),
        name='auth_signup'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^blog/', include("posts.urls", namespace='posts')),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Ejemplo n.º 24
0
Archivo: urls.py Proyecto: nerogit/ward
#######################
# DJANGO REGISTRATION #
#######################

urlpatterns += [
    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(),
        name='registration_activate'),
    url(r'^register/$',
        RegistrationView.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'^accounts/', include('registration.backends.hmac.urls', namespace="registration")),
    # url(r'^accounts/', include('registration.backends.simple.urls', namespace="registration")),
]
Ejemplo n.º 25
0
from django.conf.urls import url
from django.contrib import admin
from .forms import mActivationView
from django.views.generic.base import TemplateView
from registration.forms import RegistrationFormUniqueEmail
from registration.backends.hmac.views import RegistrationView

from . import views

urlpatterns = [
    url(r'^activate/complete/$',
        TemplateView.as_view(
            template_name='registration/activation_complete.html'
        ),
        name='registration_activation_complete'),
    url(r'^activate/(?P<activation_key>[-:\w]+)/$',
        mActivationView.as_view(),
        name='registration_activate'),
    url(r'^register/$',
        RegistrationView.as_view(
            form_class = RegistrationFormUniqueEmail
        ),
        name='registration_register'),
    url(r'^picture/change/(?P<pid>\d+)$', views.pic_change),
    url(r'^picture/delete/(?P<pid>\d+)$', views.pic_delete),
    url(r'^login/$', views.login),
    url(r'^logout/$', views.logout),
    url(r'^profile/$', views.redirect_home),
    url(r'^settings/(?P<uid>\d+)$', views.user_settings),
]
Ejemplo n.º 26
0
    url(r'^contact/$', views.ContactView.as_view(), name='contact_list'),
    url(r'^contact/create$', views.sendMessageContact, name='sendcontact'),

    #HKA 25.08.2016 Vendor views for sign-in & sign up
    url('^register/vendeur', CreateView.as_view(template_name='polls/register_vendeur.html',form_class=MyCustomUserForm,success_url='/polls')),
    url(r'^vendeur/create$', views.registerVendeur, name='createVendeur'),
    url(r'^vendeur/login$',views.LoginVendeurView.as_view(), name='login_vendeur'),
    url(r'^vendeur/authenticate$', views.AuthenticateVendeur, name='createVendeur'),


    #HKA 25.08.2016 Customer views for sign-in & sign up
    url('^register/client', CreateView.as_view(template_name='polls/register_client.html',form_class=ClientUserForm,success_url='/polls')),
    url(r'^client/create$', views.registerClient, name='createClient'),
    url(r'^client/login$',views.LoginClientView.as_view(), name='login_client'),
    url(r'^client/authenticate$', views.AuthenticateVendeur, name='createVendeur'),
    url(r'^accounts/register/$',RegistrationView.as_view(form_class=MyCustomUserForm),name='registration_register',),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    #url(r'^site_media/(.*)$', 'django.views.static.serve', {'document_root' : settings.MEDIA_ROOT}),
    # HKA 07.09.2016
    url(r'^site_media/(.*)$', serve, {'document_root': settings.MEDIA_ROOT,}),
    # url('^commander', CreateView.as_view(template_name='polls/commander.html',form_class=CommandeForm,success_url='/polls')),
    url(r'^inactive/$', views.InactiveView.as_view(), name='olives_list'),
    url(r'^order/signin$',views.OrderSigninView.as_view(), name='order_signin'),
    url(r'^order/authenticate$', views.AuthenticateOrderClient, name='OrderAuthenticate'),
    url('^register/order/client', CreateView.as_view(template_name='polls/register_order_client.html',form_class=ClientUserForm,success_url='/orders/create/')),
    url(r'^client/order/create$', views.registerOrderClient, name='createOrderClient'),
    #url(r'^search/$', views.BlogSearchListView, name='researchProduct'),
    url(r'^search/$', views.search, name='search'),

    
Ejemplo n.º 27
0
    # Subclass of ``RegistrationForm`` which adds a required checkbox
    # for agreeing to a site's Terms of Service.

    tos = forms.BooleanField(widget=forms.CheckboxInput,
                             label=filters.safe(
                                 ('I have read and agree to the '
                                  '<a href=%s>Terms of Service<a>') % url_tos),
                             error_messages={
                                 'required': TOS_REQUIRED,
                             })


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=RegistrationFormWithTerms),
        name='registration_register'),
    url(r'^tos/', RedirectView.as_view(url=url_tos), name='tos'),
    url(r'^about/', RedirectView.as_view(url=url_about), name='about'),
    url(r'^feedback/', RedirectView.as_view(url=url_feedback),
        name='feedback'),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^notification/', include('notification.urls')),
    url(r'', include('goal.urls')),
]

if settings.DEBUG:
    urlpatterns += [
        url(r'^media/(?P<path>.*)$', static.serve, {
            'document_root': settings.MEDIA_ROOT,
            'show_indexes': True
Ejemplo n.º 28
0
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.hmac.views import RegistrationView
from accounts.forms import FamoUserForm

urlpatterns = [
    url('^', include('top.urls')),
    url(r'^category/', include('category.urls')),
    url(r'^articles/', include('articles.urls')),
    url(r'^counsel/', include('counsel.urls')),
    url(r'^portfolio/', include('portfolio.urls')),
    url(r'^admin/', admin.site.urls),
    # url(r'^accounts/', include('accounts.urls')),
    url(r'^search/', include('search.urls')),
    url(r'^', include('django.contrib.auth.urls')),
    url(
        r'^accounts/register/$',
        RegistrationView.as_view(form_class=FamoUserForm),
        name='registration_register',
    ),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url('', include('social.apps.django_app.urls', namespace='social')),
]
Ejemplo n.º 29
0
 def resend_activation_email(self, request, queryset):
     view = RegistrationView(request=request)
     for user in queryset:
         view.send_activation_email(user)
Ejemplo n.º 30
0
from profiles.views import MyActivationView, logout_view, project_add, user_page, idea_add, project_update, idea_list, call_list
from profiles.forms import ErehwonUserSignUpForm
from registration.backends.hmac.views import RegistrationView

from messagesApp.views import MessagesProfileView, MessagesIndexView, MessagesWidgetView
import notifications.urls

import postman.urls
from messagesApp.views import api_send_message, api_get_conversation, api_get_correspondents

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^search/', include('ajaxsearch.urls')),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=ErehwonUserSignUpForm),
        name="registration_register"),
    url(r'^accounts/activate/$', MyActivationView.as_view, name='activation'),
    url(
        r'^accounts/', include('registration.backends.hmac.urls')
    ),  # This line includes automatically all views and urls for registration/activation/password reset
    url(r'^accounts/login$', auth_views.login, name='login'),
    url(r'^$', HomepageView.as_view(), name="index"),
    url(r'^accounts/logout/$', logout_view,
        name="logout"),  # {'next_page': 'homepage'}, name="logout"),
    url(r'^home/$', user_page, name="user_page"),
    url(r'^home/addproject/$', project_add, name="project_add"),
    url(r'^home/add-ideas/$', idea_add, name="idea_add"),
    url(r'^ideas/$', idea_list, name="idea_list"),
    url(r'^calls/$', call_list, name="call_list"),
Ejemplo n.º 31
0
    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 django.shortcuts import render
from registration.backends.hmac.views import RegistrationView

from .users.forms import UserRegistrationForm

urlpatterns = [
    url(r'^user/', include('django.contrib.auth.urls')),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=UserRegistrationForm)),
    url(r'^accounts/', include('registration.backends.hmac.urls')),
    url(r'^', include('imagetagger.base.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^administration/', include('imagetagger.administration.urls')),
    url(r'^annotations/', include('imagetagger.annotations.urls')),
    url(r'^images/', include('imagetagger.images.urls')),
    url(r'^users/', include('imagetagger.users.urls')),
    url(r'^tools/', include('imagetagger.tools.urls')),
]


def handler500(request):
    """500 error handler which includes ``request`` in the context.

    Templates: `500.html`
Ejemplo n.º 32
0
from app import forms
from app import views

urlpatterns = [
    url(r'^\Z', include('app.urls')),
    url(r'^app/', include('app.urls')),
    url(r'^accounts/signin/$',
        auth_views.login, {
            'template_name': 'registration/signin.html',
            'authentication_form': forms.SigninForm,
            'redirect_authenticated_user': True
        },
        name='signin'),
    url(r'^accounts/signup/$',
        RegistrationView.as_view(template_name='registration/signup.html',
                                 form_class=forms.SignupForm),
        name='signup'),
    url(r'^accounts/resend/$',
        RegistrationView.as_view(
            template_name='registration/resend_activation_form.html',
            form_class=forms.ResendForm),
        name='resend'),
    url(r'^accounts/forgot-password/$',
        auth_views.PasswordResetView.as_view(
            template_name='reset/forgot_pass.html',
            email_template_name='reset/password_reset_email.html',
            success_url=reverse_lazy('pass-reset-send'),
            form_class=forms.ForgotPassForm),
        name='forgot-pass'),
    url(r'^accounts/password-reset-send/$',
        auth_views.PasswordResetDoneView.as_view(
Ejemplo n.º 33
0
from teachdentistry.main.api import DentalEducatorResource, InstitutionResource
from teachdentistry.main.forms import UserProfileForm
from teachdentistry.main.views import (ReportView, index, profile,
                                       instructor_page, edit_page, page)

v1_api = Api(api_name='v1')
v1_api.register(DentalEducatorResource())
v1_api.register(InstitutionResource())

admin.autodiscover()

urlpatterns = [
    url('^accounts/', include('djangowind.urls')),
    url(r'^accounts/register/$',
        RegistrationView.as_view(form_class=UserProfileForm),
        name='registration_register'),
    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/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/'
Ejemplo n.º 34
0
from django.conf.urls import url, include
from django.contrib import admin

from registration.backends.hmac.views import RegistrationView

import csa.views
import csa.forms.access
import csa.views.admin.user
import csa.views.products
import csa.views.cart


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^admin/users/(?P<user_id>\d+)/deposit_by_hand',
        csa.views.admin.user.deposit_by_hand,
        name='admin-user-deposit-by-hand'),
    url(r'^user/register/$',
        RegistrationView.as_view(
            form_class=csa.forms.access.RegistrationForm
        ),
        name='user-register',
    ),
    url(r'^user/', include('registration.backends.hmac.urls')),

    url(r'^$', csa.views.index, name='index'),
    url(r'^products/$', csa.views.products.index, name='products-index'),
    url(r'^user/cart/$', csa.views.cart.index, name='cart-index'),
    url(r'^user/cart/add', csa.views.cart.add, name='cart-add')
]
Ejemplo n.º 35
0
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from registration.backends.hmac.views import RegistrationView
from .forms import UserFormNames

from . import views

app_name = 'inj'
urlpatterns = [
	url(r'^$', views.home, name='home'),
    url(r'^login/$', auth_views.login, {'template_name': 'inj/login.html'}, name='login'),
    url(r'^logout/$', auth_views.logout, {'next_page': '/'}, name='logout'),
    url(r'^register/$',
        RegistrationView.as_view(
            form_class=UserFormNames
        ),
        name='registration_register',
    ),
	url(r'^newarticle/(?P<slug>[\w-]+)/$', views.newarticle, name='newarticle'),
	url(r'^addarticle/$', views.addarticle, name='addarticle'),
	url(r'^addarticle/(?P<slug>[\w-]+)/$', views.addarticle, name='addarticle'),
	url(r'^articles-by-date/$', views.articlesbydate, name='articlesbydate'),
	url(r'^comments-by-date/$', views.commentsbydate, name='commentsbydate'),
	url(r'^userpage/(?P<username>[\w-]+)/$', views.userpage, name='userpage'),
	url(r'^(?P<slug>[\w-]+)/$', views.article, name='article'),
	url(r'^(?P<slug>[\w-]+)/addcomment/$', views.addcomment, name='addcomment'),
	url(r'^(?P<slug>[\w-]+)/edit/$', views.edit, name='edit'),
	url(r'^(?P<slug>[\w-]+)/changearticle/$', views.changearticle, name='changearticle'),
	url(r'^(?P<slug>[\w-]+)/delete/$', views.delete, name='delete'),

]
Ejemplo n.º 36
0
from django.conf.urls import url, include
from .views import ForgotUsernameView, ForgotUsernameSuccessView
from .forms import SignupForm
from registration.backends.hmac.views import RegistrationView

urlpatterns = [
    url(r'^registration/register/$',
        RegistrationView.as_view(form_class=SignupForm),
        name='registration_register'),
    url(r'^registration/forgot_username/$',
        ForgotUsernameView.as_view(),
        name='forgot_username'),
    url(r'^registration/forgot_username_success/$',
        ForgotUsernameSuccessView.as_view(),
        name='forgot_username_success'),
    url(r'^registration/', include('registration.backends.hmac.urls')),
    url('^auth/', include('django.contrib.auth.urls'))
]