On Sun, Jun 17, 2012 at 5:31 AM, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> On 17/06/2012 5:16am, Satvir Toor wrote:

> 1. Include the image in your other form <img
> href="{{MEDIA_URL}}somedir/image.png">

I followed the link which you suggest me.
I made changes in settings.py file of the project as
MEDIA_ROOT = 
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/'
MEDIA_URL = 'http://localhost/media/'

and i made changes in the models file as:

 file_upload=models.FileField(upload_to='img')

I created a html file like:

 {% if form.errors %}
         <p style="color: red;">
             Please correct the error{{ form.errors|pluralize }} below.
        </p>
     {% endif %}
     <h3> Fill Following Entries carefully<br><br>
     <form action="" method="post">
         {% csrf_token %}
         <table >
            {{ form.as_table }}
         </table><br>
        <input type="submit" value="Submit">


but when i try to submit data it makes the upload file empty and gives
notification this field(file upload) is required.


> 2. ensure your upload mechanism in the first form puts the uploaded image in
> the right place
>
> You will find the uploaded image somewhere in your MEDIA_ROOT directory tree
>
> https://docs.djangoproject.com/en/dev/ref/models/fields/#imagefield




-- 
Satvir Kaur
satveerkaur.blogspot.in

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to