[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed to test packages with Django 1.7



Just testing some of my code against Django 1.7.

The first problem was this:

Unhandled exception in thread started by <function wrapper at 0x2fccc80>
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/utils/autoreload.py", line 221, in wrapper
    fn(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 104, in inner_run
    self.validate(display_num_errors=True)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 361, in validate
    return self.check(app_configs=app_configs, display_num_errors=display_num_errors)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 370, in check
    all_issues = checks.run_checks(app_configs=app_configs, tags=tags)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/registry.py", line 59, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/usr/lib/python2.7/dist-packages/django/core/checks/model_checks.py", line 16, in check_all_models
    model.check(**kwargs)
TypeError: unbound method check() must be called with ProjectApplication instance as first argument (got nothing instead)

Turns out that is because I have a model function called check(), which must now be renamed. This is documented in the Django 1.7 release notes.
https://docs.djangoproject.com/en/dev/releases/1.7/


The biggest and most scary change IMHO, is libraries that ship with django-south migrations. I have at least one library that does this (django-simple-captcha, currently stuck in NEW).

I think django-south still works with Django 1.7 (????), but is considered depreciated compared with the Django 1.7 built in migrations.

The problem being that the newer migration mechanism is not compatible with the previous mechanism.

How we deal with this probably will require more consideration here. 

This seems to be a really good blog post on the issue: http://treyhunner.com/2014/03/migrating-to-django-1-dot-7/ - where Trey recommends renaming the existing migrations directory to south_migrations, and setting SOUTH_MIGRATION_MODULES.

Which is unfortunate, it means the decision has to be made in the library, but the SOUTH_MIGRATION_MODULES has to be set in the application.
--
Brian May <brian@microcomaustralia.com.au>

Reply to: