简体   繁体   English

将Django intellisense添加到Pycharm吗?

[英]Adding Django intellisense to Pycharm?

I created a django project outside of PyCharm and now I am trying to find out how to add code-completion capabilities to the editor. 我在PyCharm之外创建了一个django项目,现在我试图找出如何向编辑器添加代码完成功能。 Where in settings can I add django intellisense? 在哪里可以添加django intellisense?

I think I fixed this by adding the DJANGO_SETTINGS_MODULE environment variable to the default run configurations. 我想通过将DJANGO_SETTINGS_MODULE环境变量添加到默认运行配置中来解决此问题。

Try adding this variable, and setting the value to <projectname>.settings , and run one of your project files: 尝试添加此变量,并将其值设置为<projectname>.settings ,然后运行您的项目文件之一:

在此处输入图片说明在此处输入图片说明

PS: You can also add this environment variable to the console environment under: PS:您还可以在以下位置将此环境变量添加到控制台环境:

File -> Settings -> Console -> Python Console -> Environment Variables 文件->设置->控制台-> Python控制台->环境变量

This will make it possible to use the integrated PyCharm console to access your project, which is way better than using the console that ships with Django. 这样就可以使用集成的PyCharm控制台访问您的项目,这比使用Django随附的控制台更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM