Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. from __future__ import unicode_literals
  2.  
  3. from django.conf.urls import patterns, include, url
  4. from django.conf.urls.i18n import i18n_patterns
  5. from django.contrib import admin
  6.  
  7. from mezzanine.core.views import direct_to_template
  8.  
  9.  
  10. admin.autodiscover()
  11.  
  12. # Add the urlpatterns for any custom Django applications here.
  13. # You can also change the ``home`` view to add your own functionality
  14. # to the project's homepage.
  15.  
  16. urlpatterns = i18n_patterns("",
  17. # Change the admin prefix here to use an alternate URL for the
  18. # admin interface, which would be marginally more secure.
  19. ("^admin/", include(admin.site.urls)),
  20. ("^archive/", include('archive.urls', namespace='archive'))
  21.  
  22. )
  23.  
  24. urlpatterns += patterns('',
  25.  
  26. # We don't want to presume how your homepage works, so here are a
  27. # few patterns you can use to set it up.
  28.  
  29. # HOMEPAGE AS STATIC TEMPLATE
  30. # ---------------------------
  31. # This pattern simply loads the index.html template. It isn't
  32. # commented out like the others, so it's the default. You only need
  33. # one homepage pattern, so if you use a different one, comment this
  34. # one out.
  35.  
  36. url("^$", direct_to_template, {"template": "index.html"}, name="home"),
  37.  
  38. # HOMEPAGE AS AN EDITABLE PAGE IN THE PAGE TREE
  39. # ---------------------------------------------
  40. # This pattern gives us a normal ``Page`` object, so that your
  41. # homepage can be managed via the page tree in the admin. If you
  42. # use this pattern, you'll need to create a page in the page tree,
  43. # and specify its URL (in the Meta Data section) as "/", which
  44. # is the value used below in the ``{"slug": "/"}`` part.
  45. # Also note that the normal rule of adding a custom
  46. # template per page with the template name using the page's slug
  47. # doesn't apply here, since we can't have a template called
  48. # "/.html" - so for this case, the template "pages/index.html"
  49. # should be used if you want to customize the homepage's template.
  50.  
  51. # url("^$", "mezzanine.pages.views.page", {"slug": "/"}, name="home"),
  52.  
  53. # HOMEPAGE FOR A BLOG-ONLY SITE
  54. # -----------------------------
  55. # This pattern points the homepage to the blog post listing page,
  56. # and is useful for sites that are primarily blogs. If you use this
  57. # pattern, you'll also need to set BLOG_SLUG = "" in your
  58. # ``settings.py`` module, and delete the blog page object from the
  59. # page tree in the admin if it was installed.
  60.  
  61. # url("^$", "mezzanine.blog.views.blog_post_list", name="home"),
  62.  
  63. # MEZZANINE'S URLS
  64. # ----------------
  65. # ADD YOUR OWN URLPATTERNS *ABOVE* THE LINE BELOW.
  66. # ``mezzanine.urls`` INCLUDES A *CATCH ALL* PATTERN
  67. # FOR PAGES, SO URLPATTERNS ADDED BELOW ``mezzanine.urls``
  68. # WILL NEVER BE MATCHED!
  69.  
  70. # If you'd like more granular control over the patterns in
  71. # ``mezzanine.urls``, go right ahead and take the parts you want
  72. # from it, and use them directly below instead of using
  73. # ``mezzanine.urls``.
  74. ("^", include("mezzanine.urls")),
  75.  
  76. # MOUNTING MEZZANINE UNDER A PREFIX
  77. # ---------------------------------
  78. # You can also mount all of Mezzanine's urlpatterns under a
  79. # URL prefix if desired. When doing this, you need to define the
  80. # ``SITE_PREFIX`` setting, which will contain the prefix. Eg:
  81. # SITE_PREFIX = "my/site/prefix"
  82. # For convenience, and to avoid repeating the prefix, use the
  83. # commented out pattern below (commenting out the one above of course)
  84. # which will make use of the ``SITE_PREFIX`` setting. Make sure to
  85. # add the import ``from django.conf import settings`` to the top
  86. # of this file as well.
  87. # Note that for any of the various homepage patterns above, you'll
  88. # need to use the ``SITE_PREFIX`` setting as well.
  89.  
  90. # ("^%s/" % settings.SITE_PREFIX, include("mezzanine.urls"))
  91.  
  92.  
  93.  
  94. )
  95.  
  96. # Adds ``STATIC_URL`` to the context of error pages, so that error
  97. # pages can use JS, CSS and images.
  98. handler404 = "mezzanine.core.views.page_not_found"
  99. handler500 = "mezzanine.core.views.server_error"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement