New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shell_plus notebook settings Import error in subdirectory #865
Comments
If you haven't resolved the issue you can start the notebook shell from the subdirectory where your notebooks are. |
This issue is still unresolved, yes. But thanks for the tip in the interim. |
@crearc Did you really manage to open/edit notebooks while using Django Shell Plus kernel? And Jupyter sees Django project and all the components while working in a subfolder? How can I do that? I asked here but I was not able to resolve it: http://stackoverflow.com/questions/34929528/django-and-ipython-subdirectories |
Yes I was able to get them open/editable, but as I said the pynbs only worked from the root directory, in other directories the kernel did not work. But yeah I was able to import all my libraries just fine. I did add some config stuff, not sure if it was necessary though: settings.py
jupyter_notebook_config.py
Other than that there wasn't much else that I added. |
Hold on. :o) Let me ask you clearly: are you having the same issue like me? Or can you import models etc from Django when working in subdirectory? As I explained, I tried to copy all notebooks to subdirectory called Calculations, all notebooks contain imports from Django models etc., but this does not work (cannot import Django stuff). So for now, I have to keep them in Django root directory... so many files, it gets pretty messy there. |
Ahh yeah, I thought you couldn't get notebooks working at all. Yes I am On Thu, Jul 7, 2016, 1:53 PM klimanek notifications@github.com wrote:
|
Same problem here. |
+1 would love a solution to this problem - i have like 150 notebooks in the root dir of my project, it's getting out of hand |
I'm also having this problem. 😦 |
I managed to work around this problem, in case it's useful for anyone else. Basically, I added an Project layout:
settings.py
notebooks/ipython_config.py
In the logs, you should observe IPython locating that
|
… subfolder (‘notebooks’) to load django objects successfully. This is only required when notebooks are placed in a subfolder and Jupyter is launched through shell_plus. See django-extensions/django-extensions#865. Former-commit-id: bad7b4f4a60ca1b37c67d15823baea7f70cfe361 Former-commit-id: 60a2a389b29d71ca3eef3b19c76e8b49376bda0b
If anybody wants to create a PR with documentation update, I'm happy to merge it. |
I have an issue where when I run
python manage.py shell_plus --notebook
I get an error where it can't find my Django settings when I navigate and create a notebook in a subdirectory of the project:It works when I create a python notebook from the root directory of my project, but not from any subdirectory.
Any suggestions?
The text was updated successfully, but these errors were encountered: