mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-28 02:44:11 +00:00
* Simplify article app, it isn't necessary to save them in db, instead this tool should render static templates directly based in the url. Example: if the url is "/article/today" it will look for the template "articles/today.html" in articles templates directory. This app is configured to handle any url, so it will render an url like "/about" (if there isn't other url defined to handle "about" before article definition), and in this case will try to render the template "article.html" in articles templates dir * Removed models, not necessary now * Removed templatetags, not necessary now * Removed flatpages middleware ?? * Added url to articles app, this will used as a last case to handle undefined urls. --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40136
24 lines
682 B
Python
24 lines
682 B
Python
from django.conf.urls.defaults import *
|
|
from django.views.generic.simple import direct_to_template
|
|
from django.conf import settings
|
|
|
|
|
|
urlpatterns = patterns('',
|
|
(r"^weblog/", include("scrapyorg.blog.urls")),
|
|
|
|
# admin
|
|
(r"^admin/download/downloadlink/", include("scrapyorg.download.urls")),
|
|
(r"^admin/", include("django.contrib.admin.urls")),
|
|
)
|
|
|
|
|
|
if settings.DEBUG: # devel
|
|
urlpatterns += patterns('',
|
|
(r'^%s/(?P<path>.*)$' % settings.MEDIA_URL[1:], 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
|
)
|
|
|
|
# last resort, it's an article
|
|
urlpatterns += patterns('',
|
|
(r"", include("scrapyorg.article.urls")),
|
|
)
|