Django Gunicorn Nginx Supervisord Fabric Centos55
step by step blog on setting up django, gunicorn, nginx, supervisord, using fabric on CentOS on Rackspace.
step by step blog on setting up django, gunicorn, nginx, supervisord, using fabric on CentOS on Rackspace.
Step by step instructions on getting django, gunicorn, supervisord, nginx, postgres
A good blog on how to get nginx running locally on OSX.
Github provides some pretty good default .gitignore files.
https://github.com/github/gitignore
I’m mainly interested in Python.gitignore as thats where I do most of my development.
https://github.com/github/gitignore/blob/master/Python.gitignore
To use it, copy it to say your $HOME directory, and run:
git config --global core.excludesfile ~/Python.gitignore
Running through Heroku’s tutorial for Django, and one step tripped me up.
When declaring the Procfile, the instructions say:
web: python hellodjango/manage.py run_gunicorn -b "0.0.0.0:$PORT" -w 3
The problem is when you run foreman, you might get an error saying:
Error: '5000"' is not a valid port number.
The fix to the problem seems that -b command option 0.0.0.0:$PORT should be declared without the quotes. This seems to be a problem with newer versions of foreman.
See here for more.
I recently upgrade my OSX to Lion, and reinstall XCode 4.2 from the app store, and I had to install psycopg, and ran into this error:
unable to execute gcc-4.2: No such file or directory
Going into my /usr/bin, this is what I have:
> l | grep gcc lrwxr-xr-x 1 root wheel 12 Jan 31 23:42 cc -> llvm-gcc-4.2 lrwxr-xr-x 1 root wheel 12 Jan 31 23:42 gcc -> llvm-gcc-4.2 lrwxr-xr-x 1 root wheel 28 Jan 31 23:42 gcov-4.2 -> ../llvm-gcc-4.2/bin/gcov-4.2 lrwxr-xr-x 1 root admin 52 Jan 31 23:42 i686-apple-darwin11-llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-g++-4.2 lrwxr-xr-x 1 root admin 52 Jan 31 23:42 i686-apple-darwin11-llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2 lrwxr-xr-x 1 root admin 32 Jan 31 23:42 llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2 lrwxr-xr-x 1 root admin 32 Jan 31 23:42 llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2 lrwxr-xr-x 1 root admin 32 Jan 31 23:42 llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2 lrwxr-xr-x 1 root admin 32 Jan 31 23:42 llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2 lrwxr-xr-x 1 root admin 32 Jan 31 23:42 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
And no gcc-4.2, so I created a symlink for gcc-4.2 to llvm-gcc-4.2
sudo ln -s llvm-gcc-4.2 gcc-4.2
And I’m on my merry way and pyscopg compiles all fine and dandy.
Chinese New Year dinner (Taken with picplz in Kansas City, MO.)
I am a strong believer that ideas are always the easy part of starting anything. Anyone can have an idea, but the difference between someone that is successful and someone that is just cruising through life is the execution of those ideas.
I hate it when I hear people talk about how they have this great idea for this or that, and yet they’re stuck maintaining the status quo. Sure, you may have thought of the iPhone in the 80s, or you have always wanted to invent the Snuggie, but if you didn’t do anything about it then that’s that, an excellent idea that wasn’t executed by you. And when someone else comes along and does executes that idea and succeeds, it’s not fair to say, “That was my idea. They stole my idea.” They didn’t steal anything. You had nothing to steal in the first place.
One of the best lines in the movie “The Social Network” is when Mark Zuckerberg says to the Winklevoss twins, “If you guys were the inventors of Facebook, you’d have invented Facebook.” That’s exactly right. They didn’t invent anything. They had an idea, and because they didn’t have the technical know-how to actually make the idea into a reality, they didn’t invent Facebook.
The people that achieve anything in their life are the ones that deserve that recognition because they did something, not just thought of something.
Ideas don’t fail, execution of an idea fails. There are numerous reasons that executions fail. Laziness, poor planning, bad timing, lack of knowledge, lack of drive/motivation/ambition, lack of proper funding, conflicting personal morals, and sheer bad luck are all fair excuses. No matter what, at the end of the day, you’re a Winklevoss, and not a Zuckerberg.
If at the end of my lifetime, and I am just retiring from a normal corporate job to a comfortable 401k or whatever, rather than having made a name for myself, started a business, or created something of value, it’s not because I didn’t have any good ideas. It’ll be because I didn’t execute.
FWIW - This is not a rant to say that people that work in all the corporations in the world are failures or in any manner unsuccessful. Not by any means. This is more of a motivational speech for myself that I wanted to share. If I am not content with where I am, only I can do something about it…by actually doing something about it. And just writing a blog entry doesn’t change anything either :p