Django image uploading
问题 I have a problem with image uploading. For now, chosen image file is not copied to destination directory and path to this file is not added to database. I'm giving my code below: models.py: from django.db import models from django.contrib.auth.models import User class UserProfile(models.Model): user = models.OneToOneField(User) avatar = models.ImageField(upload_to="avatar/") form.py class ProfileEditionForm(ModelForm): class Meta: model = UserProfile exclude = ('user') view.py: def index