same error is coming .....Have u solved this problem

On Thursday, March 4, 2010 4:17:48 PM UTC+5:30, Emma F wrote:
>
> Has anyone ever had any success accessing the django admin site via
> either of these tools?
>
> I'm working on a view that will convert a particular dynamically-
> generated page in my site to a PDF file, which can then be downloaded
> from the server.  I originally tried to do this using this reportlab/
> pisa method described in the documentation, but it couldn't cope with
> the formatting required, so I'm on to plan B: wkhtmltopdf, run as a
> command-line tool via subprocess.Popen in the django view.   If I
> can't get that to work, I will have the view mirror the page with wget
> (again using Popen) and then run wkhtmltopdf off that local copy on
> the server.
>
> Both methods work perfectly with a local copy of the page I've saved
> from my browser. However, I'm having difficulties making it work
> automatically from the view, with live pages from the application. I'm
> trying to use the --post option of wkhtmltopdf to log in via the login
> form and then convert the page.  I can get this method to work with
> various other sites on the web, but something goes wrong when I try
> with my django admin site.
>
> I'm using the standard authentication that comes with the django admin
> site, and on examing the code for the login form fields, it looks like
> so:
>
> <form action="/mysite/admin/" method="post" id="login-form">
>         <input type="text" name="username" id="id_username" />
>          <input type="password" name="password" id="id_password" />
>           <input type="hidden" name="this_is_the_login_form"
> value="1" />
>          <input type="hidden" name="post_data" value="" />
>          <input type="submit" value="Log in" />
>  </form>
>
> I've tried to translate the names and values of those fields into
> wkhtmltopdf --post commands.  (I'm not too sure about the hidden
> post_data field with the value of "", so that could be where the
> problem lies: I've tried leaving it out altogether, leaving the second
> argument to that --post blank, using "" and using + to stand in for a
> space, but the result is always the same.)
>
> Here's what I plug in:
>
> wkhtmltopdf --post username myname --post password mypassword --post
> this_is_the_login_form 1 --post post_data +[or whatever I'm using]
> http://www.server.com/mysite/admin index.pdf
>
> And the result is a pdf of a django debug page, telling me:
>
> ******************
>      Exception Type: MultiPartParserError
>      Exception Value: Invalid boundary in multipart: None
>      Exception Location: /usr/local/lib/python2.5/site-packages/django/
> http/multipartparser.py in __init__, line 65
>
> ******************
>
> Using the alternative method - wget to try and mirror the file, I
> translate the form like this:
>
> wget -m --post-
>
> data='username=myname&password=mypassword&this_is_the_login_form=1&post_data=
> +'  http://www.server.com/mysite/admin
>
> And get an "Error 500: Internal Server Error" method in the command
> line.
>
>
> Can anyone suggest what might be going wrong here - is it something to
> do with the way I'm handling the hidden, valueless "post_data" form
> field? Or something else I'm doing wrong?... Or is there some inherent
> feature of the django admin authentication that is going to prevent
> this process working?
>
> Thank you to anyone who can help!
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/a5aad2ea-ff7a-4374-a25c-7f3f6319b8f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to