Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django >= 1.7 compatibility for requires_system_checks #99

Merged
merged 1 commit into from Mar 2, 2015

Conversation

nealtodd
Copy link
Contributor

Hi @dcramer,

Devserver will fail to start up on Django 1.7 with the error:

django.core.exceptions.ImproperlyConfigured: Command Command defines both "requires_model_validation" and "requires_system_checks", which is illegal. Use only "requires_system_checks".

The django-devserver runserver management command inherits from the django core runserver management command which set requires_system_checks = False. The django-devserver runserver management command then sets requires_model_validation = False.

This pull request ensures only the appropriate attribute is set to False, so is backwards compatible with Django < 1.7.

The implementation is only suggested. If you have another way you'd prefer to do it that's fine, this was just a convenient way to illustrate the issue.

Backwards compatible with Django < 1.7.
@nealtodd
Copy link
Contributor Author

PS. An alternative is to just delete line 70 (at the expense of explicitness) because the superclass sets the appropriate attribute to False anyway.

@gtaylor
Copy link

gtaylor commented Aug 22, 2014

Looks like this is tripping me up, too.

@mnaser
Copy link

mnaser commented Dec 21, 2014

Just ran into this too, be nice if it can be pulled in.

@seocam
Copy link

seocam commented Jan 28, 2015

Same here. @dcramer any chance we can get this merged?

@sutyrin
Copy link

sutyrin commented Feb 23, 2015

+1. Gotta use personal fork for this, please merge this :)

@ramusus
Copy link

ramusus commented Feb 24, 2015

+1 waiting for merge

@egrubbs
Copy link
Collaborator

egrubbs commented Mar 2, 2015

+1 please merge

dcramer added a commit that referenced this pull request Mar 2, 2015
Django >= 1.7 compatibility for requires_system_checks
@dcramer dcramer merged commit 66a2cfc into dcramer:master Mar 2, 2015
@keimlink
Copy link

keimlink commented Mar 3, 2015

Thanks @dcramer 🎆

@seocam
Copy link

seocam commented Mar 3, 2015

👍

@nealtodd
Copy link
Contributor Author

nealtodd commented Mar 4, 2015

Thanks @dcramer. When you get a chance could you make a 0.8.1 release to PyPI please, so we can get it from there in a pip install?

@coagulant
Copy link
Contributor

Merged fix forces validation for Django 1.6 and below, is that on purpose?
#99 (comment)

@GitFree
Copy link

GitFree commented Apr 2, 2015

+1 for

Thanks @dcramer. When you get a chance could you make a 0.8.1 release to PyPI please, so we can get it from there in a pip install?

@Pewpewarrows
Copy link

Shouldn't this be changing requires_system_checks and requires_model_validation on self, instead of creating locally scoped variables inside __init__? Or am I understanding this wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet