Problem finding the image path in Django in one of the apps

25 views Asked by At

I have 2 apps in my django project: -accounts & -ticketsales my project show images for ticketsales's model but dosen't show images for accounts's model,

when I run my project, ProfileImages folder create out of media folder(that contain project's image) project's setting.py is:

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR,"static/")
MEDIA_URL = "/media/"
MEDIA_PATH = os.path.join(BASE_DIR,"media/")

my image field in accounts model.py is(dosen't show this image):

  ProfileImage=models.ImageField(upload_to="profileImagess",null=True)

profile view:

@login_required
def profileView(request):
    profile=request.user.profile
    context={
      "profile":profile
    }
    return render(request,"accounts/profile.html",context)

The image field in ticketsales model.py(show this image):

 Poster=models.ImageField(upload_to="concertImage",null=True

I want to show my images in project but this dosen't happen

0

There are 0 answers