I'm attempting to use sphinx to document the django app I'm writing. So far I have my code.rst
setup to look at models.py
, and when I run make html
I get the automatic documentation, however I get a warning:
WARNING: autodoc can't import/find attribute 'myapp.models.MyModel.image', it reported error: "image", please check your spelling and sys.path
The entire tracelog is:
Traceback (most recent call last):
File "C:\blah\lib\site-packages\sphinx\ext\autodoc.py", line 326, in import_object
obj = self.get_attr(obj, part)
File "C:\blah\lib\site-packages\sphinx\ext\autodoc.py", line 232, in get_attr
return safe_getattr(obj, name, *defargs)
File "C:\blah\lib\site-packages\sphinx\util\inspect.py", line 70, in safe_getattr
raise AttributeError(name)
AttributeError: image
MyModel.image
is an image field, simply on the model defined as:
#: image file location for ``MyModel``
image = models.ImageField(upload_to="images/")
If I change image to models.Charfield
for example it runs fine. Is there any reason why an ImageField
would cause sphinx issues?
my code.rst:
.. automodule:: dynamicbanners.models
:members: