将应用程序从Django 1.4移到1.8

2024-04-26 03:43:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我以前在django1.4上运行过一个项目,现在我正在尝试“恢复它”。你知道吗

我当时的系统是OS-X,运行BITNAMI DJANGO STACK 1.4.6(Python2.7)。我已经将源代码从Git存储库拉入新安装的BITNAMI DJANGOSTACK 1.8https://bitnami.com/stack/django/installer#osx

理想的情况下,我会升级一切,因为我去了,但我找不到DJANGOSTACK 1.4.6下载。老实说,我不知道升级这个应用程序的最佳选择是什么。

以下是我所做的:

  • 从我的Bitbucket存储库克隆代码。你知道吗
  • 正如所料,数据库不是我提交给Git存储库的内容的一部分。所以有些数据丢失了。你知道吗
  • 我认为没有数据库备份,或者更改没有提交到Git存储库(更可能是这样?)在某个点上导致了与模式的一些差异,并向我发出了迁移警告。迁移问题:http://sprunge.us/jIXC
  • 运行建议的Run 'python manage.py migrate'
  • 一些断开的链接和功能得到修复。详情如下:http://sprunge.us/QTJF

我的主要突破是什么似乎是一个不正确的位置模板? (这里是完整的追踪路线:http://sprunge.us/hQHK

TemplateDoesNotExist at /metrics/metrics_search_form/ metrics/metrics_search_form.html Request Method: GET Request URL: http://localhost:8000/metrics/metrics_search_form/ Django Version: 1.8.11 Exception Type: TemplateDoesNotExist Exception Value:
metrics/metrics_search_form.html Exception Location: /Applications/djangostack-1.8.11-0/apps/django/lib/python2.7/site-packages/Django-1.8.11-py2.7.egg/django/template/loader.py in get_template, line 46 Python Executable: /Applications/djangostack-1.8.11-0/python/bin/python Python Version: 2.7.11

模板确实存在,但位于:

/metrics/templates/metrics/metrics_search_form.html

这是django1.4到django1.8以来的新行为吗?如果是的话,我该怎么解决呢。你知道吗

我应该用另一种方式升级这个项目吗?你知道吗

谢谢!你知道吗


Tags: 项目djangopygitform数据库httpsearch