Have you seen this?
https://docs.djangoproject.com/en/1.8/topics/http/file-uploads/
Has an example showing an example exactly as you asked without any models involved. Also make sure you recognize the difference between models.FileField and forms.FileField:
https://docs.djangoproject.com/en/1.8/ref/models/fields/#filefield
https://docs.djangoproject.com/en/1.8/ref/forms/fields/#filefield
The former is for definitions in models and the corresponding database column, and the latter is for display within web forms.
The overlap for naming between forms and models has burned me more than once.
-James
On Apr 27, 2015 3:14 AM, "mangu rajpurohit" <rajpurohitmangu@gmail.com> wrote:
-- Hi,--I am new to django. I am looking for examples for uploading/downloading files in django. I found that models.FileField is used in model. So, my question is that, is it possible to upload file in django, without requiring to create a model, which will keep track of filenames in database.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/16371334-b89d-4385-b141-0eb75c1056ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciV9juciG6zDzktMu%3DX-iYj%2BWHMX3pWp-tBY%3D8AtsXNYsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment