Exemple #1
0
    def test_basic_rss_feed(self):
        blog = BlogPage.objects.first()
        basic_rss_feed = BasicFeed()

        self.assertEqual(basic_rss_feed.item_title(blog), blog.title)
        self.assertEqual(basic_rss_feed.item_pubdate(blog).date(), blog.date)
        self.assertEqual(basic_rss_feed.item_link(blog), blog.full_url)
    def test_basic_rss_feed(self):
        blog = BlogPage.objects.first()
        basic_rss_feed = BasicFeed()

        self.assertEqual(
            basic_rss_feed.item_title(blog),
            blog.title
        )
        self.assertEqual(
            basic_rss_feed.item_pubdate(blog).date(),
            blog.date
        )
        self.assertEqual(
            basic_rss_feed.item_link(blog),
            blog.full_url
        )
Exemple #3
0
urlpatterns = [
    url(r'^django-admin/', admin.site.urls),
    url(r'^admin/', include(wagtailadmin_urls)),
    url(r'^documents/', include(wagtaildocs_urls)),
    url(r'^search/$', search_views.search, name='search'),

    # For anything not caught by a more specific rule above, hand over to
    # Wagtail's page serving mechanism. This should be the last pattern in
    # the list:
    url(r'', include(wagtail_urls)),

    # Alternatively, if you want Wagtail pages to be served from a subpath
    # of your site, rather than the site root:
    #    url(r'^pages/', include(wagtail_urls)),
    url(r'^feed-basic.xml$', BasicFeed(), name='basic_feed'),
    url(r'^feed.xml$', ExtendedFeed(), name='extended_feed'),

    # # JSON feed
    # url(r'^blog/feed-basic.json$', BasicJsonFeed(), name='basic_json_feed'),
    # url(r'^blog/feed.json$', ExtendedJsonFeed(), name='extended_json_feed'),
]

if settings.DEBUG:
    from django.conf.urls.static import static
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns

    # Serve static and media files from development server
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
from wagtail.wagtailsearch import urls as wagtailsearch_urls
from wagtail.wagtaildocs import urls as wagtaildocs_urls
from wagtail.wagtailcore import urls as wagtail_urls
from wagtail.contrib.wagtailsitemaps.views import sitemap

from wagtail_feeds.feeds import BasicFeed, ExtendedFeed

admin.autodiscover()

urlpatterns = [
    url(r'^django-admin/', include(admin.site.urls)),
    url(r'^admin/', include(wagtailadmin_urls)),
    url(r'^search/', include(wagtailsearch_urls)),
    url(r'^documents/', include(wagtaildocs_urls)),
    url('^sitemap\.xml$', sitemap),
    url(r'^blog/feed/basic$', BasicFeed(), name='basic_feed'),
    url(r'^blog/feed/extended$', ExtendedFeed(), name='extended_feed'),

    # For anything not caught by a more specific rule above, hand over to
    # Wagtail's serving mechanism
    url(r'', include(wagtail_urls)),
]

if settings.DEBUG:
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
    from django.views.generic.base import RedirectView

    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += [
Exemple #5
0
from django.contrib import admin

from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail_feeds.feeds import BasicFeed

from search import views as search_views

urlpatterns = [
    #    url(r'^django-admin/', include(admin.site.urls)),
    #    url(r'^django-admin/', admin.site.urls),
    url(r'^admin/', include(wagtailadmin_urls)),
    url(r'^documents/', include(wagtaildocs_urls)),
    url(r'^search/$', search_views.search, name='search'),
    url(r'^rss$', BasicFeed(), name='basic_feed'),

    # For anything not caught by a more specific rule above, hand over to
    # Wagtail's page serving mechanism. This should be the last pattern in
    # the list:
    url(r'', include(wagtail_urls)),

    # Alternatively, if you want Wagtail pages to be served from a subpath
    # of your site, rather than the site root:
    #    url(r'^pages/', include(wagtail_urls)),
]

if settings.DEBUG:
    from django.conf.urls.static import static
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns
Exemple #6
0
    path("",
         TemplateView.as_view(template_name="pages/home.html"),
         name="home"),
    path("about/",
         TemplateView.as_view(template_name="pages/about.html"),
         name="about"),
    path(settings.ADMIN_URL, admin.site.urls),
    path('admin/', include(wagtailadmin_urls)),

    # User management
    path("users/", include("website_django.users.urls", namespace="users")),
    path("accounts/", include("allauth.urls")),
    path('search/', search_views.search, name='search'),
    path('documents/', include(wagtaildocs_urls)),
    path('sitemap.xml', sitemap),
    path('blog/feed/basic/', BasicFeed(), name='basic_feed'),
    path('blog/feed/extended/', ExtendedFeed(), name='extended_feed'),
    path('privacy-policy/',
         TemplateView.as_view(template_name='pages/privacy.html'),
         name='privacy'),
    path('terms-of-service/',
         TemplateView.as_view(template_name='pages/terms.html'),
         name='terms'),
    path(r'^images/([^/]*)/(\d*)/([^/]*)/[^/]*$',
         ServeView.as_view(),
         name='wagtailimages_serve'),
    # For anything not caught by a more specific rule above, hand over to
    # Wagtail's serving mechanism
    path('', include(wagtail_urls)),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemple #7
0
        name="about",
    ),
    # Django Admin, use {% url 'admin:index' %}
    path(settings.ADMIN_URL, admin.site.urls),
    # User management
    path(
        "users/",
        include("the_index.users.urls", namespace="users"),
    ),
    path("accounts/", include("allauth.urls")),

    # Wagtail
    re_path(r'^edit/', include(wagtailadmin_urls)),
    re_path(r'^search/$', search_views.search, name='search'),
    re_path(r'^documents/', include(wagtaildocs_urls)),
    re_path(r'^news/feed/basic$', BasicFeed(), name='basic_feed'),
    re_path(r'^news/feed/extended$', ExtendedFeed(), name='extended_feed'),
    re_path(r'^news/feed/basic.json$', BasicJsonFeed(),
            name='basic_json_feed'),
    re_path(r'^news/feed/extended.json$',
            ExtendedJsonFeed(),
            name='extended_json_feed'),
    re_path(r'^images/([^/]*)/(\d*)/([^/]*)/[^/]*$',
            ServeView.as_view(),
            name='wagtailimages_serve'),
    re_path(r'^pages/', include(wagtail_urls)),

    # Optional URL for including your own vanilla Django urls/views
    # re_path(r'', include('myapp.urls')),

    # For anything not caught by a more specific rule above, hand over to
Exemple #8
0
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail_resume import urls as resume_urls

from search import views as search_views

urlpatterns = [
    path("django-admin/", admin.site.urls),
    path("admin/", include(wagtailadmin_urls)),
    path("documents/", include(wagtaildocs_urls)),
    path("search/", search_views.search, name="search"),
    path("resume/", include(resume_urls)),
]
from wagtail_feeds.feeds import BasicFeed, BasicJsonFeed, ExtendedFeed, ExtendedJsonFeed

url(r"^blog/feed/basic$", BasicFeed(), name="basic_feed"),
url(r"^blog/feed/extended$", ExtendedFeed(), name="extended_feed"),

# JSON feed
url(r"^blog/feed/basic.json$", BasicJsonFeed(), name="basic_json_feed"),
url(r"^blog/feed/extended.json$", ExtendedJsonFeed(), name="extended_json_feed"),


if settings.DEBUG:
    from django.conf.urls.static import static
    from django.contrib.staticfiles.urls import staticfiles_urlpatterns

    # Serve static and media files from development server
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)