Hi Issuer,

please see:
In your settings file, you’ll need to define MEDIA_ROOT
<https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-MEDIA_ROOT> as
the full path to a directory where you’d like Django to store uploaded
files. (For performance, these files are not stored in the database.)
Define MEDIA_URL
<https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-MEDIA_URL> as
the base public URL of that directory. Make sure that this directory is
writable by the Web server’s user account.

https://docs.djangoproject.com/en/2.2/ref/models/fields/

And more check in this content.



On Tue, Nov 5, 2019, 20:01 Simonas Pilkauskas <
[email protected]> wrote:

> Hello,
> I want to setup a Model like this
> <https://github.com/Simonas0/django_playground/blob/master/files_in_custom_fields/models.py>,
> but apparently FileField in custom field doesn't work out of box (when
> trying to save, I get the error "can't adapt type 'TemporaryUploadedFile'").
> FileField, which is directly in Model, works fine.
> I've tried what came to my mind, but I'm relatively new to Django and
> can't figure out myself.
> Could anyone help me?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c34d85b3-78d6-4d89-804f-b1cf2f77c2e5%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c34d85b3-78d6-4d89-804f-b1cf2f77c2e5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWpeBwxThE6wqjRbeK%2BZaKm0Z65zosw1gWKP0E0%3Doh2xdA%40mail.gmail.com.

Reply via email to