I am running Django 1.5.1, Python 2.7.2 and IPython 0.13.2. If I use "python./manage.py shell" from my Django project directory, I get the following error:
from django import forms
class CommentForm(forms.Form):
name = forms.CharField()
NameError: name 'forms' is not defined.
I know that forms are defined as I can see it when it does "dir (forms)". I noticed that this error only occurs when I run iPython in REPL. If I run REPL and use only the plain, old Python interpreter, an error does not occur.
Has anyone else experienced this issue? If so, do you know why this is happening, and is there work?
I have to add that in the past I had problems creating classes in REPL until I created a metaclass in the class and defined the variable "app_label". This did not affect the situation.
Thank.
source
share