我刚开始使用Heroku,按照Python教程进行操作时遇到了一个难题。在创建数据库之前,每一步都很简单。执行 heroku run python manage.py migrate
命令后,添加/db
到URL末尾应该能看到数据库,但实际上我却被重定向到了错误页面,显示如下:
TemplateSyntaxError at /db/
'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz
Request Method: GET
Request URL: https://morning-oasis-00207.herokuapp.com/db/
Django Version: 3.0
Exception Type: TemplateSyntaxError
Exception Value:
'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz
Exception Location: /app/.heroku/python/lib/python3.7/site-packages/django/template/defaulttags.py in find_library, line 1025
Python Executable: /app/.heroku/python/bin/python
Python Version: 3.7.3
Python Path:
['/app/.heroku/python/bin',
'/app',
'/app/.heroku/python/lib/python37.zip',
'/app/.heroku/python/lib/python3.7',
'/app/.heroku/python/lib/python3.7/lib-dynload',
'/app/.heroku/python/lib/python3.7/site-packages']
Server time: Wed, 11 Dec 2019 23:17:58 +0000
我确实按照步骤一步一步地跟着做,所以现在有点不知所措。虽然我可以跳过这一步,但是我需要在将来的项目中使用数据库,并且希望知道如何避免这种情况发生。我查看了这里的几个类似讨论,但没有看到针对教程的具体内容。任何帮助都将不胜感激。