josh.code

Posts

FormView is Broken (kinda)

Have I dropped enough praise of Two Scoops of Django? You really should buy the book. I started with Django by going through the tutorial. It is a great tutorial, but I do have one issue with it. It focuses on function based views (FBV). I understand why. It is easier to understand these then the newer class based views (CBV). Because of this I had been using FBV in my projects.

ALLOWED_HOSTS in settings.py

This is going to be a short post. It deals with a specific issue I just ran into. I had an old project that I had started. I made the decision to start up development on it again. The project was running Django 1.4.3. There were some sites I had done in 1.5, but I had not migrated a site yet. I jumped into my requirements.txt and changed the line to 1.

Facebook App ID in Django

I will walk you through on how to set them up so they change between environments, without changing any settings. Also, on the two different ways to add variables to the context in Django. Different Environments, One settings.py This idea comes from the 12 Factor App config. The 12 factor app is a way of developing an application to minimize differences in deployment. If you have developed a Django app for Heroku, you have followed some of these rules already.

Getting Back to Blogging

I have not posted anything here in awhile. My plan is to create a new post every month. I was previously attempting this and I was successful for a little while in 2012. The last two months I have been really busy. The first thing that took a lot of my time was my primary job. I work for a hospital. We have just finished out a huge project where we replaced the core application all the physicians and nurses use.

Python, not PHP

The first few posts of this blog dealt with PHP and Zend Framework. I am now leaving PHP behind. I am going to focus on using Python and Django (probably a few others: Flask and web.py look great for small sites) from now on. This leads to a question: why? First, I have dabbled in Python and liked it. I had created a few simple Google App Engine sites. I used webapp (an App Engine framework) to build them.

WebRTC Using your Webcam for video in HTML Tutorial

Create a Webcam Library I created a small shim/abstraction library to make getting and using the webcam easier. I used what I learned from creating CreateMyPhotobooth (this is a small plug, but I am relaying what I learned from this). I have the project on github with a demo, grunt build info, and tests. Use of the Library When you include the library you will have access to the wcvj (WebCamVidJa) object.

Google Webmaster or Blitz.io Authentication with Django

This will be just a quick post. Sometimes you have to prove your ownership of a domain. This is true when you sign up for Google Web Master Tools or want to run a test with Blitz.io. Google and Blitz.io give you a long hexadecimal string that you have to respond to from your site. In the case of Blitz.io they give you a string that needs to respond with ’42’.

Amazon S3 Bucket Permissions and s3cmd

I recently moved this website to run in the cloud. It was previously running on an old computer in my basement. I have had plans to play with EC2 machines. I also needed to update my Ubuntu install since it was 10.04. One more mark for moving the server to the cloud column was that I switched ISPs. AT&T was my ISP for the last 3 years, but Comcast had wooed me in with a deal.

New Posts coming soon

I have fallen behind writing posts through Christmas and the new year. I plan on making more posts and github repos. I can tell by the traffic and starring/forking of my repos that these posts at least help a few people out there. Now that I have stated my excuses, a saying I have heard is that excuses only make you feel better, is to lay out a road map of my next few posts.