Example #1
0
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from views import Index


urlpatterns = patterns('',
    url(r'^$', Index.as_view(), name='frontpage'),
    url(r'^', include('core.department.urls', namespace='department')),
    url(r'^manage/', include('core.manager.urls', namespace='manager')),
    url(r'^login/', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
    url(r'^logout/', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'),
)
Example #2
0
from . import main
from views import Index

url = main.add_url_rule

main_view = Index.as_view('index')
url('/', view_func=main_view)
Example #3
0
#!/bin/env python
#-*- coding:utf-8 -*-
"""
"""
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin

from views import Index

admin.autodiscover()

urlpatterns = patterns('',
    url(r'^profile/$', Index.as_view(), name='user_account'),
    #url(r'^registration/', include('webapp.apps.accounts.registration.urls')),
    url(r'^registration/', include('webapp.apps.accounts.registration.backends.simple.urls')),
)

Example #4
0
"""


@login_manager.user_loader
def get_user(ident):
    return User.query.get(int(ident))


app.add_url_rule('/login', view_func=Login.as_view('login'))
app.add_url_rule('/logout', view_func=Logout.as_view('logout'))

app.add_url_rule('/register', view_func=Register.as_view('register'))
app.add_url_rule('/admin', view_func=Admin.as_view('admin'))
app.add_url_rule('/test', view_func=Test.as_view('test'))

app.add_url_rule('/', view_func=Index.as_view('index'))
app.add_url_rule('/viewtab', view_func=Viewtab.as_view('viewtab'))
app.add_url_rule('/worktab', view_func=Worktab.as_view('worktab'))

app.add_url_rule('/dev/upload',
                 view_func=UploadTemplate.as_view('upload_template'))

app.add_url_rule('/board/all_posts', view_func=MainBoard.as_view('main_board'))
app.add_url_rule('/board/post', view_func=ViewPost.as_view('view_post'))

app.add_url_rule('/user/profile/<username>',
                 view_func=UserProfile.as_view('user_profile'))

from api import (
    ApiGetTemplate,
    ApiAllPosts,
Example #5
0
from django.conf.urls import patterns, url

from views import (
    Index, BikeDashboard, checkout, checkin, Emails, Payments, Particulars
)

urlpatterns = patterns(
    '',
    (r'^$', Index.as_view()),
    url(r'^checkouts/$', BikeDashboard.as_view(), name="bike dashboard"),
    url(r'^payments/$', Payments.as_view(), name="payments"),
    url(r'^emails/$', Emails.as_view(), name="emails"),
    (r'checkout/$', checkout),
    (r'checkin/$', checkin),
    (r'particulars/$', Particulars.as_view()),
)
Example #6
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required as login
from django.contrib.admin.views.decorators import staff_member_required as staff

from views import Index, StatusMessage, Config

urlpatterns = patterns('', 
    url(r'^config$',
        login(staff(Config.as_view(), login_url='login')), 
            name='console_config_listing'),
    url(r'^config/(?P<key>.+)',
        login(staff(Config.as_view(), login_url='login')), 
            name='console_config'),
    url(r'^statusmsg',
        login(staff(StatusMessage.as_view(), login_url='login')), 
            name='console_statusmsg'),
    url(r'^$',
        login(staff(Index.as_view(), login_url='login')), 
            name='console_index')
    )
Example #7
0
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from views import Index, StatusMessage

urlpatterns = patterns('', 
    url(r'^statusmsg',
        login_required(StatusMessage.as_view()), name='statusmsg'),
    url(r'^$',
        login_required(Index.as_view()), name='consoleindex')
    )
Example #8
0
from django.conf.urls.defaults import patterns, include, url
from django.contrib.auth.decorators import login_required, permission_required
from django.conf import settings
from django.views.generic.simple import redirect_to

# Base URL patterns for AppName
from views import Index, ModelNameDetail, ModelNameCreate, ModelNameUpdate, ModelNameDelete
urlpatterns = patterns('',
	url(r'add/$', ModelNameCreate.as_view(), name='modelname_add'),
	url(r'(?P<pk>\d+)/edit/$', ModelNameUpdate.as_view(), name='modelname_update'),
	url(r'(?P<pk>\d+)/delete/$', ModelNameDelete.as_view(), name='modelname_delete'),
	url(r'^(?P<slug>[-\w]+)/$', ModelNameDetail.as_view(), name='modelname_detail'),
	url(r"^$", Index.as_view(),  name="modelname_index"),
)
Example #9
0
from django.core.urlresolvers import reverse
from django.views.generic import ListView, DetailView, TemplateView, CreateView

__author__ = 'derya'

from django.conf.urls import patterns, url
from django.template.defaultfilters import register
from django.views.decorators.http import require_http_methods, require_POST, require_GET
from django.views.decorators.cache import cache_page

from views import Index, HauntedLocationSearch, HauntedLocationDetail, AboutUs, HowItWorks, TestView, HauntedEpisodeGuide
from models import Newsletter, Comment

urlpatterns = patterns('',


    url(r'^$', cache_page(60 * 1)(Index.as_view()), name="HauntedIndex"),
    url(r'^detail/(?P<slug>[-\w\d]+),(?P<pk>\d+)$', cache_page(60 * 1)(HauntedLocationDetail.as_view()), name='HauntedLocationDetail'),
    url(r'^about_us$',AboutUs.as_view(), name='AboutUs'),
    url(r'^how_it_works$',HowItWorks.as_view(), name='HowItWorks'),
    url(r'^test$',TestView.as_view(), name='test'),
    url(r'^episode_guide',cache_page(60 * 1)(HauntedEpisodeGuide.as_view()), name='HauntedEpisodeGuide'),
    #GET Form returns
    url(r'^search$',HauntedLocationSearch.as_view(), name='HauntedLocationSearch'),
    #POST Form returns
    url(r'^newsletter$',require_POST(CreateView.as_view(model=Newsletter, success_url="/website/", template_name="website/partial/_dummy.html")), name='NewsletterView' ),
    url(r'^comment$',CreateView.as_view(model=Comment, success_url="/website/",template_name="website/partial/_dummy.html"), name='CommentView' ),


)
Example #10
0
from views import Index, Search, Contacts

routes = {'/': Index(), '/search/': Search(), '/contacts/': Contacts()}
Example #11
0
from django.conf.urls import url
from views import Index

urlpatterns = [url(r'^$', Index.as_view())]
Example #12
0
from datetime import date

from views import Index, About, Contacts

# список маршрутов
routes = {'/': Index(), '/about/': About(), '/contacts/': Contacts()}


# front controller
def secret_front(request):
    request['data'] = date.today()


def other_front(request):
    request['key'] = 'key'


fronts = [secret_front, other_front]
from datetime import date
from views import Index, Blog


# front controller
def secret_front(request):
    request['data'] = date.today()


def other_front(request):
    request['key'] = 'key'


front = [secret_front, other_front]

routes = {'/': Index(), '/blog/': Blog()}
Example #14
0
from django.conf.urls import patterns, url, include
from django.http import HttpResponse
from views import Index

urlpatterns = patterns(
    '',
    url(
        r'^favicon\.ico/?$', lambda request: HttpResponse(
            'AAABAAEAEBACAAEAAQCwAAAAFgAAACgAAAAQAAAAIAAAAAEAAQAAAAAAAAAA'
            'AAAAAAAAAAAAAAAAAAAAAAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
            'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
            content_type='image/x-icon')),
    url(r'^$', Index.as_view()),
    url(r'^', include('cms.urls')),
)
from views import Index, CategoryList, CourseList, CreateCourse, CreateUser, CreateCoursePost, CreateCategory, \
 CreateCategoryPost, CreateUserPost, UserList, SelectedUser, SelectedUserPost, AttachUserCourse, RemoveUserCourse,\
 RemoveCourse, RemoveCaregory, RemoveUser

routes = {
    '/': Index(),
    '/course-list/': CourseList(),
    '/category-list/': CategoryList(),
    '/user-list/': UserList(),
    '/create-course/': CreateCourse(),
    '/create-category/': CreateCategory(),
    '/create-user/': CreateUser(),
    '/selected_user/': SelectedUser(),
    '/attach-user-course/': AttachUserCourse(),
    '/remove-user-course/': RemoveUserCourse(),
    '/remove-category/': RemoveCaregory(),
    '/remove-course/': RemoveCourse(),
    '/remove-user/': RemoveUser(),
}

routes_post = {
    '/create-course/': CreateCoursePost(),
    '/create-category/': CreateCategoryPost(),
    '/create-user/': CreateUserPost(),
    '/selected_user/': SelectedUserPost(),
}
Example #16
0
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from views import RegisterListener, StudyGroupList, StudyGroupDetail,\
    OrganizationList, StudyGroupListenersList, ListenerAddBatch,\
    ListenerList, OrganizationDetail, Index, StudyGroupClose, ListenerAttestation, StudyGroupCompleteEnroll, RemoveListener


urlpatterns = patterns('',
    url(r'^d(?P<department_id>\d{1,5})/$', Index.as_view(), name='index'),

    url(r'^d(?P<department_id>\d{1,5})/groups/$', StudyGroupList.as_view(), name='studygroup_list'),
    url(r'^d(?P<department_id>\d{1,5})/listeners/$', ListenerList.as_view(), name='listener_list'),
    url(r'^d(?P<department_id>\d{1,5})/organizations/$', OrganizationList.as_view(),
        name='organization_list'),

    # studygroup-related  urls

    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/$', StudyGroupDetail.as_view(),
        name='studygroup_detail'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/complete/$', StudyGroupCompleteEnroll.as_view(),
        name='studygroup_complete'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/close/$', StudyGroupClose.as_view(),
        name='studygroup_close'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/listeners/$',
        StudyGroupListenersList.as_view(), name='studygroup_listeners_list'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/listeners/add/$',
        ListenerAddBatch.as_view(), name='studygroup_listener_add'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/listeners/remove/(?P<vizit_id>\d{1,5})/$',
        RemoveListener.as_view(), name='studygroup_listener_remove'),
    url(r'^d(?P<department_id>\d{1,5})/group/(?P<studygroup_pk>\d{1,5})/listeners/attestation/$',
        ListenerAttestation.as_view(),
Example #17
0
from django.conf.urls import url, include

from views import Index
from blog import urls as blog_urls


urlpatterns = [

    url(r'^news/', include(blog_urls, namespace='blog')),

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

url(r'^clients/', include('apps.clients.urls', 'clients')),
url(r'^factories/', include('apps.factories.urls', 'factories')),
url(r'^feeds/', include('apps.feeds.urls', 'feeds')),
url(r'^products/', include('apps.products.urls', 'products')),
url(r'^resources/', include('apps.resources.urls', 'resources')),
'''
Example #18
0
"""memorial URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.9/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 include, url
from django.contrib import admin
from views import Index

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', Index.as_view(), name='home'),
    url(r'^photos/', include('photos.urls'))
]