Пример #1
0
from django.conf.urls import patterns, url
from django.conf import settings
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from transcripts.views import PageView, PhasesView, RangeView, ErrorView, OriginalView
from homepage.views import HomepageView, HomepageQuoteView
from search.views import SearchView
from homepage.views import HomepageView, AboutView

tspatt = r'-?\d+:\d+:\d+:\d+'

urlpatterns = patterns('',
    url(r'^$', HomepageView.as_view(), name="homepage"),
    url(r'^homepage-quote/$', HomepageQuoteView.as_view()),
    url(r'^about/$', AboutView.as_view(), name="about"),
    url(r'^page/(?:(?P<transcript>[-_\w]+)/)?$', PageView.as_view(), name="view_page"),
    url(r'^page/(?P<start>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', PageView.as_view(), name="view_page"),
    url(r'^(?P<start>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', RangeView.as_view(), name="view_range"),
    url(r'^stream/(?P<start>' + tspatt + ')/?$', 'transcripts.views.stream', name="stream"),
    url(r'^(?P<start>' + tspatt + ')/(?P<end>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', RangeView.as_view(), name="view_range"),
    url(r'^phases/$', PhasesView.as_view(), name="phases"),
    url(r'^phases/(?P<phase_number>\d+)/$', PhasesView.as_view(), name="phases"),
    url(r'^search/$', SearchView.as_view(), name="search"),
    url(r'^people/$', 'people.views.people', name="people"),
    url(r'^people/(?P<role>[-_\w]+)/$', 'people.views.people', name="people"),
    url(r'^glossary/$', 'glossary.views.glossary', name="glossary"),   
    url(r'^original/(?:(?P<transcript>[-_\w]+)/)?(?P<page>-?\d+)/$', OriginalView.as_view(), name="original"),
)

urlpatterns += staticfiles_urlpatterns()
Пример #2
0
"""hellodjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/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 homepage.views import HomepageView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomepageView.as_view(), name='home'),
]
Пример #3
0
from homepage.views import HomepageView


def crash_test(request):
    if request.user.is_authenticated:
        1 / 0
    return HttpResponse(status=204)


urlpatterns = [
    # Debug toolbar
    path('__debug__/', include(debug_toolbar.urls)),

    # Homepage
    path('', HomepageView.as_view(), name='home'),

    # Built-in Django admin
    path('admin/', admin.site.urls),

    # Hijack
    path('hijack/', include('hijack.urls', namespace='hijack')),

    # Language selector
    path('lang/', include('django.conf.urls.i18n')),

    # News (blog)
    path('news/', include('news.urls')),

    # Forum
    path('forum/', include('forum.urls', namespace='forum')),
Пример #4
0
# from libations.views import LibationsView
# from story.views import StoryView
# from space.views import SpaceView
# from events.views import EventsView
# from gallery.views import GalleryView
# from press.views import PressView
# from contact.views import ContactView

admin.autodiscover()

urlpatterns = patterns('',
    # ADMIN
    (r'^whiskey/', include(admin.site.urls)),

    # HOMEPAGE
    url(r'^/?$', HomepageView.as_view(), name='home'),

    # SUBPAGES
    # url(r'^libations/$', LibationsView.as_view(), name='libations'),
    # url(r'^story/$', StoryView.as_view(), name='story'),
    # url(r'^space/$', SpaceView.as_view(), name='space'),
    # url(r'^events/$', EventsView.as_view(), name='events'),
    # url(r'^gallery/$', GalleryView.as_view(), name='gallery'),
    # url(r'^press/$', PressView.as_view(), name='press'),
    # (r'^contact/', ContactView.as_view(), name='contact'),
    url(r'^contact/$', 'django.views.generic.simple.direct_to_template',
        {'template': 'contact/contact.html'}, name='contact'),
)

# Galleries -> Libations
# About -> Story
Пример #5
0
from django.conf.urls.defaults import *
from django.conf import settings
from transcripts.views import PageView, PhasesView, RangeView, ErrorView, OriginalView
from homepage.views import HomepageView, HomepageQuoteView
from search.views import SearchView
from homepage.views import HomepageView, AboutView

tspatt = r"-?\d+:\d+:\d+:\d+"

urlpatterns = patterns(
    "",
    url(r"^$", HomepageView.as_view(), name="homepage"),
    url(r"^homepage-quote/$", HomepageQuoteView.as_view()),
    url(r"^about/$", AboutView.as_view(), name="about"),
    url(r"^page/$", PageView.as_view(), name="view_page"),
    url(r"^page/(?P<start>" + tspatt + ")/$", PageView.as_view(), name="view_page"),
    url(r"^(?P<start>" + tspatt + ")/$", RangeView.as_view(), name="view_range"),
    url(r"^(?P<start>" + tspatt + ")/(?P<end>" + tspatt + ")/$", RangeView.as_view(), name="view_range"),
    url(r"^phases/$", PhasesView.as_view(), name="phases"),
    url(r"^phases/(?P<phase_number>\d+)/$", PhasesView.as_view(), name="phases"),
    url(r"^search/$", SearchView.as_view(), name="search"),
    url(r"^people/$", "people.views.people", name="people"),
    url(r"^people/(?P<role>[-_\w]+)/$", "people.views.people", name="people"),
    url(r"^glossary/$", "glossary.views.glossary", name="glossary"),
    url(r"^original/(?P<page>-?\d+)/$", OriginalView.as_view(), name="original"),
)

if settings.DEBUG:  # pragma: no cover
    urlpatterns += patterns(
        "",
        (
Пример #6
0
urlpatterns = [
    path('admin/', admin.site.urls),
    # own
    path("login/", login_view),
    path("logout/", logout_view),
    path("register/", register_view),

    path("search/", search_view),
    path("products/create/", product_create_view),
    path("products/<int:pk>/", product_detail_view),  # dynamic url
    path("api/products/<int:pk>/", product_api_detail_view),  # dynamic url
    path("products/", product_list_view),  # dynamic url

    path("checkout/", order_checkout_view),  # dynamic url

    # path("bad-view-dont-use/", bad_view),
    # awod
    path("", HomepageView.as_view(), name="home"),
]

if settings.DEBUG:
    urlpatterns += static(
        settings.STATIC_URL,
        document_root=settings.STATIC_ROOT
    )
    urlpatterns += static(
        settings.MEDIA_URL,
        document_root=settings.MEDIA_ROOT
    )
Пример #7
0
from django.contrib import admin
from django.urls import path
from homepage.views import HomepageView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomepageView.as_view(), name='view'),
]

# HomepageView.as_view() creates a callable object, this callable object is analogous to a function. Django calls
# this object by passing in an HttpRequest generated by the user and then the object returns a HttpResponse. Django
# supplies the HttpResponse back to the user.
Пример #8
0
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from content.views import PressListView
from homepage.views import HomepageView
from django.conf import settings


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

urlpatterns = patterns('',
                       url(r'^$',
                           HomepageView.as_view()),
                       url(r'^press$', PressListView.as_view()),

                       # Examples:
                       # url(r'^$', 'freedenislevkin.views.home', name='home'),
                       # url(r'^freedenislevkin/', include('freedenislevkin.foo.urls')),

                       # Uncomment the admin/doc line below to enable admin documentation:
                       # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

                       # Uncomment the next line to enable the admin:
                       url(r'^admin/', include(admin.site.urls)),
                       )
urlpatterns += patterns('',
                        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
                            'document_root': settings.MEDIA_ROOT}))
Пример #9
0
from django.conf.urls import url
from django.conf import settings
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from glossary.views import GlossaryView
from homepage.views import HomepageView, AboutView, HomepageQuoteView
from people.views import PeopleView
from search.views import SearchView
from transcripts import views as transcripts_views
from transcripts.views import PageView, PhasesView, RangeView, ErrorView, OriginalView

tspatt = r'-?\d+:\d+:\d+:\d+'

urlpatterns = [
    url(r'^$', HomepageView.as_view(), name="homepage"),
    url(r'^homepage-quote/$', HomepageQuoteView.as_view()),
    url(r'^about/$', AboutView.as_view(), name="about"),
    url(r'^page/(?:(?P<transcript>[-_\w]+)/)?$', PageView.as_view(), name="view_page"),
    url(r'^page/(?P<start>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', PageView.as_view(), name="view_page"),
    url(r'^(?P<start>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', RangeView.as_view(), name="view_range"),
    url(r'^stream/(?P<start>' + tspatt + ')/?$', transcripts_views.stream, name="stream"),
    url(r'^(?P<start>' + tspatt + ')/(?P<end>' + tspatt + ')/(?:(?P<transcript>[-_\w]+)/)?$', RangeView.as_view(), name="view_range"),
    url(r'^phases/$', PhasesView.as_view(), name="phases"),
    url(r'^phases/(?P<phase_number>\d+)/$', PhasesView.as_view(), name="phases"),
    url(r'^search/$', SearchView.as_view(), name="search"),
    url(r'^people/$', PeopleView.as_view(), name="people"),
    url(r'^people/(?P<role>[-_\w]+)/$', PeopleView.as_view(), name="people"),
    url(r'^glossary/$', GlossaryView.as_view(), name="glossary"),
    url(r'^original/(?:(?P<transcript>[-_\w]+)/)?(?P<page>-?\d+)/$', OriginalView.as_view(), name="original"),
]

urlpatterns += staticfiles_urlpatterns()
Пример #10
0
from testimonials.models import Quotation, Customer
from homepage.models import PageIntro, TeaserImage, Teaser
from contact.forms import ContactForm
from contact.views import contact

# from taggit.models import Tag, TaggedItem
import datetime      

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

urlpatterns = patterns('',
# Come back to Home and About sections when galleria is done
# home
    (r'^$', HomepageView.as_view()),
#
# Class-based Generic Views for galleria    
	(r'^tags/$', ListView.as_view(model=Tag, context_object_name="tag_list", template_name="galleria/tag_list.html",)),
#
# My own view functions for galleria
#    (r'^gallery/(all)/$', gal_all),														
    #(r'^gallery/([\w-]+)/(?P<image_id>\d+)/$', image_detail),
    (r'^gallery/(\d+)/$', image_detail),
    (r'^gallery/([\w-]+)/$', gal_by_tag),
#
# Class-based generic views for daily-grist
    (r'^daily-grist/$', EntryListView.as_view()),
    (r'^daily-grist/(?P<year>\d{4})/(?P<month>[a-z]{3})/(?P<day>\d{1,2})/(?P<slug>[\w-]+)/$', EntryDetailView.as_view(),),
    (r'^daily-grist/archive/$', BlogArchiveIndexView.as_view(),),
    #(r'^daily-grist/archive/(?P<year>\d{4})/$', BlogYearArchiveView.as_view(),),
Пример #11
0
from django.urls import path
from homepage.views import HomepageView

urlpatterns = [
    path('', HomepageView.as_view(), name='homepage-index'),
]