Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #10 from frikinomad/main
Browse files Browse the repository at this point in the history
Issue 6
  • Loading branch information
TheRealSibasishBehera committed Dec 19, 2022
2 parents 2ae31f1 + 85fcf9f commit 1d355e7
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ __pycache__
db.sqlite3
media

#ignoring pip files
Pipfile
Pipfile.lock

# Backup files #
*.bak

Expand Down
6 changes: 6 additions & 0 deletions accounts/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from django.contrib import admin
from .models import Profile

# Register your models here.
class ProfileAdmin(admin.ModelAdmin):
list_display = ('user', 'phone', 'age', 'gender')

admin.site.register(Profile, ProfileAdmin)

13 changes: 13 additions & 0 deletions accounts/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
from django.db import models
from ckeditor.fields import RichTextField
from django.contrib.auth.models import User

# Create your models here.
class Profile(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE) #mapping to auth user model
phone = models.IntegerField()
age = models.IntegerField()
photo = models.ImageField(upload_to='%Y/%m/', default = "default.png")
gender = models.CharField(max_length=254)
bio = RichTextField() #about, Intersts & Hobbies
skills = RichTextField() #tech & otherwise

def __str__(self):
return self.user.username
4 changes: 4 additions & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'ckeditor', #for profiles model, using Rich text field
'forum.apps.ForumConfig',
'accounts.apps.AccountsConfig',
]
Expand Down Expand Up @@ -124,3 +125,6 @@
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'


MEDIA_ROOT = BASE_DIR / "profile_photos"
Binary file added profile_photos/2022/12/deafult.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1d355e7

Please sign in to comment.