Skip to content

Tag: django

How to add the current query string to an URL in a Django template?

When I load a page, there is a link “sameLink” that I want to append to it the query string of its containing page. I have following URL: How can I do that? Answer To capture the QUERY_PARAMS that were part of the request, you reference the dict that contains those parameters (request.GET) and urlencode them so they are acceptable

Django DateTimeField auto_now_add not working

In one of the model i have set one timestamp field as follows: While in shell i am able to create a obj and save it, however in my application it is raising a exception that created_datetime field cannot be null. Confused where things went wrong!! How to reslove it. Answer You can do something like this

Generating PDFs from SVG input

I am trying to generate a PDF from a SVG input file with Python in a Django application. I have already found 2 working solutions: cairo+rsvg and imagemagick but they both have one problem: They have …