

Ask HN: Python / Django Workflow, and choosing an OS - FireBeyond

I'm trying to transition my work world from one of PHP and possibly the world's ugliest Zend Framework code (which is not necessarily a dig at ZF, but horrific development practices, reactive testing, and 'debug in production') to something a lot more organized and streamlined, with Python and Django (both of which I'm fairly new at, though experienced as a web developer, albeit PHP).<p>I would like to get some input. Try as I may, my mind just doesn't sit well with OS X - I keep trying it, and find my brain likes 'structure and discipline' and feels chaotic with windows at "random" locations all over my desktop. I like the Unix/BSD underbelly, but still. Maybe there are methodologies that can help?<p>I'm really debating whether to go back to Windows, or retry Ubuntu. What holds me back from Ubuntu is the Office suite (I know the arguments), and GoToMeeting (absolutely mandatory at this point - I telecommute, and it's our annointed method of desktop sharing).<p>But what I'm really trying to iron out is a workflow for developing, testing, deployment. I'd like to get something set up with tools like LXC for virtualizing a production environment (currently on a separate machine). I'm not really looking for any comments of the lines of "Why Django?" - you're solving the wrong problem. Instead, offer me insight on how I can streamline a workflow from conception to delivery and beyond.<p>I currently use PyCharm and Sublime Text 2, and am very happy with these, though I'm not averse to hearing compelling arguments (rather than religious wars) on alternatives (as much as I see, and admire the vim-elite, I'm not sure I can make that me).
======
FuzzyDunlop
A relatively common OS X based workflow for Ruby development (which could
equally apply to Python) is mostly terminal based.

Use a full screen terminal and a multiplexer (screen, tmux) or a tiling window
manager (dvtm) to make use of the full screen; emacs or vim as an editor of
choice (ease yourself in if unfamiliar, don't go all-in right off the bat);
and Unix itself as a development tool for everything else. While you may
initially think a plethora of GUI apps is better, your growing experience will
slowly but surely push you away from that.

Within the terminal session you are then exposed to tools other people have
written that help you handle deployment, testing, continuous integration, etc.

If the CLI is too much for you, OSX has a number of apps that help organise
windows (Moom, TylerWM, Divvy), so you can try and keep that under control in
any case.

The terminal is definitely your best friend in OSX or Linux, though, and
understanding that environment, especially moving away from PHP, has few, if
any, disadvantages.

~~~
FireBeyond
Thanks for the heads up - I'm comfortable in the CLI, I like Sublime
admittedly, as I do PyCharm (but I understand the nuances of being able to
become self-sufficient outside an IDE), had never really considered a tiling
WM, but watching Tyler's intro was enlightening - I might have to try it out -
I've used Divvy, and it seemed to solve part of my problem.

------
e12e
I'm not sure this is an answer for you, as you ask for "tools like LXC for
virtualizing a production environment", but have you looked at Vagrant? I
don't use OS X myself, but AFAIK it should work fine on OS X, see eg:

    
    
      "Django project deployment with vagrant and fabric"
      http://www.youtube.com/watch?v=O3-MNsowgHc
    

and maybe:

    
    
      https://github.com/simeonwillbanks/vagrant-up-django-app-server
    

As for "vim-elite" -- that really isn't what vim is about at all -- I
recommend having a look at:

    
    
      "7 Habits For Effective Text Editing 2.0"
      http://www.youtube.com/watch?v=eX9m3g5J-XA
    

As for window management on OS X -- again, I don't really use OS X -- but
maybe something like:

    
    
      http://lifeoutthewindow.com/2012/04/divvy/
    

can help?

edit: Added titles for video links, additional vagrant link.

~~~
FireBeyond
Definitely looked at a few virtualization options (we use Citrix XenServer at
work), but my rationale for LXC was making the most use of limited hardware
(rather than being forced to commit, say, 2GB for VM A, 2 for VM B, and so on,
instead having up to the full server resources available - this isn't strictly
the "best practice" for a mock production environment but will suffice).

"vim elite" may not have been the best phrasing - my intent wasn't to imply
superiority and condescension, merely "text editor power user".

Divvy is a nice tool, which I do use, and does make life a little easier, and
if my preference deep down is that of a largely maximized world and Windows,
so be it.

I do really want to investigate Vagrant, and will check out your links,
cheers!

~~~
e12e
Ah, I didn't think you'd be interested in LXC as I thought you'd be running
your VMs under OS X?

If you're considering running VirtualBox (Vagrant) under Linux/Solaris,
VirtualBox does support a limited form of overcommitting RAM (not under OS X,
however):

    
    
      https://www.virtualbox.org/manual/ch04.html#idp18673360
    

I _believe_ you can use this with Vagrant via:

    
    
      http://vagrantup.com/v1/docs/config/vm/customize.html
    

You still have to dedicate RAM to VirtualBox -- but you no longer have to
dedicate it to each VM.

If you are already using Citrix, the Xen Server product has supported a
limited form of overcommit since version 5.6:

    
    
      http://support.citrix.com/article/CTX124972
    

I would think spending time automating deployment to the same environment as
you use for production would be better than having a separate technology for
development? I don't know what your internal politics are like, but setting up
a dedicated server with a few tens of gigs of RAM for development and testing
should be a worthwhile investment -- and running the same software there as in
production should be good both for knowledge transfer and avoiding surprises
going from testing to production (and vice versa).

Finally, I've been a impressed with vmware's new open source project,
CloudFoundry.com/.org -- if not so impressed with their documentation for the
free/open version. Apparently you can use that with VirtualBox as well:

    
    
      http://matschaffer.com/2011/04/cloudfoundry-virtualbox/
    

Note that Vagrant is in the process of being refactored with the goal of
adding support for other hosts than just VirtualBox in the (relatively) near
future.

------
facorreia
There are advantages to a Unix-like OS for web development. When I was working
with Django I switched from Windows to an Ubuntu VM. That was a few years ago,
though. Nowadays Python and Django on Windows (and even on the Azure
platform[1]) are fully supported by Microsoft. Since you want something
different from OS X and you want Office and other apps, I suggest you try
Windows. You can still use Sublime, git, and many other tools.

[1] <https://www.windowsazure.com/en-us/develop/python/>

------
gbin
Linux & pycharm work perfectly for me.

Pycharm support for python/django is just the best.

For stuff like git I still prefer the command line and vim for editing
isolated files either locally or via ssh.

For the microsoft word stuff I use google drive, if I really need something on
the windows side (seriously it happens to me once every 3 months for updating
my tomtom) I start a virtualbox with a minimal windows XP in it. The
virtualbox desktop integration mode is excellent.

~~~
FireBeyond
My only issue with "needing Windows or OSX" is that we do a lot of
collaboration, which I can't argue out of GoToMeeting (which doesn't run on
Linux), and I don't want to have to maintain a separate VM to mimic my
development environment merely for these times (I realize, too, that I'm
optimizing for a highly specific set of circumstances, here!) - were it just
Office, or one or two tools, I'd be happy with Linux, and an XP VM.

------
hoka
I'm using ubuntu. I am a big windows fan but python on windows is really
frustrating at times.

I like eclipse + pydev, and with other monitors I have my tests running.

