Exemplo n.º 1
0
from django.urls import path
from main.views import (
    DashboardView,
    AdminView,
    InviteListView,
    InviteCreateView,
    InviteDeleteView,
    ManageUsersListView
)

urlpatterns = [
    path('', DashboardView.as_view(), name="main-dashboard"),
    path('admin/', AdminView.as_view(), name="main-admin"),
    path('manage-users/', ManageUsersListView.as_view(), name="main-admin-manage-users"),
    path('admin/invite', InviteCreateView.as_view(), name="main-admin-invite"),
    path('admin/invite/list', InviteListView.as_view(), name="main-admin-invite-list"),
    path('admin/invite/list/<int:pk>/delete', InviteDeleteView.as_view(), name="main-admin-invite-delete"),
]
Exemplo n.º 2
0
                        VerifyAccountView, SettingsView, ChangePasswordView)

urlpatterns = [
    url(r'^$', IndexView.as_view(), name='index'),
    url(r'^about/$', AboutView.as_view(), name='about'),
    url(r'^terms/$', TermsView.as_view(), name='terms'),
    url(r'^support-us/$', SupportUsView.as_view(), name='support-us'),
    url(r'^heroes/$', HeroesView.as_view(), name='heroes'),
    url(r'^welcome/$', WelcomeView.as_view(), name='welcome'),
    url(r'^auth/signin/$', SigninView.as_view(), name='signin'),
    url(r'^auth/signout/$', SignoutView.as_view(), name='signout'),
    url(r'^auth/signup/$', SignupView.as_view(), name='signup'),
    url(r'^auth/reset-password/$',
        ResetPasswordView.as_view(),
        name='reset-password'),
    url(r'^auth/change-forgotten-password/$',
        ChangeForgottenPasswordView.as_view(),
        name='change-forgotten-password'),
    url(r'^auth/verify-account/$',
        VerifyAccountView.as_view(),
        name='verify-account'),
    url(r'^dashboard/$', DashboardView.as_view(), name='dashboard'),
    url(r'^dashboard/(?P<object_type>.+)/(?P<object_id>.+)$',
        DashboardDetailView.as_view(),
        name='dashboard-detail'),
    url(r'^settings/password/$',
        ChangePasswordView.as_view(),
        name='change-password'),
    url(r'^settings/$', SettingsView.as_view(), name='settings'),
]
Exemplo n.º 3
0
    elif request.user.is_authenticated():
        return redirect('dashboard')
    else:
        return redirect('login')

urlpatterns = \
    [
        # Authentication URLs
        url(r'^logout/$', auth_views.logout, {'next_page': '/login/'}, name='logout'),
        # url(r'^login/$', auth_views.login),
        url('^', include('django.contrib.auth.urls')),
        # Application URLs
        url(r'^main/', include('main.urls', namespace='main')),
        url(r'^admin/logout/$', auth_views.logout, {'next_page': '/'}),
        # use a function to determine where admin/ will resolve to, based on the user
        url(r'^admin/$', admin_view_selection_view),
        url(r'^admin/', include(admin.site.urls)),
        url(r'^publish/', include('publish.urls', namespace='publish')),
        url(r'^$', home_view_selection_view, name='home'),
        url(r'^dashboard/', login_required(DashboardView.as_view()), name='dashboard'),
        url(r'^about/', TemplateView.as_view(template_name='main/about.html'), name='about'),

        # api
        url(r'^api/', include(api_urls, namespace='api')),

        # legacy
        url(r'^grappelli/', include('grappelli.urls')),  # Grappelli URLS

    ] \
    + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 4
0
from django.urls import path, include
from main.views import HomeView, SignUpView, ProfileUpdateView, ProfileView, LoginoptionView, DashboardView
#import main.views

from django.contrib.auth import views as auth_views

urlpatterns = [
    #path('', include('main.urls')),
    #path('',views.homepage,name='home'),
    path('', HomeView.as_view(), name='home'),
    # path('dashboard/',include('main.urls')),
    path('login-option/', LoginoptionView.as_view(), name='login-option'),
    path('admin/', admin.site.urls),
    #path("register/", views.register, name="register"),
    path('accounts/', include('allauth.urls')),
    path('dashboard/', DashboardView.as_view(), name='dashboard'),
    path('profile-update/', ProfileUpdateView.as_view(),
         name='profile-update'),
    path('profile/', ProfileView.as_view(), name='profile'),
    path('register/', SignUpView.as_view(), name="register"),
    # path('accounts/logout/',include('allauth.urls')),
    # path('accounts/login/',include('allauth.urls')),
    path('login/',
         auth_views.LoginView.as_view(template_name='common/login.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(next_page='home'),
         name='logout'),
    path('change-password/',
         auth_views.PasswordChangeView.as_view(
             template_name='common/change-password.html', success_url='/'),
Exemplo n.º 5
0
    # Authentication URLs
    url(r'^logout/$',
        auth_views.logout, {'next_page': '/login/'},
        name='logout'),
    # url(r'^login/$', auth_views.login),
    url('^', include('django.contrib.auth.urls')),
    # Application URLs
    url(r'^download/', include(download_urlpatterns, namespace='download')),
    url(r'^admin/logout/$', auth_views.logout, {'next_page': '/'}),
    # use a function to determine where admin/ will resolve to, based on the user
    url(r'^admin/$', admin_view_selection_view),
    url(r'^admin/', admin.site.urls),
    url(r'^publish/', include(publish_urlpatterns, namespace='publish')),
    url(r'^$', home_view_selection_view, name='home'),
    url(r'^dashboard/',
        login_required(DashboardView.as_view()),
        name='dashboard'),
    url(r'^about/',
        TemplateView.as_view(template_name='main/about.html'),
        name='about'),

    # legacy
    url(r'^grappelli/', include('grappelli.urls')),  # Grappelli URLS
]

api_urls = [
    url(r'^api/', include(api_endpoints, namespace='api')),
]

sso_api_urls = [
    url(r'^sso-api/', include(api_endpoints, namespace='sso-api')),
Exemplo n.º 6
0
from django.conf.urls.static import static
from rest_framework import routers

from main.views import (BranchViewSet, ClientViewSet, LoyaltyViewSet,
                        RewardViewSet, EarnedRewardViewSet,
                        ProfileByUsernameView, ClientByPhoneView, UserView,
                        AddStarView, RewardListView, ExchangeRewardView,
                        DashboardView, SaleViewSet)

router = routers.DefaultRouter()

router.register(r'branches', BranchViewSet)
router.register(r'clients', ClientViewSet)
router.register(r'loyalties', LoyaltyViewSet)
router.register(r'rewards', RewardViewSet)
router.register(r'earned-rewards', EarnedRewardViewSet)
router.register(r'sales', SaleViewSet)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/', include(router.urls)),
    path('api/rest-auth/', include('rest_auth.urls')),
    path('get-profile/', ProfileByUsernameView.as_view()),
    path('get-client-by-phone/', ClientByPhoneView.as_view()),
    path('login/', UserView.as_view()),
    path('add-star/', AddStarView.as_view()),
    path('reward-list/<int:profile>/<int:client>/', RewardListView.as_view()),
    path('exchange-reward/', ExchangeRewardView.as_view()),
    path('dashboard/', DashboardView.as_view())
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 7
0
        return admin.site.index(request)
    elif request.user.is_authenticated() and request.user.is_staff:
        return redirect("dashboard")
    else:
        return redirect("login")


urlpatterns = [
    # API URLs
    url(r"^api/", include(v1_api.urls + v2_api.urls)),
    # Authentication URLs
    url(r"^logout/$", auth_views.logout, {"next_page": "/login/"}),
    url("^", include("django.contrib.auth.urls")),
    # Application URLs
    url(r"^main/", include("main.urls", namespace="main")),
    url(r"^species/", include("species.urls")),
    url(r"^grappelli/", include("grappelli.urls")),  # Grappelli URLS
    url(r"^admin/logout/$", auth_views.logout, {"next_page": "/"}),
    # use a function to determine where admin/ will resolve to, based on the user
    url(r"^admin/$", admin_view_selection_view),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^publish/", include("publish.urls", namespace="publish")),
    url(r"^download/", include("download.urls")),
    url(r"^old_publish/", include("old_publish.urls", namespace="old_publish")),
    url(r"^$", home_view_selection_view, name="home"),
    url(r"^dashboard/", login_required(DashboardView.as_view()), name="dashboard"),
    url(r"^about/", TemplateView.as_view(template_name="main/about.html"), name="about"),
    url(r"^contact/$", login_required(FeedbackView.as_view()), name="contact"),
    url(r"^contact/", include("envelope.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)