• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python views.HomeView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: test_that_the_batch_status_of_a_service_is_cached

    def test_that_the_batch_status_of_a_service_is_cached(self):
        """
        Tests the scenario when there is a response in the caching period
        """
        with MockStatusService(status=200):
            all_status = HomeView.check_bulk_status(
                current_app.config['SYSTEMSGO_FRONT_END_SERVER_LIST']
            )
        for status in all_status:
            self.assertEqual(status['status'], 'online')

        with MockStatusService(status=400):
            all_status = HomeView.check_bulk_status(
                current_app.config['SYSTEMSGO_FRONT_END_SERVER_LIST']
            )
        for status in all_status:
            self.assertEqual(status['status'], 'online')
开发者ID:jonnybazookatone,项目名称:systemsgo,代码行数:17,代码来源:test_webservices.py


示例2: _register_defaults

    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,代码行数:8,代码来源:flask_mongorest.py


示例3: test_batch_statuses

    def test_batch_statuses(self):
        """
        Tests that the staticmethod that tests a bulk set of services
        """
        with MockStatusService(status=200):
            all_status = HomeView.check_bulk_status(
                current_app.config['SYSTEMSGO_FRONT_END_SERVER_LIST']
            )

        for status in all_status:
            self.assertEqual(status['status'], 'online')
开发者ID:jonnybazookatone,项目名称:systemsgo,代码行数:11,代码来源:test_webservices.py


示例4: test_the_status_of_a_service

 def test_the_status_of_a_service(self):
     """
     Tests the staticmethod that tests if a service is available or not
     """
     with MockStatusService(status=200):
         for front_end in current_app.config[
             'SYSTEMSGO_FRONT_END_SERVER_LIST'
         ]:
             status = HomeView.check_status(front_end['url'])
             print status, front_end['url']
             self.assertEqual(status, 'online')
开发者ID:jonnybazookatone,项目名称:systemsgo,代码行数:11,代码来源:test_webservices.py


示例5: homeAction

    def homeAction(self):

        self.pyo = Server(audio="offline", nchnls=1, sr=44100).boot()
        self.pyo.recordOptions(dur=5, filename=None, fileformat=0, sampletype=3)

        self.config = Config()
        root = Tk()
        self.samples = []
        self.sampleCnt = 0
        self.homeView = HomeView(root, self)
        self.effect1 = 'None'
        self.effect2 = 'None'
        self.tempo = 10
        root.mainloop()
开发者ID:Tim-B,项目名称:ENGG4810_PC,代码行数:14,代码来源:HomeController.py


示例6: patterns

from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.decorators.cache import cache_page
from views import HomeView
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^/?$', HomeView.as_view(template_name="index.html"), name='home'),
    url(r'^account/', include('fiora_project.accounts.urls')),

    url(r'^admin/', include(admin.site.urls)),
) + staticfiles_urlpatterns()
开发者ID:spicywhitefish,项目名称:fiora,代码行数:14,代码来源:urls.py


示例7: patterns

# -*- 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,代码行数:19,代码来源:urls.py


示例8: patterns

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,代码行数:19,代码来源:urls.py


示例9: patterns

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,代码行数:18,代码来源:urls.py


示例10: url

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,代码行数:13,代码来源:urls.py


示例11: patterns

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,代码行数:12,代码来源:urls.py


示例12: url

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,代码行数:8,代码来源:urls.py


示例13: RegexConverter

# 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,代码行数:31,代码来源:application.py


示例14: patterns

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,代码行数:21,代码来源:urls.py


示例15: patterns

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,代码行数:7,代码来源:urls.py


示例16: url

# -*- 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,代码行数:14,代码来源:urls.py


示例17: url

                  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,代码行数:31,代码来源:urls.py


示例18: url

from django.conf.urls import url

from views import HomeView

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


示例19: patterns

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,代码行数:30,代码来源:urls.py


示例20: Api

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,代码行数:26,代码来源:urls.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python views.IndexView类代码示例发布时间:2022-05-26
下一篇:
Python views.load_views函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap