thanks for any help in advanced. I am creating a personal website with Django, and I am coming from a Drupal background. I just started to learn the framework.
I am looking help with... a suggestion for a package or direction on how to get started on how to create a customizable file (image, video) path based off an user(Profile) name. So, a new directory would be created, when the user(Profile) is created, and the media for that user is stored in their directory. Then it would also get broken down into, if its a image or video with their own directory.
In theses files below, so far I have it setup like this.
settings.py
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'``
users/models.py
`class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
image = models.ImageField(default='default.jpg', upload_to='profile_pics')
def __str__(self):
return f'{self.user.username} Profile'`
Thanks.
I am new to the Django framework, and was hoping for some direction to point me in the right direction.