4 ms·
Whenever I set up a new Django project, it was always a bunch of boilerplate work to get virtualenv setup. Then if you forgot a step you would have to look into
by mathrawka 13y ago
Whenever I set up a new Django project, it was always a bunch of boilerplate work to get virtualenv setup. Then if you forgot a step you would have to look into what is wrong.
After spending some time with Node.js, I have become spoiled by how well npm works for everything. Albeit, if you want to mess with node versions you need something like nvm, but it is easy to get the hang of.
Seeing something as simple as npm for python would be awesome.
- puller 13y agoIs it ever not true that when you forget a step, you have to look into what's wrong? In any language, or any project?
- wereHamster 13y ago1. The fewer steps, the less chance of making a mistake. With node/npm there is no need to set up anything, 'virtualenv' is enabled by default, just npm install and you're set. 2. Some tools make it easier to detect the mistakes and guide you to a solution. Some present you with unintelligible messages or a (for end-users rather useless) stacktrace. Others describe the problem nicely (in prose), point you to FAQ/documentation or tell you what the most likely solution is.
- acdha 13y ago> 1. The fewer steps, the less chance of making a mistake. With node/npm there is no need to set up anything, 'virtualenv' is enabled by default, just npm install and you're set. You're assuming that setting up virtualenv is a heroic, error-prone process rather than a couple seconds the first time you get a new system – just like node/npm. Once you've installed virtualenv or npm, the process is identical: you need something, you install it and if something breaks you have to debug that particular package. In both cases, you're going to need to be able to read an error message and in neither case does the challenge usually involve packaging rather than, say, an issue with a shared library or incompatible/unavailable dependencies. > 2. Some tools make it easier to detect the mistakes and guide you to a solution. Again, there's no meaningful difference between the two unless you choose to make your environment complicated, which is not a problem specific to a language. I use both node and python on a regular basis and there's no general conclusion to be made about either one – npm installs are slower, python requires me to activate a virtualenv when I open a new window[1], and none of that really matters because no developer should be spending all day installing packages or opening terminal sessions. 1. If this is truly soul-crushing, it's a solved problem: https://gist.github.com/codysoyland/2198913 https://gist.github.com/codysoyland/2198913
- jzwinck 13y agoNode's npm doesn't work for everything. For example, it fails to install indirect dependencies: https://github.com/isaacs/npm/issues/3124 https://github.com/isaacs/npm/issues/3124 NPM may be simple to use, but it is not accurate.
- leokun 13y agoThere's nothing in node that can replace Django. Django does so much. NPM is a wasteland of abandoned projects and nested npm_modules with broken symlinks to or from a bin that'll never work on your vm's shared directory (unless it's VMWare I guess, some kind of secret sauce they use). Having said that, they're all ok tools that people use to build pretty cool things. I just think there's got to be a better way, and I think it's somewhere in between an extern and npm/pip thing where you store your dependencies somewhere where you don't have to worry about a site being down during deploy and versioning issues. It's like you freeze and shrinkwrap, but by actually capturing everything you need once your shit works and putting it somewhere where you control not someone else.
- grncdr 13y agoIf you're deploying an application (really, if you're working on anything other than a library intended to be used by many other projects) check in your dependencies. This solves a lot of problems regardless of what language/platform you're developing on.
- bmelton 13y agoI'm going to go out on a limb and guess that you haven't yet discovered application templates? If you have, then feel free to disregard this message. If you've got a bunch of project boilerplate, you can start a new, empty project, configure it to your boilerplate scenario, and then save that as a template for future projects. Then, the next time you start a new Django app, you'd do something like this: virtualenv project_name; cd project_name; . ./bin/activate django-admin.py startproject --template=/Users/username/Django-templates/boilerplate project_name pip install -r project_name/requirements.txt
- fletchowns 13y agoYeah but there's even some boilerplate work to get a new Java project setup. mvn archetype:generate is helpful but you still have to go in and start adding your dependencies to the pom. Once you do it a few times it goes pretty quick. You can easily write a little bash script that can do all that stuff for you, too.
- OhHeyItsE 13y ago> it was always a bunch of boilerplate work to get virtualenv setup. curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz $ tar -xvfz virtualenv-X.X.tar.gz $ python ./virtualenv-X.X/virtualenv.py myEnv $ source ./myEnv/bin/activate yeah, that's a killer alright...