Inside the Head of PyDanny

Hi, I'm Daniel Roy Greenfeld, and welcome to my blog. I write about Python, Django, and much more.

Tag: Django

New Course: Creating and Distributing Python Packages

Myself and Audrey Roy Greenfeld have released a course, Creating and Distributing Python Packages. Features it includes:

  • Covers Python packaging details including setup.py, not to mention automating things like testing, versioning, documentation, dependency management, and checking for security issues.
  • Available in English or Spanish.
  • Teaches advanced use of Cookiecutter ...

Read more ...


Authenticating via JWT using Django, Axios, and Vue

Getting Django Rest Framework, JWT, Axios, and Vue.js to play nice isn't easy. Here's my quick-and-dirty cheatsheet that I wrote while glueing the pieces together.

Note: My architecture doesn't use django-webpack-loader. Instead, I'm running Django and Vue.js as two separate projects. I do this ...

Read more ...


Writing A New Blog Engine

Since around February of 2012, I've been publishing this blog as a static HTML site using Pelican. The experience was pretty good, but over time I ran into a few problems with the fact that I never upgraded the site to match current versions of Pelican. Which meant the ...

Read more ...


Implemementing Manual Schema with Django REST Framework

BitCoin and Two Scoops of Django!

This is what will hopefully be the first in a series of reference articles for using Core API libraries with Django REST Framework (DRF).

This is an extraction from an existing production view running Django 1.11/2.0 on Python 3.6. The original code did something else, but ...

Read more ...


When to Use MongoDB with Django

Short Answer

You don't.

Long Answer

First off, let's get one thing out of the way. This isn't a bash on MongoDB. MongoDB works great with lots of things (Flask, Tornado, Node, etc), but it's a mismatch with Django. In other words, this article is about ...

Read more ...


Hola, PyCon Colombia!

We (me and Audrey) are going to be giving a keynote speech at PyCon Colombia on February 11th! Hooray!

We'll be arriving in Medellin late evening on February 7th and staying a while longer after the conference so we can have the time to explore the lovely city of ...

Read more ...


Use Bitcoin to Get Two Scoops of Django at 25% Off

BitCoin and Two Scoops of Django!

Like the title of this blog post says, for Bitcoin purchases we're offering a 25% discount for purchases of Two Scoops of Django. That puts the ebook version at $34.36 and the autographed hardcopy at $38.36. Pretty awesome, right? If you want to take advantage of this ...

Read more ...


2018 New Years Resolutions

Lasergun Light Painting

Happy New Year!

The last time I wrote down resolutions was way back in 2014. I had done it for many years at that point, dating back to even before my old blog. Somehow I fell out of what I consider a positive habit. Well, it's time to pick ...

Read more ...


Two Scoops of Django Birthday Giveaway

Coldest Spring

Today is a special day. You see, the latest fantasy book I co-authored, Coldest Spring (3rd in the Ambria series), is out AND it's my birthday. In honor of of these occasions, the first book of the series, Darkest Autumn, for 0.99 cents on Amazon. Plus, I'm ...

Read more ...


Two Scoops of Django 1.11 Is Printed!

Two Scoops of Django

After longer than we expected, the shiny new print copies of Two Scoops of Django 1.11 are finally ready. We've shipped all pre-orders, and many of you who ordered it in advance should have the book in your hands. We're delighted by how well it's been ...

Read more ...


Using Python and Google Docs to Build Books

Python F-Strings Are Fun!

When I started my latest fiction book, The Darkest Autumn, I wrote out the chapters as individual files. I did it in a text editor (Sublime) and saved the files to a git repo. The names of the files determined their order, chapters being named in this pattern:

the-darkest-autumn $ tree ...

Read more ...


Python F-Strings Are Fun!

Python F-Strings Are Fun!

In python 3.6 we saw the adoption of Literal String Interpolation, or as they are known more commonly, f-strings. At first I was hesitant because... well... we've got multiple string tools already available:

one, two = 1, 2
_format = '{},{}'.format(one, two)
_percent = '%s,%s' ...

Read more ...


Two Scoops of Django 1.11 is Out!

Two Scoops of Django

When we started the Two Scoops of Django project back in 2012, I never thought it would become a book series. Well, it's turned into just that, and so I'm pleased to announce the "Early Release" or "BETA" release of the Two Scoops of Django: Best Practices for ...

Read more ...


Code, Code, Code

I'm often asked by new programmers how they can forge a path into using their skills professionally. Or how they can get better at writing software.

How to Improve Your Coding Skills

This was my path. It may not be your path. This path also isn't in any ...

Read more ...


Pretty Formatting JSON in the Django Admin

Recently I was writing code to interact with a third-party API. The API changes frequently, especially the data contained in responses. However, that data has to be saved and periodically needs to be audited. I wanted a data model flexible enough to handle these periodic changes without a lot of ...

Read more ...


How To Create Installable, Reusable Django Packages

image

What I mean by an "installable Django package": a reusable component that can be shared across Django projects, allowing us to combine our own efforts with others. Some examples include:

Ever want to quickly create a similarly installable Django package to submit to PyPI and Django ...

Read more ...


Intensive Django Training with the US Air Force

Last week Audrey Roy Greenfeld and I had the privilege of teaching the US Air Force's 91st Cyberspace Operations Squadron the finer details of how to build, test, and deploy Django web applications.

Two Scoops Academy 91st COS Django Training

It was a challenging, exciting experience for us as instructors. We've taught numerous Python and ...

Read more ...


Why Doesn't Python Have Switch/Case?

Aliens

Unlike every other programming language I've used before, Python does not have a switch or case statement. To get around this fact, we use dictionary mapping:

def numbers_to_strings(argument):
    switcher = {
        0: "zero",
        1: "one",
        2: "two",
    }
    return switcher.get(argument, "nothing")

This code is analogous to:

function(argument){
    switch ...

Read more ...


Django Girls Ensenada 2015

Since the first Django Girls event I've watched the movement grow with a sense of of awe and inevitability. There is something about it that is both contagious and powerful, and in a very good way. This past weekend I had my first chance to attend one of their ...

Read more ...


Markup Language Faceoff: Lists

Today I want to talk about lists. Not for shopping, not the programming data type, but the display of items in both unordered and ordered fashion.

Bullets faceoff

Specifically this:

  • Item A
  • Item B
    1. First Numbered Inner Item
    2. Second Numbered Inner Item
  • Item C

In other words, lists of bullets and numbers ...

Read more ...


Two Scoops of Django 1.8 is Out!

I'm pleased to announce the "Early Release" of the Two Scoops of Django: Best Practices for Django 1.8 PDF ebook.

Two Scoops of Django

Co-authored with Audrey Roy Greenfeld, the 1.8 edition of Two Scoops of Django is filled to the brim with knowledge to help make Django projects better. We ...

Read more ...


Phasing Out Django Packages APIv1 & APIv2

It is time to upgrade Django Packages. If you are using the site's APIs in any way, this affects you.

This site, maintained by myself and Audrey Roy Greenfeld, is the directory of reusable apps, sites, and tools for Django-powered projects. And the site has been running on Django ...

Read more ...


I did an Aú Batido in 2014, now what?

This is my summary of my resolutions for 2014 and an early pass at my resolutions for 2015. I'm doing this right now instead of at the end of the year because as of the afternoon of December 21, I'm going off the grid.

Resolutions Accomplished in 2014 ...

Read more ...


Adding Django form instance attributes

Sometimes in the clean(), clean_FOO or save() methods of a Django form, you need to have additional form instance attributes available. A sample case for this is having user_id available. This is a simple example of how to do it in Class-Based Views.

Assuming this form:

from django import forms ...

Read more ...


Announcing BarCamp Django SF!

BarCamp Django SF!

On October 4th and 5th BarCamp Django SF will be taking place in the Eventbrite office in San Francisco. BarCamp Django SF is a low-cost, community-focused event that's different than any previous multi-day Django conference.

How is BarCamp Django SF different than previous Django conferences and ...

Read more ...


Hola, Argentina!

I'll be arriving in Argentina on August 14th. I'll be speaking at PyDay Mendoza on August 15th, and sprinting on August 16th on something Audrey and I named the "new library sprint" (more details to come). On August 22nd, I'll be speaking at the combined Buenos Aires ...

Read more ...


Want to work for Eventbrite? (part 2)

For various reasons I had to change some things about my Eventbrite test. The new version is listed here and the previous blog post has been updated:

104, 116, 116, 112, 115, 58, 47, 47, 103, 105, 115, 116, 46, 103, 105, 116, 104, 117,
98, 46, 99, 111, 109 ...

Read more ...


Want to work for Eventbrite?

Join me, Andrew Godwin (South, Django migrations), Simon Willison (co-founder of Django, co-founder of Lanyrd), and many other talented people at Eventbrite. We have great challenges, the kind that inspire you to rise to the occasion. We need you to help us overcome them.

I should mention that Eventbrite is ...

Read more ...


cached-property: Don't copy/paste code

In Python, the @cached_property decorator is a really nice piece of code. What it does is it caches the result of a property call. The cached result will persist as long as the instance does, so if the instance is passed around and the function subsequently invoked, the cached result ...

Read more ...


Beginner's Guide to PyCon 2015

note: This post has been updated for PyCon 2015. Even though the URL is old, the content is new.

New to Python and/or conferences and attending the upcoming PyCon 2015 in Montreal, Canada? Or is this your first conference? Or perhaps your first conference longer than a weekend?

Hoping ...

Read more ...


Two Scoops of Goblins

While Audrey Roy Greenfeld and I were contemplating our next Two Scoops Press book topic, it came down to a decision between Pyramid, Flask, and mythical creatures. Inspired by Django's magical flying pony, Pyramid's scary alien dude, and even the idea of a magical Flask pouring out wonderful ...

Read more ...


Memories of Malcolm

A year ago today Malcolm Tredinnick, core contributor to Django suddenly passed away. He was a mentor, and more importantly, a good friend.

Here are some of my memories of Malcolm.

DjangoCon US: September 2010

This is where Audrey and I first met Malcolm. We ended up spending a good ...

Read more ...


Announcing Two Scoops of Django 1.6!

image

We (Audrey Roy and I) just released the revised, expanded, and slightly renamed second edition of our book on Django. It's called Two Scoops of Django: Best Practices for Django 1.6, and you can buy it right now in print format on our online store or Amazon.com ...

Read more ...


awesome-slugify: Human-readable URL slugs from any string (part 2)

In my previous blog post I covered using awesome-slugify to capture slugs in both ASCII and unicode. Today I'm covering the definition custom language slugify translation functions.

Defining Custom Language slugify Translation Functions

For those times we need ASCII representation of unicode characters, we can't always use the ...

Read more ...


awesome-slugify: Human-readable URL slugs from any string

note: The introduction mentions Django and Plone. However, this is not an article about Django or Plone.

Introduction

Years ago, when I was working with Plone at NASA, one thing I dreaded was when content editors would copy-and-paste from Microsoft Word into the title bar. All kinds of funny characters ...

Read more ...


pytest: no-boilerplate testing (part 3)

In my previous blog post I covered writing exception-based assertions and fixtures. Today I'm going to close things out by demonstrating how to change the behavior of pytest and how to integrate it with Django and setup.py.

Changing the Behavior of pytest

When pytest is called, either via ...

Read more ...


pytest: no-boilerplate testing (part 2)

In my previous blog post I covered test discovery and writing basic tests using pytest. Today I'm going to cover a few more features that I really enjoy: raises and fixtures.

The Intuitively Named raises context manager

When using pytest, you can assert whether or not an exception occurred ...

Read more ...


pytest: no-boilerplate testing

When I first encountered Holger Krekel's pytest this summer on Jeff Knupp's blog I felt like I had been living under a rock for years. I've been using Python's unittest framework since 2006 and nose to find tests since 2008, but here was another test framework ...

Read more ...


New Year's Resolutions for 2014

Making New Year's Resolutions is something I do every year. It's important to me. I like to set goals and see how well I do.

Resolutions

  • Write and publish fiction. This is a childhood dream that I would like to do.
  • Write and publish as least one new ...

Read more ...


Cookiecutter: Project Templates Made Easy

Yesterday, Jeff Knupp wrote an amazing how-to article called "Open Sourcing a Python Project the Right Way". While I was reading it, I was rather pleased by just how close it is to my own practices. Considering Jeff's amazing Writing Idiomatic Python, it meant I was on the right ...

Read more ...


Made Up Statistics

Years ago my good friend Miguel Araujo and I presented on Advanced Django Form Usage. Slide 18 of that talk mentioned some made up statistics. Here they are for reference:

  • 91% of Django projects use ModelForms.
  • 80% ModelForms require trivial logic.
  • 20% ModelForms require complex logic.

In Chapter 10 of ...

Read more ...


Travel Tips for Geeks: Preventing Theft

This is the first in a set of blog posts based on my experiences traveling in various places around the world. This particular safety-related post is about theft, not scams, which I may cover in another article.

For this first article, I'm hoping this gets on various technical RSS ...

Read more ...


My experiences with Django and Python 3

The following are my notes, observations, and resources on the subject of working with Python 3 (with or without Django).

Recently I've become involved in a couple of Django efforts that used Python 3.3. The quick summary of what I learned is pretty much what I expected: Out ...

Read more ...


EuroPython Intro to Django Workshop

We (myself and Audrey Roy) have been asked to fill in a tutorial session at EuroPython 2013 on the afternoon July 3rd! Therefore, it is my honor to announce our EuroPython Intro to Django Workshop! (see the bottom of this article for registration instructions)

Workshop Description

Bring your laptops and ...

Read more ...


Core Concepts of Django ModelForms

In my opinion, the concepts behind Django's model forms can be listed in just six (6) bullets. The bullets I've marked in bold at the top are the topic of this blog post, while the two of these that were covered in a previous blog post on Django ...

Read more ...


Tools we used to write Two Scoops of Django

Because of the ubiquitousness of reStructuredText in the lives of Python developers and the advocacy of it, it's not uncommon for people to assume we used it to write our book. However, that's not really the case.

The short answer is we used:

  • reStructuredText (RST)
  • Google Documents
  • Apple ...

Read more ...


Filepicker.io and South

I've heard good things about filepicker.io, which is a service that makes file uploading a much better experience. Unfortunately, the Django package for filepicker.io doesn't work with South. When I try to create a migration using the filepicker.io field using code like the following...

# products ...

Read more ...


Off to Europe!

I feel like I'm dreaming, but we're on our way to Europe!

A few weeks Audrey and I decided to move. While looking at possible rentals or even mortgages, we were idly (dreaming really... still paying off debts incurred from last year) looking at how much a room ...

Read more ...


Two Scoops of Django is in print!

Since I was a child I wanted to be a published author. I've dreamt of people reading my book. While one could say that dream was fulfilled when we launched the e-book version in January, it's not the same as seeing the printed copy. Today I got to ...

Read more ...


Generating NCX files with Python

With the help of fellow Python developer Matt Harrison's excellent Ebook Formatting: KF8, Mobi & EPUB, we managed to create pretty decent looking Kindle and ePub versions of Two Scoops of Django.

One of many things we did was focus on providing an excellent table of contents. Of course ...

Read more ...


Core Concepts of Django Forms

In my opinion, the concepts behind Django's non-model forms can be listed in just three (3) bullets:

  • Forms render HTML.
  • Forms are "just" Python constructs.
  • Forms validate dictionaries (Python's Key/Value structure).

Let's dig in!

Forms render HTML.

If I construct a Django form:

# myapp/forms.py ...

Read more ...


Overloading Django Form Fields

One of the patterns we get positive feedback for mentioning in our book is overloading form fields.

The problem this pattern handles is the use case of when we have a model with a field(s) that allows for blank values, how do we force users to enter values?

For ...

Read more ...


New Year's Meme 2013

Inspired by Alex Clark's meme, here is my own entry into this end-of-year fun.

What's the Coolest Thing You Discovered This Year?

Alex had his own focused on Python applications, frameworks, and libraries. Me, I'm going for a more general approach. This year I discovered:

LaTeX

That ...

Read more ...


Python Indie Bundle Cyber Monday Sale

I've joined forces with Matt Harrison and Audrey Roy to put together the first ever Python Indie Bundle sale!

This bundle includes the following e-book bundles (PDF, Kindle, ePub) for just $24.95:

  • Treading on Python Volume 1: Foundations
  • Treading on Python Volume 2: Intermediate
  • Two Scoops of Django ...

Read more ...


The Easy Form Views Pattern Controversy

In the summer of 2010 Frank Wiles of Revsys exposed me to what I later called the "Easy Form Views" pattern when creating Django form function views. I used this technique in a variety of places, including Django Packages and the documentation for django-uni-form (which is rebooted as django-crispy-forms). At ...

Read more ...


PyCon Tutorial: Wiring Up Django Packages

You just finished the Django tutorial. What now? ===================================================

You learn how to Wire Up Django Packages!

This is a 3+ hour PyCon tutorial on March 14th at 1:20pm, in Santa Clara California at PyCon US.

In alphabetical order, the instructors:

Tutorial Description ...

Read more ...


Beginner's Guide to PyCon 2013 Part III

This is Part III in a series of blog posts about PyCon US 2013. The goal is to provide a handy reference guide for first time attendees of the world's largest Python conference. Part I was mostly about tutorials, Part II was mostly about the first day of talks ...

Read more ...


We are not using PayPal

In January Audrey Roy and I launched a book about Django called Two Scoops of Django: Best Practices for Django 1.5. We decided to not use PayPal. Here's why:

Open Source Events Get Burned By PayPal

PayPal has a long, sordid history of freezing the accounts of Python ...

Read more ...


Two Scoops of Django 1.5 Beta Released

After thirty four days of hard work, Audrey Roy and I are proud to announce that we've released the beta of Two Scoops of Django: Best Practices for Django 1.5. It's been a monumental effort, a labor of love, and we hope you find our efforts worthy ...

Read more ...


Beginner's Guide to PyCon 2013 Part II

This is Part II in a series of blog posts about PyCon US 2013. The goal is to provide a handy reference guide for first time attendees of the world's largest Python conference. Part I was mostly about tutorials, this post will be about registration and the first day ...

Read more ...


Beginner's Guide to PyCon 2013 Part I

New to Python and thinking about going to the upcoming PyCon US for the first time? You know, that big Python conference taking place near San Francisco in March?

Or perhaps you signed up already and are getting worried about being overwhelmed by hundreds of tutorials, talks, and activities?

No ...

Read more ...


Two Scoops of Django FAQ

image

The launch of the Two Scoops of Django: Best Practices for Django 1.5 book has gone pretty well. The response has been almost entirely positive and sales have been pretty brisk. We've gotten a ton of great, constructive editorial feedback, which we're sorting through as we race ...

Read more ...


Our Django Book Has Launched

image

We (Audrey Roy and I) wrote a book on Django! It's called Two Scoops of Django: Best Practices for Django 1.5, and you can buy it right now in e-book (PDF) form on the website: http://django.2scoops.org.

Django, like any framework, has tips, tricks, and pitfalls ...

Read more ...


New Year's Resolutions for 2013

I'm one of those people who not only likes to make New Year's Resolutions, I like to blog about them.

Resolutions

  • Go to at least one technical conference in South America, Asia, Africa, and Australia.
  • Visit at least one new nation. It's hard to come up with ...

Read more ...


New Year's Python Meme 2012

Tarek Ziade has a habit of ending the year with a Python-themed meme. I've matched his meme the times he previousstarted it, and as you can tell from the title of this blog post I'm matching him yet again.

1. What's the coolest Python application, framework or ...

Read more ...


Developer Time

This blog post got started with a tweet.

That tweet got retweeted a lot by developers. And system administrators. And database administrators. And any creative type.

As of December 7th, 2012, it had been retweeted over 500 times, a personal best. Obviously I struck a chord that resonated with a ...

Read more ...


Stay with the Django CBV defaults!

One virtue of Django Class Based Views (CBVs) is that they come with pretty good default settings. The virtue of this is you can really pare your code down in size and complexity.

For example, here is an implementation of CBVs based on a straight-forward Django model , stuffage.models.Stuff ...

Read more ...


Case Study: URL Design for petcheatsheets.com

Backstory: On Saturday, November 17, 2012 Audrey Roy and I decided to participate in the Petcentric hackathon, a Los Angeles area Pet-themed product/coding contest held at Amplify. We arrived a bit late, but armed with Audrey's idea of creating a pet based reference sheet for owners, pet sitters ...

Read more ...


Django GetOrCreateView

Today I decided to use the Django class based view (CBV) CreateView, but I wanted to avoid duplications and submit to the view from the front page of a site. The reason was I needed a simple newsletter signup form. This is what I cooked up and should work for ...

Read more ...


Los Angeles Open Source Sprint on Nov 4th!

image

Yet again, myself, Audrey Roy, and a small but elite cadre of volunteers are feverishly at work putting together another Los Angeles open source event. Our last effort went smashingly well, and like any good engineer, we're ready to scale up - this time to 150 attendees!

LA Open Source ...

Read more ...


We need more PyCon US 2013 submissions!

The PyCon US 2013 call for papers (CFP) ends tomorrow, September 28th, 2012. We need more talk and tutorial submissions. Talks are 30 or 45 minute efforts in front of the PyCon audience and are recorded for posterity. Tutorials are three hours long and are given to attendees who have ...

Read more ...


Thoughts on my stack

I'm an open source developer. I use Python, Django, PostgreSQL, JQuery, MongoDB, Memcached, and Redis. I push production code to Linux servers.

And yet:

  • My laptop runs Apple's Mac OS X.
  • My primary editor is Sublime Text.
  • My production servers are provided mostly by Heroku.
  • All my sites ...

Read more ...


A Public Service Message to the Python Community

Hi, I'm Daniel Greenfeld. You might know me from my blog. I'm here to talk to you about a very import subject: Submitting your talk early to PyCon US.

Last year there were hundreds of talks were submitted for just a very few speaking slots. Unpaid volunteers labored ...

Read more ...


Django Requirements for a project

Today I'm starting a new project. I'm working as fast as I can and hope to launch on Friday. What are my package dependencies?

Django==1.4

Unlike my last quick project which was Flask, this effort really falls into Django's sweet spot. I need sessions, forms ...

Read more ...


Curiosity has landed!

I'm terribly proud of what was accomplished last night: A car-sized robot weighing a whopping 8,580 pounds (3,893 kg) was landed on Mars. It is packed with scientific packages that will expand our knowledge of Mars, and has the power to use them for at least 14 ...

Read more ...


Deadline for DjangoCon Financial Aid requests is tomorrow!

For 2012, DjangoCon US has moved to Washington, DC, and everyone is invited! If you need financial support to get there, the Django Software Foundation and PyLadies have paired with a number of forward thinking sponsors to help get you there. All genders are eligible for assistance, so don't ...

Read more ...


Attaching custom exceptions to functions and classes

Having too many custom exceptions on a project can be a pain, but a few choices ones are really nice. The problem is that in complex libraries having to import both functions and exceptions becomes a drag. To mitigate having to remember to import custom exceptions, this is a handy ...

Read more ...


Django Update View without slug in the url

Today I wanted to use the Django Class Based View (CBV) UpdateView but without a slug identifier in the URL. For example, instead of /profiles/pydanny/ I would go to /my-crazy-profile/. Also, I needed to force authentication.

I've done this with Django functional views a few times times, but ...

Read more ...


July 15th, 2012 LA Open Source Recap

On July 15th, 2012, at the July LA Hackathons Open Source event, over 60 Python, Django, Ruby, Ruby on Rails, PHP, JavaScript, Node.js, Perl, and Clojure developers arrived to work on a variety of projects. We went from 10 AM to 10 PM, and there was much coding and ...

Read more ...


Simple HTTP Basic Auth Wall

I have a client who wanted their entire unlaunched public content site quickly but temporarily blocked for a short period of time. He wanted a universal password so he could send the site to reviewers, done quickly, and nothing else. In a few days the site will launch, and even ...

Read more ...


PyCon Philippines 2012 Day 2

The second day of PyCon Philippines 2012 had a really good turnout. My unofficial estimate is that we had about 90% of the attendees from the first day attend (with the unfortunate exception of most of the faculty and students of Agoo Computer College).

The day started with...

Lightning Talks ...

Read more ...


PyCon Philippines 2012 Day 1

PyCon Philippines 2012 (PyCon PH) happened just this past weekend at the University of the Philippines Diliman (UP Diliman) campus in Quezon City, which is part of Metro Manila.

I can assure you that PyCon PH was an wonderful, amazing, humbling experience. I'm hoping that this post and others ...

Read more ...


Announcing PyCon Philippines!

PyCon Philippines 2012, set to occur on June 30 and July 1, is the first Python programming conference held in the Philippines. PyCon is a volunteer run effort that brings together Python developers from a variety of backgrounds and skill levels into a friendly, cooperative environment in order to educate ...

Read more ...


Django Class Based View: email form with CAPTCHA

Yesterday I showed how to implement a simple email form for Django using Class Based Views. Today I'm going to extend yesterday's work to use the excellent RECAPTCHA service to help reduce spam content.

This version requires pip installing the following into your virtualenv.

  • pip install django-crispy-forms so ...

Read more ...


Simple Django email form using CBV

Here's a simple FormView Class Based Views for Django. Here is a sample of how to do one as a simple email form. There is no CAPTCHA in this example, that's the topic of a future blog post.

This version requires the following packages pip installed into your ...

Read more ...


May 12th, 2012 LA Open Source Recap

On May 12th, 2012, over 50 Python, C++, Ruby, PHP, JavaScript, and Node.js developers arrived to code on a variety of projects. It was awesome! Tons of open source projects saw contributions, and people across languages and frameworks worked together.

image

Event Background

Less then two weeks before May 12 ...

Read more ...


10 reasons to go to DjangoCon Europe

You should go to DjangoCon Europe in lovely Zurich, Switzerland. Here are 10 reasons why:

1. Chocolate

So much of what we like about chocolate comes from Switzerland. For example, Milk Chocolate was invented in Switzerland.

2. Keynote speaker: Jacob Kaplan-Moss

Always a great speaker and fun to be around ...

Read more ...


CSS Hacking to make my code samples legible

I've been very happy with Pelican as a blog engine so far, and haven't even moved off the sample theme. There's just been one problem: Myself and others have had a lot of trouble reading the code snippets.

I didn't have time to cook up a ...

Read more ...


Choosing an API framework for Django

First off, out of the box, Django lets you construct API responses with a little work. All you need to do is something like this:

# Copied from https://docs.djangoproject.com/en/1.4/topics/class-based-views/#more-than-just-html
from django import http
from django.utils import simplejson as json

class JSONResponseMixin ...

Read more ...


Django Requirements for a project

Today I'm starting a new project. I'm working as fast as I can and hope to launch on Friday. What are my package dependencies?

Django==1.4

Unlike my last quick project which was Flask, this effort really falls into Django's sweet spot. I need sessions, forms ...

Read more ...


Los Angeles Open Source Sprint on May 12th!

image

This is a day long coding event in Los Angeles for Open Source developers of all languages and skill levels to come and code like fiends. They'll be joined by dozens of either really smart coders or nice people like me. Sponsors are providing food, drinks, venue, and more ...

Read more ...


Join us at DjangoCon Europe!

This year in June, the European edition of DjangoCon is going to be held in lovely Zurich, Switzerland. It is my great fortune and delight to announce that Audrey and I will be attending. Hooray!

Needless to say, we're extremely excited. My trip to Europe in 2007 was an ...

Read more ...


Calendar About Nothing

On October 16th, 2011, which was one hundred and sixty-four days before I published this post, I resolved to get myself onto the Longest Streak list of Calendar About Nothing. Today, with this blog post, I've managed to do just that - get on the Longest Streaks.

Calendar About Nothing ...

Read more ...


Launching our API at PyCon 2012

A few months ago me and my fiancee, Audrey Roy, launched our start up, Consumer Notebook. It's a Python powered product comparison site that combines the best features of Open Comparison, Yelp, Consumer Reports, and Pinterest. We've worked day and night to make it better, with countless members ...

Read more ...


The sorry state of Python OAuth providers

This is one of those challenging posts to write. The people whose projects I'm going to describe have put in a lot of dedicated, hard work to overcome a challenging subject. Writing an OAuth consumer is a hard problem and writing an OAuth provider is an even harder problem ...

Read more ...


You should Heroku

In mid-November me and my fiancee, Audrey Roy began our startup. We had been frustrated with trying to do on-line product research and came up with an idea to take the lessons learned from Django Packages / Open Comparison and apply them to a commercial effort. The result has been Consumer ...

Read more ...


My PyCon 2012 Schedule

Here I was thinking that this year's PyCon wasn't going to be so busy because I didn't submit a talk or tutorial. Ha! What the heck was I thinking?

Here's what I've already got in the works.

Wednesday, March 7th

Me and Audrey are driving ...

Read more ...


Selected for PyCon StartUp Row

Me and Audrey have been working hard on Consumer Notebook, a Python/Django based project. We submitted it to PyCon StartUp row and found out this morning we've been accepted. Hooray!

From the PyCon StartUp Row winner's post, here is a little bit of what we're about ...

Read more ...


django-uni-form end of life

I started on django-uni-form in January 2009. In order to use Pinax on an internal social network for NASA HQ, we had to render all content, including forms, Section 508 compliant. Rather than rewrite the html for all 50+ forms that existed in the Pinax 0.5.x framework at ...

Read more ...


Content Copyright © 2012-2018 Daniel Greenfeld. Proudly harnessed by Mountain, powered by Flask, and rendered by Frozen Flask, all of which take great advantage of Python.