image in django
<html>
<head>
{% load staticfiles %} <!-- Prepare django to load static files -->
</head>
<body>
<img src={% static "image.jpg" %}>
</body>
</html>
image in django
<html>
<head>
{% load staticfiles %} <!-- Prepare django to load static files -->
</head>
<body>
<img src={% static "image.jpg" %}>
</body>
</html>
how to populate an image to template in django from views
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Image(models.Model):
owner = models.ForeignKey(User, on_delete=models.CASCADE)
image = models.ImageField(upload_to='Upload', height_field=None, width_field=None, max_length=100)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us