Tag: django

Tip - Dynamic Path For FileField

In a recent project I needed to save a file to a dynamic directory. My model was something like this: from django.db import models class MyDoc(models.Model): name = models.CharField() document = models.FileField(upload_to='uploads/documents') with this code each document will

Continue Reading

Adding additional views to django admin

Today I wanna show you a simple way to add an additional view to the admin site. Imagine that you want to create a view to review a model, something like send an email to the site owner with your thoughs (or your changes) about

Continue Reading