问题描述:

Is there a way to do web development using Django in an IPython Notebook?

If so, what are the best steps that you would need to take to accomplish that?

网友答案:

Yes, creating a simple Django application in an IPython Notebook has been tried before. But it is difficult due to the following reasons:

  1. You will need to run the development server as a separate process. This makes it hard to read the log messages it outputs
  2. Editing files is awkward. Commands like %%writefile will overwrite a file. I would prefer a command for adding diffs at the appropriate places.
  3. Too often you will need to run shell commands like manage.py or git. This is OS specific and might not be portable.

While I prefer IPython as a shell for Django development, I didn't find IPython Notebook fitting into my workflow.

网友答案:

If IPython itself enough and you do not need to have HTML-interactive notebook session you can run IPython and Django in the terminal.

With django-extensions package you get shell_plus command which runs interactive IPython interpreter against Django. It's like normal Django shell command, but runs IPython instead of normal Python REPL.

However I am not sure can you hook

相关阅读:
Top