Two virtual environments for a single Django project?

Viewed 406

I have a Django project for which I have created a virtual environment with the packages it requires.

Now for development, I was looking for a tool where I could try some code before including it to my project. I had a good experience with Jupyter a little while ago and I thought that would be nice to work with this tool again.

In order to avoid cluttering the minimal virtual environment with the dependencies of Jupyter, I duplicated it and installed jupyter alongside with django-extensions.

In my settings.py, I have:

if os.environ.get("VENV_NAME") == "jupyter-sandbox":
    INSTALLED_APPS += ['django_extensions']

so that I can still be able to use the minimal virtual environment without django_extensions.

It works fairly well for now apart from the fact that I cannot run the server from my Jupyter-enabled virtual environment. This is because my project uses django-images and django can't find a migration file in this environment (in sites-packages/django_images/migrations). The error message is below:

raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration core.0001_initial dependencies reference nonexistent parent node ('django_images', '0002_auto_20170710_2103')

Would it be a good idea to create a symlink so that both virtual environments share the same django-images migrations folder or would it mess up completely my project?

I am not utterly confident with migrations yet and would appreciate some advice on this.

1 Answers
Related