Login / Register


Share Snipplr


Welcome To Snipplr


Everyone's Recent Django Snippets



« Prev 1 2
  1. FAV

    Django dumpdata/loaddata

    Commands to dump and load a database in django
    Django 6 views posted 6 years ago by erichlotto
  2. FAV

    How to read \"_id\" field of an object in django templates

    It's imposible to read de "_id" field en django templates ( {{element._id}} === error) So, to read it, you must do a templatetag. Now you hace the templatetag, you can use it like this: {{element|pk}}
    Django 12 views posted 6 years ago by viroide
  3. FAV

    telecineplay Error log

    Just an error log from TelecinePlay. Please.. don't share error logs in public..
    Django 13 views posted 7 years ago by novazoo
  4. FAV

    Django: 3 ways to serve templates in views.py

    There are so many ways to serve templates within views.py that sometimes it's hard to get a handle on which is ideal for a project. This snippet does not attempt to explain every possible way to serve a template, simply a few I've found helpful orga...
    Django 18 views posted 8 years ago by chrisaiv
  5. FAV

    Clean up expired django.contrib.session\'s in a huge MySQL InnoDB table

    While django provides the django_admin.py cleanup script, if sessions get out of control sometimes you have to go lower level to get everything cleaned up. If the problem gets out of hand and you hit the resource limits of the machine, it is very dif...
    Django 16 views posted 8 years ago by magicrebirth
  6. FAV

    Django: Configuring settings.py to rely on relative paths rather than absolute

    Hate absolute Paths? Me too, I always end up forgetting to change things around when I go into production mode. Thankfully, there's a nice, clean way to have Python do all the hard work.
    Django 15 views posted 8 years ago by chrisaiv
  7. FAV

    Adding request object info to a template

    Django 17 views posted 8 years ago by magicrebirth
  8. FAV

    Django: check whether an object already exists before adding

    Django 14 views posted 8 years ago by magicrebirth
  9. FAV

    Convert the time.struct_time object into a datetime.datetime object:

    Django 13 views posted 8 years ago by magicrebirth
  10. FAV

    Django if statement & loop

    Django 16 views posted 8 years ago by stewartduffy
  11. FAV

    Adding custom django package to WSGI settings

    Django 11 views posted 8 years ago by magicrebirth
  12. FAV

    Remove duplicates from a list

    Not only is it really really fast; it's also order preserving and supports an optional transform function
    Django 11 views posted 8 years ago by magicrebirth
  13. FAV

    request: get multiple values | Django

    Django 14 views posted 8 years ago by magicrebirth
  14. FAV

    Strip/Remove HTML tags (django utils)

    Django 69 views posted 8 years ago by magicrebirth
  15. FAV

    Edit TEMPLATE_CONTEXT_PROCESSORS in your settings.py

    Instead of directly edit your TEMPLATE\_CONTEXT\_PROCESSORS, import it in your app's settings.py and just append what you need. (credits: denysonique and all #django channel community)
    Django 3 views posted 9 years ago by caruso_g
  16. FAV

    Django tut Blog Settings.py 1

    Django 6 views posted 9 years ago by Affix
  17. FAV

    Django simple url redirect

    Django 19 views posted 9 years ago by magicrebirth
  18. FAV

    Timestamp Inherit Model (Versione 2)

    Simula in Django i campi created e updated aggiornati automaticamente alla creazione e alla modifica del record (Versione 2 senza funzione save ridefinita)
    Django 10 views posted 9 years ago by munkypot
  19. FAV

    Django | Testing Django applications

    Django 6 views posted 9 years ago by magicrebirth
  20. FAV

    google keyword tool

    <a href="http://www.bestgooglekeywordtool.com">google keyword tool</a>
    Django 6 views posted 9 years ago by uraq
  21. FAV

    Django: instantiating (simple) M2M models

    Django 8 views posted 10 years ago by magicrebirth
  22. FAV

    ModelAdmin media definitions

    Django 8 views posted 10 years ago by magicrebirth
  23. FAV

    modify django admin field to use specific queryset and form widget

    Django 9 views posted 10 years ago by magicrebirth
  24. FAV

    Django send email through Gmail

    Django saved by 12 people 8 views posted 10 years ago by martin_rusev
  25. FAV

    Custom validation message

    Django 8 views posted 10 years ago by martin_rusev
  26. FAV

    Send HTML templates with Django

    Django 7 views posted 10 years ago by martin_rusev
  27. FAV

    Django: access the attributes of a model dynamically

    example: a method on a model that outputs a list of tuples with (attribute_name.verbose, attribute_value)
    Django 9 views posted 10 years ago by magicrebirth
  28. FAV

    Django: adding new admin_tags

    First: create a file under djangoapp/templatetags where you define your tags [e.g.: myadmin_tags.py]: Second: create the html snippets that get loaded in those tags [e.g., personfactoid_info.html]: Third: in mytemplates/admin/ modify change_for...
    Django saved by 4 people 7 views posted 10 years ago by magicrebirth
  29. FAV

    Django and JSON

    This function takes anything which can be dumped into JSON and returns an HTTP response of it, with the right Content-type header.
    Django saved by 8 people 12 views posted 10 years ago by magicrebirth
  30. FAV

    Django: using properties on models

    Django 10 views posted 10 years ago by magicrebirth
« Prev 1 2