Files
2012-02-21 01:15:00 -05:00

1 line
15 KiB
JSON

[{"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303400643.5804999, "message": "I put a .env folder in my project (ingored by git) for my virtualenv. Also adjusted my prompt command so it automatically sources .env/bin/activate if .env exists in the current directory, though I deactivate manually when I leave.", "group_id": 81, "id": 771532}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303399491.792788, "message": "I know this is a pretty basic question, but I've seen thousands of words about setting up individual projects, but how do you have your work environment as a whole set up? (i.e. where do you put your projects, how are you using virtualenv, do you run a local webserver or just runserver)", "group_id": 81, "id": 771275}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303402960.638191, "message": "@katylava Sounds like your projects are completely separated, how do you manage multiple related projects? Do you keep common apps in git and check them out per project using pip?", "group_id": 81, "id": 772305}, {"user_id": 13339, "stars": [{"date_created": 1303409983.9584479, "user_id": 25337}, {"date_created": 1303419180.6564109, "user_id": 26100}], "topic_id": 20714, "date_created": 1303409148.8973169, "message": "we use a requirements file for the project and install into .env with pip. our related apps are on our git server and we use '-e git+git@ourgitserver.com:otherapp.git#egg=otherapp'", "group_id": 81, "id": 773653}, {"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303409286.6563179, "message": "credit where it's due: it was my coworker who set this system up, not I", "group_id": 81, "id": 773669}, {"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303409238.3785541, "message": "...so it is editable, and if I need to work on otherapp in that context, I edit from .env/src/otherapp, and I can commit back to git from there.", "group_id": 81, "id": 773663}, {"user_id": 25337, "stars": [], "topic_id": 20714, "date_created": 1303409976.747242, "message": "+1 to @katylava's method - though I don't use a dot-name directory for my venvs, as I like to be able to see them in Finder :)", "group_id": 81, "id": 773787}, {"user_id": 1822, "stars": [{"date_created": 1303532685.0549619, "user_id": 5778}, {"date_created": 1303564256.5833941, "user_id": 6415}], "topic_id": 20714, "date_created": 1303410900.9774909, "message": "I used to keep envs in the project space, but have switched the the virtualenvwrapper mode of keeping envs in a machine specific location, since they are coupled more to the machine than to the project.", "group_id": 81, "id": 773952}, {"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303416761.7466121, "message": "the default requirements.txt file doesn't get pinned, as it's only used in development and when we first deploy. if we ever move a project, we use the frozen requirements, which are pinned by default.", "group_id": 81, "id": 775153}, {"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303416698.8737521, "message": "since we use requirements.txt files (and requirements_pro.txt and requirements_staging.txt, which are frozen every time we deploy), the virtual envs are easily thrown away and built again, so i consider them as belonging to the project. if the project is not going to live on my computer (or our server) anymore, then i can delete the entire project directory -- don't need the venv anymore.", "group_id": 81, "id": 775144}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303416705.9508231, "message": "@katylava If you're using editable checkouts in a requirements file, it is a good idea to pin it to a specific commit/tag. (in keeping with the wisdom that every dependency in your requirements should be pinned to versions)", "group_id": 81, "id": 775146}, {"user_id": 13339, "stars": [], "topic_id": 20714, "date_created": 1303416784.5135, "message": "(i should probably be using @ replies, sorry)", "group_id": 81, "id": 775155}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418600.1645041, "message": "@sivictor Sure, there are definitely better practices :)", "group_id": 81, "id": 775497}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303418601.5656581, "message": "Do you use runserver (or similar) exclusively when working locally?", "group_id": 81, "id": 775498}, {"user_id": 2588, "stars": [{"date_created": 1303436359.831418, "user_id": 1127}, {"date_created": 1303439471.2698181, "user_id": 26100}], "topic_id": 20714, "date_created": 1303418822.1046369, "message": "https://github.com/dcramer/django-devserver", "group_id": 81, "id": 775541}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418889.550854, "message": "If I'm doing more clicking around, brainstorming, etc. I'll switch to gunicorn (better for if you're loading lots of pages, and rarely making code changes)", "group_id": 81, "id": 775554}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303418926.5261021, "message": "@unbracketed Are your developers running in a homogenous environment? We have a mixed Windows/Mac env and I'm stilling working out the best way to manage that. For PHP development everyone runs a VM that matches prod, but I've found doing Python dev across that boundary a lot more problematic.", "group_id": 81, "id": 775563}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418724.763114, "message": "We let everyone use whatever tools or setups they want locally and then have at least one integration/staging environment that mirrors production", "group_id": 81, "id": 775524}, {"user_id": 2588, "stars": [{"date_created": 1307567638.8699689, "user_id": 35238}], "topic_id": 20714, "date_created": 1303417701.055078, "message": "Every project gets its own virtualenv. Every project is a Python package. The environment is prepared by `pip install`ing the project into the fresh virtualenv, followed by installing one of the requirements files. As @katylava alludes to, being able to recreate the full (Python) runtime environment for the project in a simple repeatable manner provides a lot of flexibility and portability.", "group_id": 81, "id": 775334}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418798.8872809, "message": "I always use runserver when I'm hacking on something. django-devserver is a nice alternative if runserver is dogging it too much", "group_id": 81, "id": 775535}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418618.3117969, "message": "I do", "group_id": 81, "id": 775503}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418276.4105279, "message": "A symlink or two will let you locate both the virtualenv and your source anywhere you want and virtualenvwrapper won't know any better. ", "group_id": 81, "id": 775403}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418549.832998, "message": "For virtualenvwrapper, I primarily take advantage of three features: workon, postmkvirtualenv, postactivate", "group_id": 81, "id": 775468}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303418556.178436, "message": "@unbracketed One reason for asking was to ease the onboarding of developers new to Django, so having a practice, even if there is no *best* practice is advantages in this case.", "group_id": 81, "id": 775473}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418988.0525501, "message": "We have a mix of Mac/Ubuntu", "group_id": 81, "id": 775566}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303418263.3928001, "message": "I use virtualenvwrapper for managing my virtualenvs but I actually have code and virtualenvs scattered around in different places (remnants from older work, evolving workflow, etc).", "group_id": 81, "id": 775402}, {"user_id": 2588, "stars": [{"date_created": 1303418490.025105, "user_id": 26100}, {"date_created": 1303419949.038667, "user_id": 13339}, {"date_created": 1303421431.7927849, "user_id": 1822}], "topic_id": 20714, "date_created": 1303418398.2949791, "message": "So the takeaway is don't fret too much about \"what's proper\" w.r.t. virtualenv and source code locations, and/or whether there is meant to be some implicit/explicit relationship between your project source and the virtualenv. The arrangement of the bits on the filesystem isn't nearly as important as knowing how to recreate your environment automatically on any system. ", "group_id": 81, "id": 775429}, {"user_id": 2588, "stars": [{"date_created": 1303564464.786242, "user_id": 6415}], "topic_id": 20714, "date_created": 1303418648.0836301, "message": "You definitely want to have _some_ environment that resembles production that you can run your code on though", "group_id": 81, "id": 775506}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303419048.9614511, "message": "If I had to develop on Windows I'd prefer a VM", "group_id": 81, "id": 775580}, {"user_id": 2588, "stars": [], "topic_id": 20714, "date_created": 1303419226.8964529, "message": "@sivictor What were some problems you were having?", "group_id": 81, "id": 775606}, {"user_id": 1127, "stars": [{"date_created": 1303439461.2732999, "user_id": 26100}, {"date_created": 1303472796.603353, "user_id": 16171}, {"date_created": 1303481553.389771, "user_id": 275}, {"date_created": 1303526149.054009, "user_id": 15892}, {"date_created": 1303532883.7436161, "user_id": 5778}], "topic_id": 20714, "date_created": 1303436438.062876, "message": "We are slowly migrating to virtualenvs with Vagrant, but for most people: Use virtualenv[wrapper], create a decent setup.py (or use pip requirements if you so desire), have sane settings http://justcramer.com/2011/01/13/settings-in-django/, and make sure everything works without dependencies (such as memcache, apache, etc.)", "group_id": 81, "id": 777398}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303439458.468226, "message": "@unbracketed The problems relate to using IDEs in the host system and running the code on the VM, you need to have Python envs set up on both sides that are close to identical (for code completion, etc.). Not a problem for the Mac folks, really... but not so much the Windows devs.", "group_id": 81, "id": 777906}, {"user_id": 12843, "stars": [], "topic_id": 20714, "date_created": 1303441554.1850419, "message": "I worked out a virtualenvs/puppet/Parallels solution for our dev group (a few months before hearing about Vagrant). We use virtualenvs in production as well, so the puppet config mostly inherits all the same stuff. The Parallels image runs Apache, but you can do a runserver in each virtualenv if you want werkzeug goodness. When big changes happen in a given virtualenv we ask everyone to update off of puppet.", "group_id": 81, "id": 778145}, {"user_id": 1806, "stars": [], "topic_id": 20714, "date_created": 1303497099.364707, "message": "#1 Always use runserver_plus (from django_extensions) to get the AJAX debugger. This is awesome", "group_id": 81, "id": 783794}, {"user_id": 1806, "stars": [], "topic_id": 20714, "date_created": 1303497136.0856609, "message": "#2 [just discovered this one] Run pyzen in a console window (on second monitor) which automatically runs your tests when the codebase changes", "group_id": 81, "id": 783803}, {"user_id": 1806, "stars": [], "topic_id": 20714, "date_created": 1303497176.8247659, "message": "#3 Run pyflakes every 5 seconds using watch, to catch any errors as they occur.", "group_id": 81, "id": 783807}, {"user_id": 1127, "stars": [{"date_created": 1303532977.6079111, "user_id": 5778}], "topic_id": 20714, "date_created": 1303510177.8118141, "message": "@codeinthehole theres bundles in just about every editor that will auto pyflakes for you, and many test suites are too slow to continually run like that :)", "group_id": 81, "id": 785607}, {"user_id": 13335, "stars": [{"date_created": 1303513995.415041, "user_id": 26100}], "topic_id": 20714, "date_created": 1303512163.2468541, "message": "we are all mac - when a new developer comes on board they run - bash -ci \"$(curl -fsS https://gist.github.com/raw/<script_id>/bootstrap.sh)\". It install brew to manage dependancies and installs pip/virtualenv[wrapper] - finally it writes and make_env.sh script that will take care or creating our Django dev environment within a virtualenv. Works well enough for our designers to run local code and grab updates in real time from git.", "group_id": 81, "id": 785828}, {"user_id": 26100, "stars": [], "topic_id": 20714, "date_created": 1303514213.5241849, "message": "@amosson This reminds me of @zeeg's developer startup slide from PyCon. http://www.slideshare.net/zeeg/djangocon-2010-scaling-disqus (slide 42). I think this kind of scripted start up is great.", "group_id": 81, "id": 786044}, {"user_id": 13806, "stars": [], "topic_id": 20714, "date_created": 1303524636.7524109, "message": "@sivictor I used andlinux which is based on colinux and uses xming as the windows X Server. www.andlinux.org \"andLinux is a complete Ubuntu system running seamlessly in Windows based systems (32-bit versions only).\" I was working with symfony and running netbeans natively. the code was also in the native file system because otherwise netbeans or eclipse would take forever to load the project. The computer was old & slow but If I was to do this today I would try virtualbox (I need a 64bit system to use my ram) run everything code related from the virtual machine & use seamless mode or setup xming. Have you tried any of this? I'm not sure if there is going to be a perceived performance problem with the virtual box method if one is using a decent machine.", "group_id": 81, "id": 786901}, {"user_id": 5734, "stars": [], "topic_id": 20714, "date_created": 1303526002.8299351, "message": "one more: tmux for my django \"runserver\"s", "group_id": 81, "id": 786980}, {"user_id": 5734, "stars": [], "topic_id": 20714, "date_created": 1303525822.5877399, "message": "@codeinthehole something even better I just discovered, django-devserver ( https://github.com/dcramer/django-devserver )", "group_id": 81, "id": 786975}, {"user_id": 14923, "stars": [{"date_created": 1303576309.300631, "user_id": 2588}], "topic_id": 20714, "date_created": 1303525433.494025, "message": "my work environment is essentially vim and a few shells open for ipython, devservers, etc; i integrate everything into virtualenvwrapper, so that a common set of aliases I have work the same across projects with different version control systems, project layouts, customized indentation style per project based on active ve so I don't rock the boat; bootstrap w/ requirements files and fabfiles to fetch remote data i might need to get started.", "group_id": 81, "id": 786954}, {"user_id": 5734, "stars": [], "topic_id": 20714, "date_created": 1303525961.5153379, "message": "slightly related, for Javascript, I use a modification of the JSLint plugin for vim that uses JSHint instead. pretty slick", "group_id": 81, "id": 786979}, {"user_id": 1127, "stars": [], "topic_id": 20714, "date_created": 1303533525.153192, "message": "ya, devserver is very useful :)", "group_id": 81, "id": 787242}, {"user_id": 1806, "stars": [], "topic_id": 20714, "date_created": 1303545025.835252, "message": "@zeeg I'll check out the pyflakes plugins. You're definitely right about slow test suites but there's a lot of value in keeping your test suite fast to aid tdd. Local ci is good in such situations", "group_id": 81, "id": 788012}]