Beispiel #1
0
    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 rest_framework import routers

from accounts import views
from views import HomePage

router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'posts', views.PostViewSet)

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomePage.as_view(), name='home'),
    url(r'^accounts/', include('accounts.urls'), name='accounts'),
    url(r'^rest/', include(router.urls)),
    url(r'^api-auth/',
        include('rest_framework.urls', namespace='rest_framework')),
]
Beispiel #2
0
'''
Created on Mar 30, 2012

@author: Haak Saxberg
'''
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from views import LandingPage, Writeup, HomePage, ASHMCList

urlpatterns = patterns(
    'main.views',
    url('^$', LandingPage.as_view(), name='main_landing_page'),
    url('^writeup$', Writeup.as_view(), name='writeup'),
    url('^home', login_required(HomePage.as_view()), name='main_home'),
    url('^council', ASHMCList.as_view(), name="council_list"),
)
Beispiel #3
0
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()

from views import (
    HomePage, LabPage, DownloadsPage, IncidentReportPage,
    NoSmokingPage
)

urlpatterns = patterns('',
    url(r'^$', HomePage.as_view()),
    url(r'^lab/$', LabPage.as_view(), name='thathweb.lab'),
    url(r'^pif/$', IncidentReportPage.as_view(), name='incident_report'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^mediamanager/', include('thathweb.media.urls')),
    url(r'^accounts/', include('thathweb.accounts.urls')),
    url(r'^tinymce/', include('tinymce.urls')),
    url(r'^posts/', include('thathweb.posts.urls')),
    url(r'^pictures/', include('thathweb.pictures.urls')),
    url(r'^nacha/',include('thathweb.nacha_creator.urls')),
    url(r'^downloads/', DownloadsPage.as_view() ),
    url(r'^days-since-last-cigarette/', NoSmokingPage.as_view() ),
    url(r'^admin_tools/', include('admin_tools.urls')),
)

if settings.DEBUG:
    urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve',
         {'document_root': settings.MEDIA_ROOT}),
    )
Beispiel #4
0
from django.conf.urls import url

from views import ItemCreationView, ItemEditView, ItemDetailView, UserLogView
from views import VariantCreationView, VariantDetailView, VariantEditView, HomePage
from views import RegistrationView, LoginView, LogoutView

urlpatterns = [
    url(r'^$', HomePage.as_view(), name="homepage"),
    url(r'^user-log/$', UserLogView.as_view(), name="log"),
    url(r'^create-item/', ItemCreationView.as_view(), name="create-item"),
    url(r'^edit-item/(?P<pk>\w{0,50})/',
        ItemEditView.as_view(),
        name="edit-item"),
    url(r'^create-variant/',
        VariantCreationView.as_view(),
        name="create-variant"),
    url(r'^view-variant/(?P<pk>\w{0,50})/',
        VariantDetailView.as_view(),
        name="view-variant"),
    url(r'^view-item/(?P<pk>\w{0,50})/',
        ItemDetailView.as_view(),
        name="view-variant"),
    url(r'^edit-variant/(?P<pk>\w{0,50})/',
        VariantEditView.as_view(),
        name="edit-variant"),
    url(r'^register/', RegistrationView.as_view(), name="register-user"),
    url(r'^login/', LoginView.as_view(), name="login"),
    url(r'^logout/', LogoutView.as_view(), name="logout"),
]
Beispiel #5
0
__author__ = 'cdumitru'

from django.conf.urls import patterns, url
from django.views.generic.base import RedirectView
from views import HomePage

urlpatterns = patterns('',
    #redirect to home
    url(r'^home/', HomePage.as_view(), name='home'),
)
Beispiel #6
0
'''
Created on Mar 30, 2012

@author: Haak Saxberg
'''
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required


from views import LandingPage, Writeup, HomePage, ASHMCList

urlpatterns = patterns('main.views',
                       url('^$', LandingPage.as_view(), name='main_landing_page'),
                       url('^writeup$', Writeup.as_view(), name='writeup'),
                       url('^home', login_required(HomePage.as_view()), name='main_home'),
                       url('^council', ASHMCList.as_view(), name="council_list"),
                       )
Beispiel #7
0
from django.conf.urls import url
from views import HomePage

urlpatterns = [url(r"^$", HomePage.as_view(), name="home")]