當前位置: 首頁>>代碼示例>>Python>>正文


Python views.HomeView類代碼示例

本文整理匯總了Python中views.HomeView的典型用法代碼示例。如果您正苦於以下問題:Python HomeView類的具體用法?Python HomeView怎麽用?Python HomeView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了HomeView類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的views.HomeView類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。