DEV Community

Discussion on: SOLVED:Uploading images from Django-Admin

Collapse
 
highcenburg profile image
Vicente G. Reyes

What I'm trying to do is I'm trying to upload images from the admin and access it thru this dropdown(seen on the video/photo) but when I click it, it does not show anything.

Collapse
 
perigk profile image
Periklis Gkolias

What do the logs say? I am afraid I cannot help with guessing. :)

Thread Thread
 
highcenburg profile image
Vicente G. Reyes • Edited

When I use this

image = models.FileField(upload_to='static/')
it returns a
Server Error (500)
on the admin.


When I use
image = models.FileField("/img")
It return a
Server Error (500)
on the site.

When I use
models.FilePathField(path=os.path.join(settings.BASE_DIR, 'home/projects/static/img'))
it returns a
Server Error (500)
on the admin.

Im confused. I just want to upload images from the admin to the portfolio page of my site.
Thread Thread
 
perigk profile image
Periklis Gkolias

As explained a couple of times above, those are generic errors and without more specific info or code I am afraid I cannot be of much help, if my only weapon is guessing.

There are various tutorials online. Please have a look and if you have any specific questions please ask again.

A great tutorial that will help: wsvincent.com/django-image-uploads/