Question

I'm currently looking for a nifty Python/Django IDE and came across PyCharm from JetBrains which I tested for about a week now and I'm quite impressed by this piece of software.

However, I've read that IntelliJ Ultimate with JetBrains own Python Plugin offers about the same Features as PyCharm itself, so I went ahead and gave it a try, but experienced some issues which I didn't have within PyCharms. In IntelliJ, the built in Feature 'Tools > "Run manage.py Task..."' works with most (e.g. runserver, startapp, syncdb, ...), but not with all commands:

  1. Almost all sql-related commands like "sql", "sqlall", "sqlclear", ... are shown as available commands, but raise a "No Applications" error message when entered. In PyCharm those commands works fine.

  2. Running the test suite via "test" opens a box where I have to choose the applications which I want to test. However, there is only one entry "[All Applications]" and running it causes several Exceptions to be thrown.

  3. Adding some new Applications to the "settings.py" file has no effect on "Run manage.py Task..." whereas in PyCharm it adds new commands to it. I've tried this for example with "django.contrib.gis" to enable "ogrinspect"

All those issues lead to the assumption that IntelliJ somehow fails to recognize the installed django applications. Did I miss some configurations or settings in IntelliJ which are already set in PyCharm?

To further explain what I did exactly: In IntelliJ I created a new project "Python Module" then enabled Django as desired technology. In PyCharm I just created a new project of type "Django Project". All following steps were exactly the same.

Was it helpful?

Solution

Okay, so apparently the culprit is the IntelliJ IDEA Project Creation Wizard.

If you create a new project within PyCharms and choose Django Project as desired Project type, it just works. You don't have to configure anything else.

To do this in IntelliJ IDEA, create a new Project, choose "Python Module" as type and check Django as technology. In the new project go to "File > Project Structure", navigate to "Facets", choose your Django Module on the right and set the "Settings:" option to point to the specific "settings.py" file.

After this configuration, everything should work as smooth as in PyCharms.

I consider this problem as a bug, as the Wizard creates the basic project, including a "settings.py" file, but doesn't add it in the project settings. Plus, you don't get any warning that such a strongly needed settings file is missing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top