Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django/Python apps and prerequisites for developer environment

Tags:

python

django

Currently my Django project has a huge readme doc, that any developer, whishing to work on the source, must follow to setup their development environment.

It goes something like this:

Prerequisites:

  1. Django Css. See Django CSS.
  2. CleverCSS. See Clever CSS.
  3. Beautiful Soup. See Beautiful Soup.
  4. Dateutil. See python-dateutil.
  5. httplib2 http://code.google.com/p/httplib2/
  6. python-oauth2 https://github.com/simplegeo/python-oauth2
  7. python-twitter http://code.google.com/p/python-twitter/

Is there any facility for writting some sort of script that will fetch the dependencies automatically? At least to automate this process partially to something like:

python setup_environment.py

I've looked at setuptools - but it seems to me that it is more for the purpose of installing the app itself onto the system, not fulfilling the developer's requirements for environment setup.

like image 730
Andriy Drozdyuk Avatar asked Nov 30 '25 22:11

Andriy Drozdyuk


1 Answers

Will pip not do the job?

http://www.pip-installer.org/en/latest/index.html#

You can freeze all requirements on your server to a file (run this on the server):

pip freeze > REQUIREMENTS.txt

and then on your dev environment:

pip install -r ./REQUIREMENTS.txt

to install everything listed in the REQUIREMENTS file.

You should also look at installing virtualenv (and virtualenvwrapper) as well on your development (and production) server

http://iamzed.com/2009/05/07/a-primer-on-virtualenv/

They allow you to set up multiple encapsulated python environments. This means you can have two django apps set up on the same machine, each with different python versions/python applications/django versions.

like image 83
Timmy O'Mahony Avatar answered Dec 02 '25 11:12

Timmy O'Mahony



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!