我正在开发一个 Django Bookmarks 项目,它需要您调用simple.py
from django.views.generic
。但是当我运行我的服务器时,我收到了一个导入错误,他们没有名为simple
. 我查看了文件夹,它不在那里。我查了一些关于这个问题的信息。我通过 git hub 在较新的版本中读到它没有该文件。我无法弄清楚如何解决它。任何帮助将非常感激!
import os
from django.conf.urls import patterns, include, url
from django_bookmarks.bookmarks.views import *
from django.views.generic.simple import direct_to_template
site_media = os.path.join(
os.path.dirname(__file__), 'site_media'
)
urlpatterns = patterns('',
(r'^$', main_page),
(r'^user/(\w+)/$', user_page),
(r'^login/$', 'django.contrib.auth.views.login'),
(r'^logout/$', logout_page),
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': site_media}),
(r'^register/$', register_page),
(r'^register/success/$', direct_to_template,
{'template': 'registration/register_success.html'}),
# Examples:
# url(r'^$', 'django_bookmarks.views.home', name='home'),
# url(r'^django_bookmarks/', include('django_bookmarks.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
# url(r'^admin/', include(admin.site.urls)),
)