Hacks by Ruddra

How to configure Django and Tornado in PyCharm Community Edition

How to configure Django and Tornado in PyCharm Community Edition

I think, Pycharm is THE best IDE for developing python. But unfortunately, the professional edition is not free. But community edition is good enough for doing debugging, integrating GIT etc.

Normally its easy to use the community edition for django and tornado’s debugging/running if you know how to configure.

Django Configuration

For django’s configuration, there is 5 easy steps:

First: Go to edit configuration and click on it(like the below pictures).

Second: Click on the (+) mark in top-left corner and add python configuration.

Third: Click on the Script, and for django select the manage.py which resides on the project directory.

Fourth: Add runserver as Scripts parameter or any other django commands.

Fifth: Click Apply and if your python interpreter is correctly configured, then clicking on the run command should run the project, and debugging will work as well.

Tornado Configuration

There is only 1 Step:

Just follow the first and second step from above configuration and click the *.py file you want to run for tornado project in the Script, i.e. this file should contain lines like below:

    if __name__ == "__main__":
        application.listen(8888)
        tornado.ioloop.IOLoop.current().start()

And save and run.

Pycharm 2016

In 2016 edition, to add an existing virtual environment to the list of available interpreters

  1. In the Project Interpreter page, click icon.

  2. In the drop-down list, choose Add local.

  3. In the Select Python Interpreter dialog box that opens, choose the desired Python executable, located inside the virtual environment folder, and click OK.

Go to this link for more information.

Share Your Thoughts
M ↓   Markdown
Hunting
Monday, Nov 21, 2016

Hi, I use non standard settings file. How can I configure Pycharm community to run Django project with it?

Anith Raj
Sunday, Mar 12, 2017

Hello Ruddra, I was trying to configure the django in pycharm commuity edition 2016.3 , i have tried above steps, after that how do i create fresh project using django template moreover I don’t see the django template in pycharm. How do i achieve this in order to create a fresh project. In case django cant be seen as template in pycharm then how do i create project files manually?

Ruddra
Saturday, Mar 18, 2017

Try adding project root in settings>Project>Project Structure> Add new root

Saraswati Sonani
Friday, Jun 9, 2017

after adding new root what should we have to do please guide because i m new in django and python

Ruddra
Sunday, Jun 11, 2017

You just need to run the project from the Play Icon on the top bar of pycharm. Check https://www.jetbrains.com/h..., https://stackoverflow.com/q... and

Saraswati Sonani
Wednesday, Jun 14, 2017

Thank you very much Rudra

Saraswati Sonani
Wednesday, Jun 14, 2017

Hello Ruddra, I was trying to configure the django in pycharm commuity edition 2016.3 , i have tried above steps, after that how do i create fresh project using django template moreover I don’t see the django template in pycharm. How do i achieve this in order to create a fresh project.

Ruddra
Saturday, Jun 17, 2017

Pycharm community edition doesn’t support template/html coding. You can use other IDE like Atom or VSCode for it. And rather than creating django project using Pycharm, I think you can create it more simply by running this command `django-admin.py startproject myproject`, then import it in given instructions.

Srikanth Atkapuram
Tuesday, Nov 28, 2017

hello rudra sir iam getting problem on connection of django in pycharm 2017 version can u help me please and i had already follow the above steps but in my coonection path manage.py not going to be shown sir

Malik Rumi
Saturday, Dec 23, 2017

I have 2017.3. The above did not work. What did was putting settings in the script path and adding django setting module with a value of mysite.settimgs to the environmental variable.

Pablo Ferreira
Friday, Dec 29, 2017

I wanna do this but I don’t speak english and don’t know programming. :P

Mehmet Yener Yilmaz
Thursday, Jan 11, 2018

You are an angel..