Skip to content

Instantly share code, notes, and snippets.

@AtufaShireen
Created June 24, 2020 11:39
Show Gist options
  • Save AtufaShireen/de8302f290d30bc68ab1923fe72b6c33 to your computer and use it in GitHub Desktop.
Save AtufaShireen/de8302f290d30bc68ab1923fe72b6c33 to your computer and use it in GitHub Desktop.
users/models.py
from django.db import models
from django.contrib.auth.models import User
class Profile(models.Model):
user=models.OneToOneField(User,on_delete=models.CASCADE)
bio=models.TextField()
pic=models.ImageField(default='default.jpg',upload_to='profile_pics')
def __str__(self):
return f'{self.user.username}\'s Profile '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment