问题
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.
- Upgrade your project to Django 1.4.
- 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