Reputation: 7342
Is it possible to upload a file in django using django's model.FileField()
to a location that's not relative to /media
?. In my case upload an .html file to myproject/templates
.
Upvotes: 0
Views: 418
Reputation: 23871
You cannot if I remember right, this kind of operation is in-secure. The file storage backend would warn it.
You could either customize the storage backend, or upload to directory like /media/user_template
and set it in TEMPLATE_DIRS
.
If you only want to use dynamic templates, check django-dbtemplates as a DB-based solution.
Upvotes: 1