How can I create an encrypted django field that converts data when it’s retrieved from the database?

I have a custom EncryptedCharField, which I want to basically appear as a CharField when interfacing UI, but before storing/retrieving in the DB it encrypts/decrypts it. The custom fields …

sqlite3.OperationalError: unable to open database file

I get this error when setting up a server in Django. It is sqlite3 which means it should create the .db file but it doesn’t seem to be doing so. I’ve stipulated SQLite as the backend and an absolute …

A python web framework for google app engine

(Please note that this question and some of the answers are old) I want to use an existing python framework to develop an application on google appengine. It should be quick and easy to start and …

Django – Template display model verbose_names & objects

I need to display several models name & objects in a template Here is my view def contents(request): “””Lists contents””” objects = [ Model1.objects.all(), Model2.objects.all(), …

How to Query model where name contains any word in python list?

Aim to Achieve: I want all objects where name attribute contains any word from the list. I have: list = [‘word1′,’word2′,’word3’] ob_list = data.objects.filter( // What to write here ? ) // or any …

how to substract two datetime.time values in django template,and how to format a duration as hour,minutes

In a django app ,I am sending a list of Entry objects to the template.Each Entry object has a start, end times which are datetime.time values(from TimeFields on the form).While listing the Entry …

Paginator for inline models in django admin

I have this simple django model consisting of an sensor and values for the specific sensor. The number of values per Pyranometer is high (>30k). Is it somehow possible to paginate PyranometerValues by a specific day or generell apply a paginator to the admin inline view? Answer Have you checked raw_id_fields attribute? I think you might find it useful.

How to have Calendar thing in Django date field

I have this Datetime field in Django update_date = models.DateField() But I want the Calendar to pop up. In docs, they say to write this class CalendarWidget(forms.TextInput): class Media: …

How to sort collections based on current user locale on a Django site

I need to sort a collection of objects by a utf-8 string property (built via ActiveRecord). Currently the code is sorting by ASCII order via the order_by method, however this needs to be changed to …

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 …