Skip to content

Tag: django

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 some strange dependencies that I do not want to install on a server, for example DBUS and GTK. So I am asking …

how to open url in new tab from django?

i have to open the result page using render_to_response on a new tab Answer Django is server-side, opening in a new tab is client-side. So use an <A> with a target=”_blank” http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=target%3Dblank But of course spawning new windows/tabs …

Why doesn’t Pydev find Django?

I have Django installed. I also have django-admin.py in my python-2.7 folder. I can import django using my Python shell (DreamPie). But I can’t create a new Django project in Pydev. When trying to create a new Pydev Django Project (choosing python2.7 as the interpreter) I receive the following error mes…