Ejemplo n.º 1
0
"""getfit 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
from django.contrib import admin
from core.views import index, RegisterView, DashboardView, LoginView, LogoutView
from questans.views import AskQuestion
urlpatterns = [
    url(r'^$', index, name='index'),
    url(r'^ask-question', AskQuestion.as_view(), name='question'),
    url(r'^login/', LoginView.as_view(), name='login-view'),
    url(r'^dashboard/', DashboardView.as_view(), name='dashboard-view'),
    url(r'^register/', RegisterView.as_view(), name='register'),
    url(r'^logout/', LogoutView.as_view(), name='logout-view'),
    url(r'^admin/', admin.site.urls, name='admin'),
]
Ejemplo n.º 2
0
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 rest_framework import routers
from rest_framework_swagger.views import get_swagger_view
from core.views import UserView, RegisterView, AuthTokenView
from post.views import PostView

router = routers.DefaultRouter()
router.register(r'users', UserView)

schema_view = get_swagger_view(title='Test API Docs')

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^api-docs/', schema_view),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
    url(r'^auth/', AuthTokenView.as_view(), name='auth'),
    url(r'^registration/', RegisterView.as_view(), name='registration'),
    url(r'^posts/', PostView.as_view(), name='post')
]
Ejemplo n.º 3
0
    DashboardView,
    CampView,
    CampListView,
    SessionCreateView,
    SessionEditView,
    SessionView,
)
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns(
    "",
    # Examples:
    # url(r'^$', 'barcamp.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^dashboard/", DashboardView.as_view(), name="dashboard"),
    url(r"^accounts/register/", RegisterView.as_view(), name="register"),
    url(r"^accounts/login/", LoginView.as_view(), name="login"),
    url(r"^accounts/logout/", LogoutView.as_view(), name="logout"),
    url(r"^camps/$", CampListView.as_view(), name="camp_list"),
    url(
        r"^(?P<camp>[-_a-zA-Z0-9]+)/(?P<session>[-_a-zA-Z0-9]+)/edit/$", SessionEditView.as_view(), name="session_edit"
    ),
    url(r"^(?P<camp>[-_a-zA-Z0-9]+)/(?P<session>[-_a-zA-Z0-9]+)/$", SessionView.as_view(), name="session_view"),
    url(r"^(?P<camp>[-_a-zA-Z0-9]+)/session/create/$", SessionCreateView.as_view(), name="session_create"),
    url(r"^(?P<camp>[-_a-zA-Z0-9]+)/$", CampView.as_view(), name="camp"),
    url(r"^$", HomeView.as_view(), name="home_view"),
)
Ejemplo n.º 4
0
from django.contrib import admin
from django.urls import path, include
from core.views import BuildViewSet, RegisterView
from rest_framework.routers import SimpleRouter

router = SimpleRouter()
router.register(r'build', BuildViewSet, base_name='build')
# urlpatterns = router.urls

urlpatterns = [
    path('', include(router.urls)),
    path('admin/', admin.site.urls),
    path('rest-auth/', include('rest_auth.urls')),
    path('register/', RegisterView.as_view()),
]
Ejemplo n.º 5
0
from core.views import (
    CreatePostView,
    ListPostView,
    LikesAnalyticsView,
    UserActivityView,
    TokenObtainPairView,
    ChatView,
    BotFileUploadView,
    RegisterView,
    EmailActivationView,
)

app_name = 'core'

urlpatterns = [
    path('register/', RegisterView.as_view(), name='register'),
    path('email/activation/<str:uidb64>/<str:token>/',
         EmailActivationView.as_view(),
         name='email_activation'),
    path('token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('token/refresh/',
         jwt_views.TokenRefreshView.as_view(),
         name='token_refresh'),
    path('posts/', ListPostView.as_view(), name='list_posts'),
    path('posts/create/', CreatePostView.as_view(), name='create_post'),
    path('likes/analytics/',
         LikesAnalyticsView.as_view(),
         name='likes_analytics'),
    path('user/activity/', UserActivityView.as_view(), name='user_activity'),
    path('bot/<str:filename>/',
         BotFileUploadView.as_view(),
Ejemplo n.º 6
0
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.conf import settings
from django.contrib import admin
from django.views.generic.base import RedirectView

from core.views import login, logout, RegisterView

urlpatterns = [
    url(r'^$', RedirectView.as_view(pattern_name='login', permanent=True)),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^register/$', RegisterView.as_view(), name='register'),
    url(r'^login/$', login, name='login'),
    url(r'^logout/$', logout, name='logout'),
    url(r'^events/', include('events.urls', namespace='events')),
    url(r'^friends/', include('friends.urls', namespace='friends')),
]

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.º 7
0
from core.views import IndexView
from core.views import LoginView
from core.views import LogoutView
from core.views import RegisterView
from django.urls import path

app_name = "core"

urlpatterns = [
    path("", IndexView.as_view(), name="index"),
    path("login/", LoginView.as_view(), name="login"),
    path("logout/", LogoutView.as_view(), name="logout"),
    path("register/", RegisterView.as_view(), name="register"),
]
Ejemplo n.º 8
0
                       DashboardView, \
                       CampView, CampListView, \
                       SessionCreateView, SessionEditView, SessionView \

from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns(
    '',
    # Examples:
    # url(r'^$', 'barcamp.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^dashboard/', DashboardView.as_view(), name='dashboard'),
    url(r'^accounts/register/', RegisterView.as_view(), name='register'),
    url(r'^accounts/login/', LoginView.as_view(), name='login'),
    url(r'^accounts/logout/', LogoutView.as_view(), name='logout'),
    url(r'^camps/$', CampListView.as_view(), name='camp_list'),
    url(r'^(?P<camp>[-_a-zA-Z0-9]+)/(?P<session>[-_a-zA-Z0-9]+)/edit/$',
        SessionEditView.as_view(),
        name='session_edit'),
    url(r'^(?P<camp>[-_a-zA-Z0-9]+)/(?P<session>[-_a-zA-Z0-9]+)/$',
        SessionView.as_view(),
        name='session_view'),
    url(r'^(?P<camp>[-_a-zA-Z0-9]+)/session/create/$',
        SessionCreateView.as_view(),
        name='session_create'),
    url(r'^(?P<camp>[-_a-zA-Z0-9]+)/$', CampView.as_view(), name='camp'),
    url(r'^$', HomeView.as_view(), name='home_view'),
)
Ejemplo n.º 9
0
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

from core.views import RegisterView
from .views import HomeView

urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^accounts/logout/', 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
    url(r'^accounts/login/', 'django.contrib.auth.views.login', {'template_name':'login.html'}, name='login'),
    url(r'^accounts/register/$', RegisterView.as_view(), name='register'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^events/', include('events.urls')),
    url(r'^users/', include('users.urls')),
)

from django.conf import settings
from django.conf.urls.static import static

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Ejemplo n.º 10
0
from django.conf.urls import url
from core.views import RegisterView, ConfirmView, UserInfoView, LoginView, UploadView
from django.contrib.auth.views import login, logout
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    url(r'^register/', RegisterView.as_view(), name="register"),
    url(r'^login/', LoginView.as_view(), name="login"),
    url(r'^logout/', logout, {'next_page': '/'}, name="logout"),
    url(r'^confirm/(?P<secret>.+)', ConfirmView.as_view(), name='confirm'),
    url(r'^user/(?P<pk>\d+)', UserInfoView.as_view(), name='user'),
    url(r'^upload/', csrf_exempt(UploadView.as_view())),
]