Whats is the best way to migrate folder and files structure from django1.3 to django1.4?
Asked Answered
E

2

10

I have a little project created with django1.3 and I want to migrate it to django1.4 but since the files structure change a little, what is the best way to migrate?

Entice answered 25/3, 2012 at 2:6 Comment(0)
E
5

Read https://docs.djangoproject.com/en/dev/releases/1.4/ first.

  • For a quick run, just update env from Django1.3 to 1.4, tweak settings file and project code by fixing any incompatibility warning and imports issue.
  • For a clean update, better to create an empty project w/ the same name of the current project and migrate it w/ current code, mainly override foo/settings.py and foo/urls.py . I prefer to follow settings structure by http://justcramer.com/2011/01/13/settings-in-django/ , when it's done there is no need to merge base settings.py each time you update Django version.
Europe answered 25/3, 2012 at 7:12 Comment(0)
J
1

Regarding directory structure, I think all you have to do is move your manage.py one level up and change it's contents to this(replacing {{project_name}} with the name of your project):

#!/usr/bin/env python
import os, sys

if __name__ == "__main__":
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")

    from django.core.management import execute_from_command_line

    execute_from_command_line(sys.argv)

Look here for details: https://docs.djangoproject.com/en/dev/releases/1.4/#updated-default-project-layout-and-manage-py

Jelene answered 25/3, 2012 at 6:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.