Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
modelo de perfil Django

Soy un principiante en django y trato de crear un modelo de perfil que interrelacione el modelo integrado de "Usuario" a través del campo de relación uno a uno, resulta imposible abarcar las propiedades del modelo de usuario por instancia del modelo de perfil y viceversa.
Alguien me puede ayudar.

modelos.py

 from django.db import models from django.contrib.auth.models import User class Profile(models.Model): users=models.OneToOneField(User, on_delete=models.CASCADE) image=models.ImageField(default='profilepic.jpg',upload_to='profile_pictures') location=models.CharField(max_length=100) def __str__(self): return self.users.username

plantilla de perfil.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Profile</title> </head> <body> <h2>{{user.username}}</h2> <img src='{{user.Profile.image}}'> </body> </html>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

use un perfil en minúsculas según los documentos

 <img src='{{user.profile.image}}'>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!