Yes you right Tim, i have misunderstood the purpose of height_field and
width_field, i'm new in Django :)
Gonna check more in the documentation and try a third-party app to resize
images.
Thanks a lot for the help. I appreciate.
--
You received this message because you are subscribed to the
You've misunderstood the purpose of height_field and width_field. Please
read the documentation:
https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ImageField.height_field
You need to use a third-party app to do image resizing. Check out
>
> My model fields look like this:
>
> class CustomAbstractUser(AbstractBaseUser, PermissionsMixin):
> """
> An abstract base class implementing a fully featured User model with
> admin-compliant permissions.
>
> Email and password are required. Other fields are optional.
>
height_field and width_field should be strings. What's the error and what
does your model fields look like?
On Wednesday, October 31, 2018 at 10:53:53 AM UTC-4, Pacôme Avahouin wrote:
>
> Tim you just saved me right now:) I have spent the all night trying to
> figure it out.
> Thanks a lot.
>
Tim you just saved me right now:) I have spent the all night trying to
figure it out.
Thanks a lot.
Now when i removed the width_field it works fine. But how to
define height_field and width_field directly from the model?
Cause when i put their values in quotes i got another error.
--
You
It looks like the width_field option on the model field isn't a string.
On Wednesday, October 31, 2018 at 10:28:42 AM UTC-4, Pacôme Avahouin wrote:
>
> Hello Tim,
>
> Thanks for answering.
>
> Here is the complete traceback.
> By the way when i commented out the 'upload_file' function still i'm
Hello Tim,
Thanks for answering.
Here is the complete traceback.
By the way when i commented out the 'upload_file' function still i'm
getting the same error.
I believe the origin might be somewhere else.
Environment:
Request Method: POST
Request URL:
It would be helpful to see the complete traceback. What you provided
doesn't show where the exception originates.
On Tuesday, October 30, 2018 at 10:38:38 PM UTC-4, Pacôme Avahouin wrote:
>
> Hello guys,
>
> I'm trying to upload user avatar (ImageField type) with my own custom user
> model
Hello guys,
I'm trying to upload user avatar (ImageField type) with my own custom user
model following the documentation like this:
class MyUsersProfileView(UpdateView):
# First try
def upload_file(request):
if request.method == 'POST':
form =
9 matches
Mail list logo