Exemplo n.º 1
0
from django.views.generic import TemplateView
from django.contrib import admin
from {{ project_name }}.views import HomePageView, ContactPageView, RobotPageView, HumanPageView
from {{ project_name }}.sitemap import BlogSitemap, HardCodedSitemap

admin.autodiscover()

sitemaps = {
    'blog': BlogSitemap,
    'hardcodedpages': HardCodedSitemap,
}

urlpatterns = patterns('',
    url(
        regex=r"^$",
        view=HomePageView.as_view(),
        name="homepage",
    ),
    url(
        regex=r"^contact/$",
        view=ContactPageView.as_view(),
        name="contactpage",
    ),
    url(
        regex=r"^robots\.txt$",
        view=RobotPageView.as_view(),
        name="robots",
    ),
    url(
        regex=r"^humans\.txt$",
        view=HumanPageView.as_view(),
Exemplo n.º 2
0
from django.conf import settings
from django.conf.urls import include, url
from django.urls import path
from django.contrib import admin

from {{ cookiecutter.package_name }}.views import HomePageView


urlpatterns = [
    # Examples:
    path('', HomePageView.as_view(), name='home'),
    # path('blog/', include('blog.urls')),

    path('admin/rq/', include('django_rq.urls')),
    path('admin/', admin.site.urls),
]

if settings.DEBUG:
    import debug_toolbar
    from django.conf.urls.static import static

    urlpatterns = [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + \
        urlpatterns
Exemplo n.º 3
0
from django.conf.urls import include, url
from django.contrib import admin

from {{ cookiecutter.package_name }}.views import HomePageView

urlpatterns = [
    # Examples:
    url(r'^$', HomePageView.as_view(), name='home'),
    # url(r'^blog/', include('blog.urls')),

    {% if cookiecutter.use_rq == "y" -%}
    url(r'^admin/rq/', include('django_rq.urls')),
    {%- endif %}

    url(r'^admin/', include(admin.site.urls)),
]