2
I wanted to ask a question, I am trying to upload a PDF file, on Jango, and I wanted to know if you like I view this pdf, I have the following code:
py.models
class Edital(models.Model):
# ...
class DataFile(models.Model):
Arquivo = models.FileField()
def chage_view(self):
return self.Arquivo
class Meta:
verbose_name_plural = 'Editais'
Numero = models.CharField(primary_key=True, max_length= 15)
pro_reitoria = models.ForeignKey('Pro_reitoria', default="")
Arquivo = models.FileField(upload_to= "", default="")
def __str__(self):
return self.Numero
py Settings.
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
in my admin gets like this the file
When I click the loaded file appears Page not Found(404)
How do I view the PDF? I appreciate anyone who can help me!
Thank you very much friend, solved my problem!!
– Walkyr Rosa