upgrading python django project 1.3 to 1.5

江枫思渺然 提交于 2019-12-06 03:37:39

问题


currently i have python project using django version 1.3 running on mountain lion OS and now i want to upgrade it to django 1.5. But when i put it and try to do python manage.py runserver i get an error saying

Error: Can't find the file 'settings.py' in the directory containing 'manage.py'. It appears you've customized things. You'll have to run django-admin.py, passing it your settings module. (If the file settings.py does indeed exist, it's causing an ImportError somehow.)

i realized that the project structure is different, is there any way to convert or upgrading the 1.3 project into 1.5 project somehow?


回答1:


Every Django release has release note with upgrading instructions.

  1. Upgrade your project to Django 1.4.
  2. Upgrade your project to Django 1.5.

Unfortunately the process is not automated, so you'll have to carefully go through both documents.




回答2:


To elaborate on what kirelagin mentioned, the project structure and layout has changed in 1.4 so you need to reflect that in your setup. You can see the notes on this in the release documentation:

Django 1.4 ships with an updated default project layout and manage.py file for the startproject management command. These fix some issues with the previous manage.py handling of Python import paths that caused double imports, trouble moving from development to deployment, and other difficult-to-debug path issues.

This will mean there is a conflict in where Django expects your settings.py to be.



来源:https://stackoverflow.com/questions/16914494/upgrading-python-django-project-1-3-to-1-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!