Skip to navigation

Skip to additional stuff


Thursday, August 4, 2011

Django UUID primary key

Just use the default parameter for a field:

import uuid

class ExampleModel(models.Model):
id = models.CharField(max_length=255, primary_key=True, default=uuid.uuid4)

2:59 pm | Filed under: | No comments posted yet.

Tuesday, June 21, 2011

Getting the Django version number

Since I’ve been looking for this more than once:

import django
django.VERSION

5:36 pm | Filed under: | No comments posted yet.

Thursday, August 14, 2008

Here’s a Quick Way to make code look nicer in Firefox

I use Droid Sans Mono as my font for coding and in Putty and nearly everywhere. You can read and download it over at damieng.com.

If you want code and fixed-width text to appear nice in Firefox, what’s a better idea than using Droid Sans Mono there, too?

Go to Options > Content. Under Fonts & Colors click Advanced and choose Droid Sans Mono as monospaced font. It’s as easy as that. It will now affect every fixed-width text that is not formatted by CSS or something else. It will even change fonts in Firebug. I like it, it looks beautiful!

5:38 pm | Filed under: | No comments posted yet.

Navigation


  • Info

    “the j-blog” is the weblog of Julian Bez about web design, web standards and all that web stuff. He's a web developer, designer and CEO of his own company, but basically a Business Computing graduate, currently residing in BerlinGermany.


© Copyright Julian Bez 2012. All rights reserved, unless otherwise mentioned.
For your convenience: All times are GMT.
Built with valid things such as XHTML and CSS.

PLEASE NOTE: This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. more info...