Intellij IDEA在构面列表中未显示Django [英] Intellij IDEA not display Django in the facet list

查看:532
本文介绍了Intellij IDEA在构面列表中未显示Django的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Fedora 20与OpenJDK-1.7.0.60一起使用。我可以成功设置并运行Intellij IDEA 13.1,然后设置Python插件。好吧,当我尝试通过Intellij使用Python模块选择生成项目时,在技术部分找不到Django facet。我在网上搜索,但找不到任何解决方案,甚至没有任何问题。我卡住了,无能为力。请帮忙。



注意:在安装插件之前,我的机器上已经安装了Python和相关的Django。



解决方案

您的症状类似于我遇到的一个问题,该问题可以通过编辑IDEA模块文件来解决。 ,将显示为 {your_project_name} .iml 。该文件位于项目(或模块)的根目录中,或者位于项目的 .idea 目录中。



您可能会看到模块元素的type属性是 JAVA_MODULE 。将其更改为 PYTHON_MODULE ,保存文件,然后重新启动Intellij。



您可能会看到以下内容:

 <模块类型= JAVA_MODULE version = 4> 

或者此:

 <模块版本= 4> 

无论哪种情况,您想要的都是类型属性表示 PYTHON_MODULE

 < module type =  PYTHON_MODULE version = 4> 

保存后,当您进入Project Structure并添加Facet时,您将看到Django。



我的猜测是,当您的项目最初是在Intellij中打开时,IDE无法将目录识别为python模块,并将其设置为默认(Java)。


I am using Fedora 20 with OpenJDK-1.7.0.60 setup. I can setup and run Intellij IDEA 13.1 successfully, then setup Python plugin. Well, when I tried generate a project from Intellij with Python module selectly, I could not find Django facet in the technology part. I searched web but could not find any solution, even any question. I stuck and cannot do anything. Please help.

Note: Python and related Django had been installed on my machine before I setup the plugin.

Regards.

解决方案

Your symptoms are similar to a problem I've also had, which was solved by editing the IDEA module file, which will appear as {your_project_name}.iml. This file is either in the root of your project (or module) or in the .idea directory of the project.

You'll likely see that the module element's type attribute is JAVA_MODULE. Change this to PYTHON_MODULE, save the file, and restart Intellij.

You'll likely see this:

<module type="JAVA_MODULE" version="4">

Or this:

<module version="4">

In either case, what you want is for the type attribute to say PYTHON_MODULE:

<module type="PYTHON_MODULE" version="4">

After saving that, when you go into Project Structure and add a Facet, you'll see Django.

My guess is when your project was initially opened in Intellij, the IDE did not recognize the directory as a python module, and set it to the default (Java).

这篇关于Intellij IDEA在构面列表中未显示Django的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆