当前位置: 首页>>代码示例>>Python>>正文


Python HomeView.as_view方法代码示例

本文整理汇总了Python中views.HomeView.as_view方法的典型用法代码示例。如果您正苦于以下问题:Python HomeView.as_view方法的具体用法?Python HomeView.as_view怎么用?Python HomeView.as_view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在views.HomeView的用法示例。


在下文中一共展示了HomeView.as_view方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _register_defaults

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
    def _register_defaults(self):
        """
        Registers some meta data about the Extension developers and gives the '/api' route a nice index of all
        registered blueprints.

        """
        self.app.add_url_rule("%s/" % MongoAPI.API_PREFIX, view_func=HomeView.as_view('home_page', app=self.app))
        self.app.add_url_rule("%s/" % MongoAPI.ABOUT, view_func=AboutView.as_view('about_page', app=self.app))
开发者ID:vivelohoy,项目名称:flask-mongorest,代码行数:10,代码来源:flask_mongorest.py

示例2: Api

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView

from django.contrib import admin

from views import HomeView

from tastypie.api import Api
from qa.api import QAResource

v1_api = Api(api_name='v1')
v1_api.register(QAResource())


urlpatterns = patterns("",
    url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"),
    url(r'^home/$', HomeView.as_view(), name='myHome'),
    url(r"^base/", TemplateView.as_view(template_name="base.html"), name="base"),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^account/", include("account.urls")),
    url(r"^api/", include(v1_api.urls)),
)

urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
开发者ID:stormhouse,项目名称:conext,代码行数:28,代码来源:urls.py

示例3: url

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import url, include
from django.contrib.auth.decorators import login_required

from . import views
from views import HomeView

urlpatterns = [
            url(r'^$', views.index, name='index'),
            url(r'^profile/$', login_required(HomeView.as_view(), redirect_field_name=None)),
            url(r'^login/$', views.login, name='user_login'),
            url(r'^logout/$', views.logout, name='user_logout'),
            url('', include("social.apps.django_app.urls", namespace='social')),
            ]
开发者ID:eve-online-api-challenge,项目名称:WHturk,代码行数:15,代码来源:urls.py

示例4: url

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import url

from views import HomeView

urlpatterns = [
    url(r'^$', HomeView.as_view(), name='home')
]
开发者ID:yoelfme,项目名称:todo-django-docker-compose,代码行数:9,代码来源:urls.py

示例5: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import patterns, include, url
from views import HomeView, CreateSuccess, ViewLicense

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', HomeView.as_view()),
    url(r'^(?P<short_url>\w{6})/$', ViewLicense.as_view(), name='view_license'),
    url(r'^success/(?P<short_url>\w{6})/$', CreateSuccess.as_view(), name='create_success'),
    url(r'^admin/', include(admin.site.urls)),
)
开发者ID:diopib,项目名称:licenselink,代码行数:14,代码来源:urls.py

示例6: url

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
# -*- coding: utf-8 -*-
from django.conf.urls import url
from views import HomeView, PostDetailView, BlogsListView, BlogDetailView, CreatePostView


urlpatterns = [
    # Posts URLs
    url(r'^$', HomeView.as_view(), name='blogs_home'),
    url(r'^blogs/$', BlogsListView.as_view(), name='blogs_list'),
    url(r'^blogs/(?P<username>[\w-]+)$', BlogDetailView.as_view(), name='blog_detail'),
    url(r'^blogs/(?P<username>[\w-]+)/(?P<pk>[0-9]+)$', PostDetailView.as_view(), name='post_detail'),
    url(r'^new-post/$', CreatePostView.as_view(), name='create_post')

]
开发者ID:TimpleSoft,项目名称:Wordplease,代码行数:16,代码来源:urls.py

示例7: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf import settings
from django.conf.urls import patterns, url, include
from django.contrib import admin
from django.views.generic import TemplateView

from views import HomeView, ResumeView, BioView, ContactView

admin.autodiscover()
urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name='index'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^blog/', include('apps.blog.urls')),
    url(r'^portfolio/', include('apps.portfolio.urls')),
    url(r'^bio/$', BioView.as_view(), name='bio'),
    url(r'^resume/$', ResumeView.as_view(), name='resume'),
    url(r'^contact/$', ContactView.as_view(), name='contact'),
    url(r'^robots\.txt$', TemplateView.as_view(template_name='robots.txt', content_type='text/plain')),
)

if not settings.PRODUCTION:
    urlpatterns += patterns('', (r'^files/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), )
开发者ID:cjmaynar,项目名称:coreymaynard,代码行数:23,代码来源:urls.py

示例8: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static

from views import auth_tagpro, deauth_tagpro, set_flair, refresh_flair, HomeView

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name="home"),
    url(r'^tp_auth/$', auth_tagpro, name="auth_tagpro"),
    url(r'^tp_logout/$', deauth_tagpro, name="deauth_tagpro"),
    url(r'^set_flair/$', set_flair, name="set_flair"),
    url(r'^refresh_flair/$', refresh_flair, name="refresh_flair"),
    url('', include('social.apps.django_app.urls', namespace='social')),
)

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
开发者ID:GenesisTP,项目名称:tagpro-flair-bot-django,代码行数:21,代码来源:urls.py

示例9: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
# -*- encoding: utf-8 -*-
"""Defines all urls conf."""
from django.conf.urls import patterns, url
from django.contrib.auth.views import login, logout
from django.contrib.auth.decorators import login_required
from views import HomeView, CommentView, RateUsView, ThanksView, VoteView, SaveVoteView, GraphicsView, ResultView

urlpatterns = patterns('',
	url(r'^login/$', login, { 'template_name': 'vote/login.html' }),
	url(r'^logout/$', logout, { 'template_name': 'vote/logout.html' }),
	url(r'^$', login_required(HomeView.as_view()), name='vote-home'),
	url(r'^comment/$', CommentView.as_view(), name='vote-comment'),
	url(r'^rateus/$', RateUsView.as_view(), name='vote-rate-us'),
	url(r'^thanks/$', ThanksView.as_view(), name='vote-thanks'),
	url(r'^search/$', login_required(VoteView.as_view()), name='vote-vote'),
	url(r'^vote/$', login_required(SaveVoteView.as_view()), name='vote-savevote'),
	url(r'^graphics/$', login_required(GraphicsView.as_view()), name='vote-graphics'),
	url(r'^result/$', login_required(ResultView.as_view()), name='vote-result'),
)
开发者ID:dairdr,项目名称:voteapp,代码行数:21,代码来源:urls.py

示例10: url

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
                  AchievementDetail, OwnedAchievementDetail, HomeView

from views import PlayerCreate, GameCreate, OwnedGamePlayerCreate, OwnedGameGameCreate, \
                  AchievementCreate, OwnAchPlayerCreate, OwnAchAchCreate, AchievementGameCreate, \
                  GameReviewCreate

from views import LoginRequiredCheckIsOwnerUpdateView, LoginRequiredCheckIsOwnerDeleteView

from views import APIPlayerList,APIPlayerDetail,APIGameList,APIGameDetail, \
                  APIAchievementList,APIAchievementDetail,APIOwnedGameDetail,\
                  APIOwnedAchievementDetail

urlpatterns = [
    # Home page
    url(r'^$',
        HomeView.as_view(template_name='steamapp/home.html'),
        name = 'home'),

    #Login
     url(r'^login/$',
        login,
        name='login'),

    #Logout
    url(r'^logout/$',
        logout,
        name='logout',
        kwargs={'next_page': '/'}),

    # List Players: /steamapp/player.json
    url(r'^players(\.(?P<extension>(json|xml)))?$',
开发者ID:csanahuja,项目名称:Projecte-SITW-STEAM,代码行数:33,代码来源:urls.py

示例11: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls.static import static
from django.views.generic import TemplateView
from django.contrib.sitemaps.views import sitemap
from views import HomeView
from sitemaps import StaticSitemap, NewsSitemap, EventsSitemap

from django.contrib import admin
admin.autodiscover()

sitemaps = {'static': StaticSitemap,
            'news': NewsSitemap,
            'events': EventsSitemap}

urlpatterns = patterns('',
    url(r'^$',
        HomeView.as_view(template_name='pages/home.html'),
        name="home"),

    # sitemap
    url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},
        name='django.contrib.sitemaps.views.sitemap'),

    # about page
    url(r'^about/$',
        TemplateView.as_view(template_name='pages/about.html'),
        name="about"),

    # flat pages
    # url(r'^pages/', include('django.contrib.flatpages.urls')),
    url(r'^pages/', include('pages.urls', namespace='pages')),
开发者ID:mooja,项目名称:ssip209,代码行数:32,代码来源:urls.py

示例12: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import patterns, include, url
from views import HomeView, Profile

urlpatterns = patterns('',
    url(r'^$', HomeView.as_view(), name='reportes'),
    url(r'^perfil/(?P<id>\d+)/$', Profile.as_view(), name='profile'),
) 
开发者ID:eliezerfot123,项目名称:SRH,代码行数:9,代码来源:urls.py

示例13: url

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import include, url

from views import HomeView

urlpatterns = [
    url(r'^$', HomeView.as_view(), name='reader'),
    url(r'api/', include('reader.apis')),
]
开发者ID:coderek,项目名称:my_django,代码行数:10,代码来源:urls.py

示例14: RegexConverter

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
# Adds functions to be available in the jinja env
app.jinja_env.globals.update(strip_alnum=utils.remove_special_characters)


class RegexConverter(BaseConverter):

    '''Sets up regex to be used in the add_url_rule '''

    def __init__(self, url_map, *items):
        super(RegexConverter, self).__init__(url_map)
        self.regex = items[0]

app.url_map.converters['regex'] = RegexConverter


app.add_url_rule("/", view_func=HomeView.as_view('home_view'))
app.add_url_rule("/json", view_func=HomeView.as_view('home_json'))
app.add_url_rule("/xml", view_func=HomeView.as_view('home_xml'))
# /category
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()),
                 view_func=CategoryView.as_view('category_view'))
app.add_url_rule(
    '/<regex("{}"):category>/json'.format(
        utils.get_cat_regex()),
    view_func=CategoryView.as_view('category_json'))
app.add_url_rule(
    '/<regex("{}"):category>/xml'.format(
        utils.get_cat_regex()),
    view_func=CategoryView.as_view('category_xml'))
# /category/item_id
app.add_url_rule('/<regex("{}"):category>'.format(utils.get_cat_regex()) +
开发者ID:robertavram,项目名称:Linux-Server-Configuration,代码行数:33,代码来源:application.py

示例15: patterns

# 需要导入模块: from views import HomeView [as 别名]
# 或者: from views.HomeView import as_view [as 别名]
from django.conf.urls import patterns, include, url
from views import HomeView
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns(
    "",
    # Examples:
    # url(r'^$', 'ola.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r"^admin/", include(admin.site.urls)),
    (r"^accounts/login", "django.contrib.auth.views.login"),
    (r"^logout", "django.contrib.auth.views.logout_then_login"),
    url(r"^$", HomeView.as_view(), name="home_page"),
    url(r"^subscriber", include("subscriber.urls")),
    url(r"^leave", include("leave.urls")),
)
开发者ID:jkprivatelyingit,项目名称:ola,代码行数:20,代码来源:urls.py


注:本文中的views.HomeView.as_view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。