Вопрос

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?

Это было полезно?

Решение

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.

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top