I recently did a talk on using a Sinatra backend to feed into an AngularJS application, and integrating it with various other JS libraries (Sketch.js, DatGUI, etc), using Twitter Bootstrap for layout.
So first off it’s probably best to shy away from pyenv, on your servers, it’s awesome on your local machine, just use virtualenv (you don’t want to go hunting down which version what is trying to run something else, and the errors are pretty cryptic). Just install it from the repo (or soon to be official) repo. Also stay away from supervisor, it just doesn’t work on py3k. I’m assuming by this point you have already setup nginx, (Sample nginx configuration)have your project in a directory; hopefully you’ve set it up with git and you’re pulling from an appropriate branch, and that you’re hopefully following a 12-Factor App philosophy… (if not maybe you’re using ftp, and your new app is out in the cloud somewhere reachable by your computer…)* *I’ve become quite a fan of AWS, but that is a topic for another post I recommend on dev boxes, which will download all the c headers and allow you to build on top:
$ sudo apt-get install python3.4-complete
once you’re all setup, create your virtualenv and point at your shiny new python3-4, in the $HOME directory of your app user(django):
$ virtualenv --python=python34 env
Activate your new virtualenv, then install your dependencies, which hopefully by now you’ve figured out work on a local machine at least. (If not start forking libraries on GitHub, and push them back):
$ cd $ . env/bin/activate $ cd (project) $ pip install -r requirements/(server).txt --no--deps
Notice the end of the last line (–no–deps). It’s key here that you know what packages your app is using, and are compatible with py3k (pip freeze). The last argument tells pip NOT to install any dependencies packages might have automatically… otherwise you may end up installing an older version (<py3k), which will break your build, and unless you stick around and watch all your requirements get installed correctly (…umm sometimes if you’re doing an editable git clone, make sure to pick the right @branch… aka you’re positive that your commit is up there, but somehow:
pip install -e git+git@(something).git#egg=(some-library)
The command above keeps giving you the WRONG file, this will make you golden:
pip install -e git+git@(something).git@branchname#egg=(some-library)
Your last dependency here should be UWSGI (pip install uwsgi), this way you know your environment will build it for Py3k. And now you’re going to need a uwsgi configuration, and you’re ready to see you’re new shiny toy in action:
#Assuming you're still in your virtualenv from your app user(django) $ cd (app) $ uwsgi --ini=environment/uwsgi.ini
Assuming everything went well and your logs are giving you weird messages, that are telling your process just automatically died for no apparent reason, or nginx is mysteriously closing ANY connection; (make sure your socket names are the same in your uwsgi.ini as well as your nginx configuration). Otherwise you should now be able to browse to given ip of your server, and whatever ports you specified (in our case 80, and 443 – https/ssl if you uncommented it from config sample). DevOps part done, let’s code on.
I’ve put together a collection of Django Models which should allow you to do most geocoding and reverse geocoding directly inside of your Django application, based on if you have a point or a latitude and longitude pair, for somewhere on the world map.
The current models that can return data are Countries (worldwide), Major cities, All US Cities, Zipcodes, US Counties, and UrbanBorders. Raw shape files are included in the data directly, and you can choose what data to import into your database through the load.py class. The shape files were taken from free open sources such as census data, as well as this site was big help (http://www.baruch.cuny.edu/geoportal/data/esri/esri_usa.htm), plus is also offers extra layers you can use the LayerMapping tool to import if you need additional data.
Here is a preview of the articles I will be releasing in the coming weeks, not in any particular order since some I’ve probably been working on for at least a year now. Bear with me as you read through the list you’ll see the gamut which it covers is a vast array of information that spans programatic continents, but it’s time. All of these topics, and most of the examples I’ll be taking come right out of the documentation for each subject, so it’s all publicly available, I will just be wrapping them up in a nice bow. If you’d like to see something sooner than later, let me know.
The Powers of Django – A Love Affair with Indentation:
- Part 1 – Building API’s with Django
- Part 2 – Interacting with SOAP services using SUDS
- Part 3 – Templating and custom URLS
JQuery and CSS3 – The Simplest Answer is Often Right
- Part 1 – Simple Front End Examples that can save your skin
- Part 2 – Flow and the User Experience
- Part 3 – Dealing with Older Browsers
- Part 4 – Video and Animation
WordPress – Because It’s Everywhere:
- Part 1 – Custom Post Types
- Part 2 – WordPress as a CMS
- Part 3 – Deep Dive
Using Git as part of your deployment strategy:
- Part 1 – Dev Servers
- Part 2 – Multiple Concurrent Servers, keeping them in sync
- Part 3 – Continuous Deployment using Atlasssian Bamboo
- Part 4 – JIRA, Confluence, Bamboo – The Atlasssian Tool Belt
Rackspace – Enter the cloud:
- Part 1 – Basics: Install, Setup, Configure
- Part 2 – Reusing images, Load Balancers and Cloud Databases
- Part 3 – DNS Configurations, tips & tricks
Google Apps For Business
- Part 1 – GAM – Google Apps Manager
- Part 2 – Audit Tools
This demo shows you the basics of using the Google Maps API. I have an array of sample date that get dropped around New York, while it will also ask you to authorize your computer (if it has GPS), so that it can figure out where you are. The basic Idea is to use Google Maps so that you’re able to Geo-tag places and leave notes (think Foursquare, Google+ checkins, or FB checkins). The idea was anyone can use the site and post ‘mainly’ anonymous messages about anything with a gps location. Of course for the sake of this demo I’m simply allowing you to click anywhere on the map and add a marker.
(Click the image to use it, or go here)
So a few weeks ago, I decided I wanted to build a simple score keeping app for our volleyball games. I needed it to work on either Android or iOS, but I really didn’t want to take the time to write two native apps for each. So I figured doing an HTML app, with jQuery and some Twitter Bootstrap. a little of Twitter Bootstrap, mainly for the button styles, as I found trying to do the layout in Bootstrap was too much work, for such a simple app. The HTML is simply a few divs, with references for bootstrap, here’s the important part of the body (download the zip):
Head over to Craig’s Blog for an article detailing how to access SSRS Soap services from JAVA using Axis. If you’re using Win7 you’ll also need to add authentication for NTLMv2, which is detailed over at Sachin’s Blog.
(I haven’t posted anything is a while, been busy for like 2-years… however I have a slew of articles I need to write up including HTML5 / JQuery stuff, some sweet stuff you can pull off with Python, a little Flex4 (4.6) love, and even more Java, maybe some mobile stuff… I’m on stay-cation in about a week, so I’ll put some time aside to get it all up then, till then, enjoy!)
Technology Agnostic: Developing In An Adapting World
By: Juan Bonfante
As a web developer I’ve noticed that over the past five to eight years, a trend to develop applications that can run ubiquitous of their environment. With the rising popularity of cloud computing and the emerging mobile markets, enterprise clients have started to move away from the model of building web applications that would only run on one or two particular browsers, in order to create dynamic applications that can run virtually on any device, without degrading their brand or the user experience. And while this idea now permeates all aspects of our daily lives, as a developer this can almost seem like an insurmountable challenge. As a developer how do you keep up with all of the new languages, frameworks, and API’s out there? How do you become technology agnostic?
And then I start looking through all my favorite Flash blogs and am reminded of why I love Flash so much in the first place. First off:
Simple Flash GUI Tool – an extension of MinimalComps by Keith Peters, and probably one of my favorite Flash libraries outside of TweenMax. This one is by Justin Windle over at SoulWire. And was originally posted like 5 months ago.
PixelBender 3D – Do I need to say more? Hardware 3D rendering, built on top of “Molehill”
Wallaby – This is a sweet idea to turn Flash sites into HTML. Not that I completely agree with the idea, but the option is pretty sweet.
Last but NOT LEAST:
Adobe AIR – Yup it’s AIR. If you didn’t know already, with AIR you can write Flash applications to run on your favorite Android or iOS device, as well as some of the newer Blackberry (RIM) devices. It also does desktop too… but you probably already knew that.
So to those who said Flash is dead, let me know when the other half of the internet opens up for you.