Exemplo n.º 1
0
    def get_urls(self):
        urlpatterns = patterns('',
                                    # TODO: environment must exist
                                    url(r'^/?$',
                                        login_required(HomeView.as_view(site_name=self.name)), name="index"),
                                    url(r'^login/$', LoginView.as_view(), name="login"),
                                    url(r'^logout/$', LogoutView.as_view(), name="logout"),
                               )

        for group_name, menu_group in self._registry.iteritems():
            for subgroup_name, persoo_view in menu_group.views.iteritems():
                urlpatterns += patterns('',
                    url(r'^%s/%s' % (group_name, subgroup_name),
                            include(persoo_view.get_urls())
                        )
                )
        return urlpatterns
Exemplo n.º 2
0
    def get_urls(self):
        urlpatterns = patterns(
            '',
            # TODO: environment must exist
            url(r'^/?$',
                login_required(HomeView.as_view(site_name=self.name)),
                name="index"),
            url(r'^login/$', LoginView.as_view(), name="login"),
            url(r'^logout/$', LogoutView.as_view(), name="logout"),
        )

        for group_name, menu_group in self._registry.iteritems():
            for subgroup_name, persoo_view in menu_group.views.iteritems():
                urlpatterns += patterns(
                    '',
                    url(r'^%s/%s' % (group_name, subgroup_name),
                        include(persoo_view.get_urls())))
        return urlpatterns
Exemplo n.º 3
0
admin.autodiscover()

urlpatterns = [
    # Package URLs
    url(r'^admin/', include(admin.site.urls)),
    url(r'^grappelli/', include('grappelli.urls')),
    url(r'^autocomplete/', include('autocomplete_light.urls')),
    # url(r'^navigation/', include('navigation_autocomplete.urls')),
    # Project URLs
    #  Index and (mostly) static pages
    url(r'^$', views.IndexView.as_view(), name='index'),
    url(r'^about/$', views.AboutTemplateView.as_view(), name='about'),
    url(r'^contact/$', views.ContactTemplateView.as_view(), name='contact'),
    #  Auth
    url(r'^login/', LoginView.as_view(form_class=LoginForm), name='login'),
    url(r'^logout/', LogoutView.as_view(), name='logout'),
    #  Utility views
    url(r'^close/', 'pbridge.views.close', name='close'),
    url(r'^dashboard/', views.DashboardView.as_view(), name='dashboard'),
    #  App views
    url(r'^shows/', include('shows.urls', namespace='shows')),
    url(r'^campaigns/', include('campaigns.urls', namespace='campaigns')),
    url(r'^clients/', include('clients.urls', namespace='clients')),
    url(r'^ads/', include('ads.urls', namespace='ads')),
    url(r'^vendors/', include('vendors.urls', namespace='vendors')),
    # API URLs
    #  Django REST Framework login and logout views
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
    #  All other API URLs go in .api_urls to be included here
    url(r'^api/', include(api_urls, namespace='api'))
Exemplo n.º 4
0
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth.forms import UserCreationForm
from django.views.generic.edit import CreateView
from django.views.generic import TemplateView
from django.utils.module_loading import import_string
from class_based_auth_views.views import LoginView, LogoutView
from rest_framework import routers
from .views import IndexView, UserHomeView
# from posts import viewsets

router=routers.DefaultRouter()
# router.register(r'posts', viewsets.PostViewSet )
# router.register(r'upload', viewsets.PicUploadViewSet )
# router.register(r'comment', viewsets.CommentViewSet )

urlpatterns = [
    url(r'^$', IndexView.as_view(), name="index"),
    url(r'^admin/', admin.site.urls),
    url(r'^login/$', LoginView.as_view( template_name="login.html", success_url="/" ), name="login"),
    # url(r'^logout/$', LogoutView.as_view( template_name="logout.html"), name="logout"),
    # url(r'^register/$', CreateView.as_view( template_name='register.html', form_class=UserCreationForm, success_url='/' ), name="register"),
    url(r'^api-auth/', include('rest_framework.urls', namespace="rest_framework")),
    url(r'^u/(?P<username>[\w-]+)/$', UserHomeView.as_view(), name="userhome"),
] + router.urls + static( settings.MEDIA_URL, document_root=settings.MEDIA_ROOT )
Exemplo n.º 5
0
from django.views.generic.edit import CreateView
from .forms import RegistrationForm, LoginForm
from class_based_auth_views.views import LoginView, LogoutView

urlpatterns = patterns('',
    url(r'^register/$',
        CreateView.as_view(
            template_name='form_screen.html',
            form_class=RegistrationForm,
            success_url='/'
        ),
        name='register'),
    url(r'^login/$',
        LoginView.as_view(
            template_name='form_screen.html',
            form_class=LoginForm,
            success_url='/',
        ),
        name='login'),
    url(r'^logout/$',
        LogoutView.as_view(
            template_name='form_screen.html',
        ),
        name='logout'),
    url(r'^password/reset/$',
        'django.contrib.auth.views.password_reset',
        {'post_reset_redirect' : '/user/password/reset/done',
        'template_name' : 'form_screen.html'},
        name='password_reset'),
    url(r'^password/reset/done/$',
        'django.contrib.auth.views.password_reset_done'),
Exemplo n.º 6
0
from django.conf.urls import patterns, include, url
from tsohahammas.views import *
from django.views.generic import TemplateView
from class_based_auth_views.views import LoginView


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', index.Index.as_view(), name='index'),
    url(r'^group/',include(group.patterns)),
    url(r'^sample/',include(sample.patterns)),
    url(r'^login/$', LoginView.as_view(template_name = 'login.html', success_url='/'), name='login'),
    url(r'^logout/','django.contrib.auth.views.logout',{'next_page': '/'},name='logout'),
    url(r'^admin/', include(admin.site.urls)),
)

from django.conf import settings
if settings.DEBUG:
    # static files (images, css, javascript, etc.)
    urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
        'document_root': settings.MEDIA_ROOT}))
Exemplo n.º 7
0
from django.views.generic import TemplateView
from class_based_auth_views.views import LoginView, LogoutView
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    url(r'^$', HomeView.as_view(), name='home_page'),
    url(r'cliente/add/$', cliente_create, name='cliente_add'),
    url(r'cliente/(?P<pk>[0-9]+)/$', cliente_update, name='cliente_update'),
    url(r'cliente/(?P<pk>[0-9]+)/delete/$',
        cliente_delete,
        name='cliente_delete'),
    url(r'campo/add/$', campo_create, name='campo_add'),
    url(r'campo/(?P<pk>[0-9]+)/$', campo_update, name='campo_update'),
    url(r'campo/(?P<pk>[0-9]+)/delete/$', campo_delete, name='campo_delete'),
    url(r'reserva/add/$', reserva_create, name='reserva_add'),
    url(r'reserva/(?P<pk>[0-9]+)/$', reserva_update, name='reserva_update'),
    url(r'reserva/(?P<pk>[0-9]+)/delete/$',
        reserva_delete,
        name='reserva_delete'),
    url(r'^login/$',
        csrf_exempt(LoginView.as_view(form_class=AuthenticationForm)),
        name="login"),
    url(r'^logout/$', csrf_exempt(LogoutView.as_view()), name="logout"),
    url(r'^accounts/profile/$',
        csrf_exempt(DashboardView.as_view()),
        name='dashboard'),
    url(r'^accounts/login/$',
        csrf_exempt(LoginView.as_view(form_class=AuthenticationForm)),
        name="login"),
]