Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django requirements.txt FIle in root

Tags:

python

django

I have set-up a requirements folder as such:

requirements/
  local.txt
  development.txt/
  production.txt/

I am wondering what I put in my base requirements.txt file to redirect to the appropriate file? I don't want to have to use the -r requirements/local.txt. I want a solution based off my virtual environment.

Is there a similar variable to DJANGO_SETTINGS_MODULE except for requirements instead of settings?

like image 799
Matt Stokes Avatar asked Mar 20 '23 09:03

Matt Stokes


1 Answers

generally there is a some sort of common.txt requirments file which would hold the shared packages, like django and you could extend that in your development.txt with a line that says

-r requirements/common.txt
pygraphviz
django-nose

etc..

The above imitates a sort of inheritance, and is a common and elegant (i believe) way to handle multiple requirments

I am pretty sure there is not a solution that allows you to set an environmental variable that points to a requirements file, and have the webserver automaticaly bootstrap your environment with the packages listed in the file; although that would be pretty cool if there were!

like image 180
dm03514 Avatar answered Mar 23 '23 00:03

dm03514