I’ve been managing a Django site my MacBook while syncing changes (via github) to my webfaction production and staging servers.
I’ve purchased a new MacBook and would like to start rebuilding my environment. My issue is that the GH versioned files were deeper in the projects–at the same level as manage.py and included settings.py, template files, mvc files, etc. However, they did not include the files and data created by installing django apps and dependencies. For that, I was manually installing them on the prod/staging server immediately after installing them on my MacBook env.
What I’m having a hard time understanding is where these dependencies are located. I’m a victim of PHP development and am used to all my files being right there in the public folder.
Now that I have my github repo pulled down, I assume there’s a way to copy all this stuff over? I don’t think I can remember alllllll of the many dependencies I installed from the very beginning.
The typical way of managing dependencies for specific projects is to use
pip,virtualenvand write/store all the dependencies you have installed for that particular project’svirtualenvby runningin your project’s (root) directory and then committing the
requirements.txtfile into your project git repository.You can later on reinstall all these dependencies by simply issuing:-
Failing which at this point in time, you will have to manually trying to figure out which dependencies are missing when you try to run your python project and manually
pip installeach one until your project works.If you still have your old macbook (probably still do), you can create your
requirements.txtfile right now by runningpip freeze > requirements.txt. But if you did not usevirtualenv, you are essentially freezing all your dependencies that you have installed in your old macbook system-wide into yourrequirements.txtfile.