Hacker News new | past | comments | ask | show | jobs | submit login

Slightly off-topic, but does anyone develop Django/Python on a windows machine, and may want to offer any general advice or tips?

I am using virtualenv, but wondering what else I should be doing to make it easier. Previously I used cloud9 (cloud IDE) for rails development. In both cases, I am pretty much a hobbiest, but don't mind spending some money to make things easier since I'd rather spend my time doing the fun part, rather than developer ops.




I just switched from Mac to Windows 10, and I work on a lot of Django projects.

I use PyCharm (love jetbrains) + Vagrant and it's working great so far. I'd highly recommend spending the time learning Vagrant - it can be incredibly frustrating at times (on both mac and windows), but once you get it working right it's really rewarding. Being able to re-instantiate a VM when something gets really botched is a great feeling. I don't have to worry about my host machine getting messed up, so I'm free to tinker around in the VM and that speeds up my learning.

The one downside I've encountered so far is how many different "terminal" style apps I need to run to get everything working. Currently I need powershell (as admin) for spinning up the VM, putty to SSH into it, and git bash for source control. I can probably simplify them all into powershell but for now it works.


You can use ssh from git bash so there's no need for putty. And might want to look into Console2 or ConEmu both of which allow you to open multiple tabs for multiple shells.


Yep, you're right. I just added git to my path so that I can now do it all from powershell, so that's cool!


I thought pycharm replaced git bash. I havent used pycharm yet, just thought that from reading about it.


I think you can use pycharm (and other jetbrains products) to handle version control, but I prefer to use a command line. It's what I'm used to.


Windows is fine for Python development. It's just an executable, and you can even use cmd.exe. Some will tell you for some good reasons, and others just cause they love to hate, to use cygwin or something. You can check out Windows 10 bash as well.

If you find Windows some sort of hindrance, you can just use a Ubuntu VM, or reformat entirely to Ubuntu. I only use Ubuntu for over 2yrs now, and barely miss Windows, not much wrong with it though, esp. Windows10 w/ bash now.


My two second-hand cents:

At my previous company we used Vagrant for most projects, and it provided a nice abstraction layer that made things work reasonably well across all platforms (macOS, Windows, and Linux). Vagrant on Windows definitely had its challenges, though, but projects themselves ran well once that was sorted out.

I've heard the company has since moved to Docker, in search of those same benefits but with smaller overhead (specifically in terms of time spent managing the abstraction layer), and I gather the Windows folks are happier with it than they ever were with Vagrant.

My own (macOS-only) experience with both has been mixed, but certainly not worse than just running things locally via virtualenv. Vagrant introduces a full VM into the stack and Docker seems to have a lot of stability issues (at least on macOS 10.12 Sierra), so my next plan is to try combining the two, and running Docker on a Fedora VM. I'm hoping that any Docker nightmares will then at least be confined to the guest system, leaving my main machine mostly out of it, and using Docker to set up the actual project stuff may mean less Linux administration of the VM itself.


Personally I try to work as little with VMs as makes sense, they usually just make everything a bit harder and convoluted ("even" with Vagrant which, so far, has been a constant maintenance burden in all projects were I witnessed it's application, especially so if it's not only for Linux).

My experiences with docker range from disastrous to annoying; I try to just not use it. It's not installed on any of my systems. If I have to use it, I do that in a VM.

(I developed for some eight years on Windows, mostly C/C++, but last two years a lot of Python. At the time I wasn't aware of PyCharm, so Sublime Text "is also an editor" it was, but obviously just an editor; for development PyCharm is infinitely superior.)


Hey, so I understand PyCharm is an editor, but what other functionality does it have that Sublime Text doesn't?

I guess what I am asking is... what does everyone use for their DevOps stack (if that makes sense?)

Right now I am using:

CMD/bash

vitualenv

Sublime text

Ruby

Django

I haven't installed a database yet, but was going to use Postgres.

The way I understand Pycharm, I could use it to replace Sublime text and CMD/Bash right?


PyCharm mostly brings IDE features to the table: context-dependent auto completion, far better navigation, static analysis ("that thing doesn't seem to have this method"), refactoring (for Python mostly moving and renaming; the refactoring engine of IDEA for Java is probably the most advanced on this planet... it's ridiculously good).

Also, being built on the IDEA platform PyCharm has superb support for language injections, eg. CSS in HTML in a template language is not a problem and handled correctly (highlighting, completion, annotation etc.).

Another advantage is that the IDEA IDEs are all very similar in general usage, so if one is also working with another IDEA IDE (for me that's mainly Java and CLion) then no time learning a whole different set of shortcuts or something like that is lost.

I couldn't replace a shell with an IDE, but they do have tasks and stuff like that, might be good enough.

Regarding database, when you're using the ORM it does matter far less for development; I almost always just use SQLite. Some projects do require advanced features of postgres, and would not work with SQLite. In those cases I just start a postgres instance ad-hoc.


Debugger, remote REPL, virtualenv and git integration and management, database interface (also for redis/mongo etc), unit test configurations and integrated runners, auto-linting, deployment tools and of course intelligent autocomplete... in the last EAP apparently they are introducing semantic coloring, which is going to be very fun.


All good points... just to add, PyCharm has a type hinting system (which informed the 3.5 Type Hints design), which knows the expected types for stdlib functions, and can be taught the types of user-defined function arguments. It'll then warn you if it thinks you are passing the wrong type of argument to a function.

Obviously not infallible, but it catches time-wasters not infrequently.


Python doesn't force you to use IDEs. There are good command-line tools (and editors such as sublime, vim and emacs can jump to definitions etc).

There are "IDE guys" and "text editor guys". You can just determine who you are and be productive there!

Best text editors are sublime, vim, emacs; Best IDE is probably PyCharm.

It's much less of a choice when you code in Java for example: way better to use IDEs.


I thought docker just ran a Linux VM if it wasn't already on Linux? I am going by what a colleague explained to me, so please correct me if I'm wrong!


Yes, but the docker for mac uses 100% cpu per core if watching files. I think it's reasonable to assume using a better virtual machine (possibly including vmware and parallels, maybe virtualbox) means that file system events are less buggy.


That's correct - it runs an xhyve VM on macOS


I recommend running an Ubuntu VM, with PyCharm as your IDE. There are so many little things that are more painful in Windows than in Linux.

For example, getting psycopg2 running under Cygwin was an odyssey, whereas it's trivial to install on Linux. And there are plenty of Python packages that assume you have gcc and unix headers installed, which makes chasing dependencies painful.


Just out of curiousity, do you use something like this: http://www.psychocats.net/ubuntu/virtualbox ? Any other recommendations on how to install and start working with Ubuntu VM?


When I was using Windows, I preferred VMWare Workstation [1]; the number of times that VirtualBox entered the "Guru Meditation" state and cost me a half-day of debugging was just too high to justify.

If the price tag is too high, or you're just doing personal projects, I'd recommend VMWare Player [2] -- it's a free version with slightly fewer features. Last time I used it I think it didn't have snapshots, which can be useful in some cases, but aren't a deal-breaker.

Having said that, a few colleagues used VirtualBox and found it to be OK; it seemed to stabilize a bit a year or two after I had problems with it (in 2015).

[1]: http://www.vmware.com/products/workstation.html [2]: http://www.vmware.com/products/player/playerpro-evaluation.h...


Missed your second question there -- I've always just installed Ubuntu from scratch on the VM guest. I've done that enough times that it doesn't feel like a lot of work to me.

VirtualBox does have a nice feature that automates the installer, as well.

I've never bothered with the whole Vagrant thing for personal dev machines, given the low cost of spinning up a new machine, it's not worth learning a new toolchain for me. But if I was spending more than a few hours every couple years on building new VMs, it would be worth it.


You probably want to use PyCharm. It's a great IDE, and pretty much just works.

Personally I find the various CLI tools typically found on a BSD or Linux rather enticing for development, but many people do without that.

Apart from that I'm not sure what you could mean / what your issues are. Specify?


Hi! I develop early stages of Django apps on windows (it's probably bad practice, but I usually wait to test postgres until I am on a linux box--or if I am developing on a mac--we're oddly platform agnostic where I work). I have found Wing IDE to be incredibly productive (I've just started playing with PyCharm). I love Wing because of its debug options. You can debug templates as well as running processes....You can try Wing Professional for free to see if you like it. It's saved me a lot of time!!!


We give our windows users a Vagrantfile that runs a linux development environment they can ssh into.


Have you tried PyCharm?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: