bheaps
bheaps

Reputation: 29

django ModelFormWithFileField, ModelWithFileField

I am trying to import ModelWithFileField without sucsess. here https://docs.djangoproject.com/en/1.10/topics/http/file-uploads/ it says to import in the following manner:

from .models import ModelWithFileField

this does not work for me, I get:

ImportError: cannot import name ModelWithFileField

I have upgraded to the latest version of django

I get the same error when trying to do this:

from .forms import ModelFormWithFileField

Anyone out there know how to get these imports working?

Upvotes: 0

Views: 2224

Answers (1)

Daniel Roseman
Daniel Roseman

Reputation: 599540

No. That is an example of a model that contains a FileField. You need to use your own model.

Upvotes: 1

Related Questions