Skip to content

Commit

Permalink
Models done
Browse files Browse the repository at this point in the history
  • Loading branch information
NabhyaKhoria committed Mar 25, 2023
1 parent b043cc3 commit 4761e73
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
7 changes: 6 additions & 1 deletion Portfolio/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# Application definition

INSTALLED_APPS = [
'home',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
Expand Down Expand Up @@ -121,4 +122,8 @@

STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static")
]
]

MEDIA_URL = '/media/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 2 additions & 0 deletions home/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.contrib import admin
from home import models

# Register your models here.
admin.site.register(models.Mentor_Profile)
14 changes: 7 additions & 7 deletions home/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@

class Mentor_Profile(models.Model):
username = models.OneToOneField(
User, on_delete=models.CASCADE, null=True, blank=True)
User, on_delete=models.CASCADE, null=True)
role = models.CharField(max_length=40, choices=Role_type, default="Other")
department = models.CharField(max_length=99, null=True)
contact = models.CharField(max_length=29, null=True)
year = models.IntegerField(min=1,max=6)
year = models.IntegerField()
alt_email = models.CharField(max_length=250, null=True)
photo = models.FileField(upload_to='profile_uploads/',null=True, blank=True)
short_description = models.CharField(max_length=50, null=True, blank=True)
long_description = models.CharField(max_length=700, null=True, blank=True)
hall = models.CharField(max_length=50, null=True, blank=True)
photo = models.FileField(upload_to='profile_uploads/',null=True)
short_description = models.CharField(max_length=50, null=True)
long_description = models.CharField(max_length=700, null=True)
hall = models.CharField(max_length=50, null=True)
linkedin_link = models.URLField(max_length=300)
facebook_link = models.URLField(max_length=300)

def __str__(self):
return (self.username)
return (self.alt_email)
5 changes: 4 additions & 1 deletion home/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from django.contrib import admin
from django.urls import path
from home import views
from django.conf.urls.static import static
from django.conf import settings


urlpatterns = [
path("", views.index, name='home'),
path("index.html", views.index, name='home'),
path("team.html", views.profiles, name='team'),
path("contact.html", views.contact, name='contact')
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

0 comments on commit 4761e73

Please sign in to comment.