Beispiel #1
0
from django.conf.urls import url

from users.views import (
    DashboardView,
    LoginView,
    LogoutView,
    SignupView,
    SignupAPIView,
    UserProfileAPIView,
)

urlpatterns = [
    url(r'^signup/$', SignupView.as_view(), name='signup'),
    url(r'^dashboard(?:/(?P<cat_id>[\d]+))?/$', DashboardView.as_view(), name='dashboard'),
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^api/user-signup/$', SignupAPIView.as_view(), name='api_signup'),
    url(r'^api/userprofile/$', UserProfileAPIView.as_view(), name='api_userprofile'),
]
Beispiel #2
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static

from users.views import DashboardView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('accounts/', include('allauth.urls')),
    path('accounts/', include('users.urls')),
    path('images/', include('images.urls')),
    path('', DashboardView.as_view(), name='root_view')
]

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Beispiel #3
0
from django.conf.urls import url, include

from users.views import (
	DashboardView,
    LoginView,
    LogoutView,
)
from django.views.generic import TemplateView

from users import views


urlpatterns = [
    url(r'^dashboard/$',DashboardView.as_view(template_name='user/profile.html'), name="dashboard"),
    url(r'^logout$', LogoutView.as_view(), name="logout"),
    url(r'^payment-url/$', views.buy_my_item, name='pay'),
    url(r'^some/obscure/name/', include('paypal.standard.ipn.urls')),
    url(r'^$', LoginView.as_view(template_name='user/index.html'), name='login'),

]
Beispiel #4
0
    re_path(r'^$', LandingView.as_view(), name='landing'),

    # Public
    re_path(r'^accounts/login/',
            auth_views.LoginView.as_view(template_name='public/login.html',
                                         redirect_authenticated_user=True),
            name='login'),
    re_path(r'^logout/', auth_views.LogoutView.as_view(), name='logout'),
    re_path(r'^register/', RegisterView.as_view(), name='register'),
    re_path(r'^forgot-password/',
            ForgotPasswordView.as_view(),
            name='forgot-password'),
    re_path(r'^reset-password/',
            ForgotPasswordConfirmView.as_view(),
            name='reset-password'),

    # Private
    re_path(r'^dashboard/', DashboardView.as_view(), name='dashboard'),
    re_path(r'^settings/', SettingsView.as_view(), name='settings'),
    re_path(r'^post/', include('posts.urls', namespace="post")),
    re_path(r'^user/', include('users.urls', namespace="user")),

    # Root Pages
    url(r'^@(?P<username>[^/]+)/$', ProfileView.as_view(), name='profile'),
]

if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Beispiel #5
0
from users.views import SendTrainerMessageView

from users.views import IndexView
from users.views import TrainerLoginView
from users.views import TrainerDashboardView
from users.views import SendClientMessageView
from users.views import GetUserChatView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^trainers/login/$', TrainerLoginView.as_view(), name='trainer-login-view'),
    url(r'^trainers/dashboard/$', TrainerDashboardView.as_view(), name='trainer-dashboard-view'),
    url(r'^trainers/send-client-message/$', SendClientMessageView.as_view(), name="send-client-message"),
    url(r'^trainers/get-user-chat/$', GetUserChatView.as_view(), name='get-user-chat-view'),


urlpatterns = [
    url(r'^admin/', admin.site.urls),

    url(r'^users/login/$', LoginView.as_view(), name='login-view'),
    url(r'^users/logout/$', LogoutView.as_view(), name='logout-view'),
    url(r'^users/registration/$', RegistrationView.as_view(), name='registration-view'),
    url(r'^dashboard/$', DashboardView.as_view(), name="dashboard-view"),
    url(r'^dashboard/send-trainer-message/$', SendTrainerMessageView.as_view(), name="send-trainer-message"),

    url(r'^$', IndexView.as_view(), name='index')

    url(r'^$', RedirectView.as_view(url='users/login/'))

]