Пример #1
0
    (r'^noppa/$',
                Noppa.as_view()),
    (r'^noppa/(?P<faculty>@?[-+_\w\.]+)/$',
                Noppa.as_view()),
    (r'^noppa/(?P<faculty>@?[-+_\w\.]+)/(?P<department>@?[-+_\w]+)/$',
                Noppa.as_view()),
    (r'^noppa/(?P<faculty>@?[-+_\w\.]+)/(?P<department>@?[-+_\w]+)/(?P<course>@?[-+_\.\w]+)/$',
                Noppa.as_view()),
    
    (r'^node/(?P<course>@?[-+_\w\.]+)/$',
                Node.as_view()),
    
    (r'^auth/$',
                Auth.as_view()),
    
    (r'^search/(?P<search_string>.+)$',
                Search.as_view()),
    
    (r'^$',
                Webapp.as_view()),
    

    # 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)),
    # url(r'^noppa/', include('noppa.urls')),
)

Пример #2
0
from django.conf.urls import (patterns, include, url)
from django.contrib import admin
from views import (Index, UserProfile, Profile, 
	PostTweet, Search, HashTagCloud, MostFollowedUser)

admin.autodiscover()

urlpatterns = patterns('',
	url(r'^$',Index.as_view()),
	url(r'^user/(\w+)/$', UserProfile.as_view()),
	url(r'^user/(\w+)/profile/$', Profile.as_view()),
	url(r'^user/(\w+)/post/$', PostTweet.as_view()),
	url(r'^hashTag/(\w+)/$', HashTagCloud.as_view()),
	url(r'^search/$', Search.as_view()),
	url(r'^user/followers/view$', MostFollowedUser.as_view()),

)
Пример #3
0
# -*- coding: utf-8 -*-
__author__ = 'fengxiao'
__date__ = '2017/2/18 14:23'

from django.conf.urls import url

from views import ArtHome, Columns, Tag, Art, About, Friend, Search, ColumnArticle

urlpatterns = [
    url(r'^Home/$', ArtHome.as_view(), name='index'),
    url(r'^Column/$', Columns.as_view(), name='column'),
    url(r'^ColArticle/(?P<cId>\d+)/$',
        ColumnArticle.as_view(),
        name='colArticle'),
    url(r'^Tags/$', Tag.as_view(), name='tag'),
    url(r'^Article/(?P<art_id>\d+)/$', Art.as_view(), name='art'),
    url(r'^About/$', About.as_view(), name='about'),
    url(r'^Friends/$', Friend.as_view(), name='friends'),
    url(r'^Search/$', Search.as_view(), name='search'),
]
Пример #4
0
from views import Index, Search, Contacts

routes = {'/': Index(), '/search/': Search(), '/contacts/': Contacts()}
Пример #5
0
from views import BookView, AuthorView
from views import BookAPI, AuthorAPI
from views import RunTests, Search
from views import CocktailIngredients

blueprint = Blueprint('idb', __name__, template_folder='templates')


blueprint.add_url_rule('/', view_func=IndexView.as_view('Home'))
blueprint.add_url_rule('/about', view_func=AboutView.as_view('About'))
blueprint.add_url_rule('/books', view_func=BooksView.as_view('Books'))
blueprint.add_url_rule('/authors', view_func=AuthorsView.as_view('Authors'))
blueprint.add_url_rule(
    '/author/<author_id>', view_func=AuthorView.as_view('Author'))
blueprint.add_url_rule('/book/<book_id>', view_func=BookView.as_view('Book'))
blueprint.add_url_rule(
    '/api/books/', defaults={'book_id': None},
    view_func=BookAPI.as_view('BooksAPI'))
blueprint.add_url_rule(
    '/api/books/<book_id>', view_func=BookAPI.as_view('BookAPI'))
blueprint.add_url_rule(
    '/api/authors/', defaults={'author_id': None},
    view_func=AuthorAPI.as_view('AuthorsAPI'))
blueprint.add_url_rule(
    '/api/authors/<author_id>', view_func=AuthorAPI.as_view('AuthorAPI'))
blueprint.add_url_rule('/tests', view_func=RunTests.as_view('RunTests'))
blueprint.add_url_rule(
    '/search/<search_string>', view_func=Search.as_view('Search'))
blueprint.add_url_rule(
    '/CocktailIngredients', view_func=CocktailIngredients.as_view('CocktailIngredients'))