Hello,
I have a question may be stupid.
I make a break with Django but I have to finalize my project soon.
I got a new job and a new Macbook, I reinstalled my macbook and I have to import my Django work. I have previously pushed my work to github.
Python3, virtualenv is now installed on my new macbook BUT not Django. I previously install Django in a environnement with virtualenv. https://github.com/ecosensors/Django/tree/main/EcoSensors
I supposed if I clone localy my repo and then I cd /user/me/github/django/ecosensors/ (Django/EcoSensors at main · ecosensors/Django · GitHub), then source .eco/bin/acrivate
my Django app will work as before, as Django and all the requirements (see requirements.txt) is installed in the environment? (considering that my database is ready)
NB: On my new laptop, I did all steps you can read here, bellow Django note, until and before the Install django section
My guess would be that if none of your libraries have any binary components needing to be built, you would probably be ok. But if any of them rely upon binary modules that would need to be installed or compiled, you might have some issues. You may need to reinstall some packages after activating that virtualenv.
It’s probably worth noting that committing your virtual environment to your git repository is somewhat unusual, and not usually encouraged. As Ken said, if the components have binaries or other system dependent parts, they will break for other people/machines using the repo. Typically, you’d check in your requirements (usually a requirements.txt, or a setup.py, or a pyproject.toml, or any number of similar files), but not the actual installed libraries.
Hello,
Thanks for your reply. I noted that my environment should not be pushed to github. I wonder is the best way to restore my work. I have a copy of my work locally. Then I could do as I started (at the begining). I will opt for that way and I will able to update my notes (my todo).
But in other sens (I will not do it), I could 1) clone my github, 2) delete my environment, 3) create a new one, 4) import my database, 5) reinstall Django with the requirement file. That’s it?