Hello
I have following issue with getting data from my Profile model.
Details:
I have created Profile model which have first_name, last_name, BIO and social_facebook fields.
class Profile(models.Model):
first_name = models.CharField(max_length=60)
last_name = models.CharField(max_length=60)
BIO = models.TextField(max_length=800, blank=True, null=True)
social_facebook = models.CharField(max_length=100, blank=True, null=True, verbose_name='Facebook')
I want insert social_facebook value (link) in footer.html template, for that I created context_processors.py file and inserted code there
def profile_context_processor(request):
item = Profile.objects.all()
return {
'soc_fb': item,
}
and in footer.html I inserted: {{soc_fb}}
I know that the profile_context_processor function is not valid. It gives me the name of Profile which I created in Django Admin panel. Can you help me to get information correctly?