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

Globally enabling Johnny Cache in __init__.py causes error with syncdb #37

Closed
radiosilence opened this issue Oct 11, 2013 · 3 comments
Closed

Comments

@radiosilence
Copy link

AttributeError: 'module' object has no attribute 'empty_iter'

Solution:

import sys
try:
    if sys.argv[1] != 'syncdb':
        raise Exception
except:
    from johnny.cache import enable
    enable()
@jself
Copy link
Collaborator

jself commented Oct 11, 2013

Correct, this isn't possible. You can't enable jonny cache before the database and settings are initialized in the call order (this is why we do it in middleware, the call order is important)

@jself jself closed this as completed Oct 11, 2013
@radiosilence
Copy link
Author

Perhaps updating the docs then?

@jself
Copy link
Collaborator

jself commented Oct 13, 2013

Thanks, yeah, in fact it's documented as the opposite. I'll check on it to
make sure, I distinctly remember that not working though with similar
errors.

On Sun, Oct 13, 2013 at 11:36 AM, James Cleveland
notifications@github.comwrote:

Perhaps updating the docs then?


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-26220154
.

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

No branches or pull requests

2 participants