Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configuring an Existing Django Project on Pycharm

I´m starting to use Django with Pycharm IDE and have succesfully configured my first project.

However, I tried to add a new existing project to Pycharm and when trying to change the Run Configuration to use the manage.py of my secondProject(GuatepediaLocal), I don´t get an option to select it on the dropdown menu. When I try to run the project, it keeps running the PollSite manage.py runserver and not GuatepediaLocal´s manage.py runserver

Can anyone help me to solve this issue and configure an already existing Django Project on pycharm?

enter image description here

like image 552
Pablo Estrada Avatar asked May 14 '14 00:05

Pablo Estrada


People also ask

How do I run an existing Django project in PyCharm?

Open myproject as your project and then go to PyCharm -> Preferences... -> Django, Enable Django Support and then choose your Django project root, settings file and manage script. Save this answer.

Is Django already installed in PyCharm?

Step 1: Open Your PyCharm and Click on Create New Project. Step 2: Select Your Directory and then give a name to your project and then Click on Create. Step 3 : Then Check if Django is installed or not in your Computer. If it is Already installed then you will see the Django version installed in Your Computer.


2 Answers

After some research I found that on the settings window of Pycharm I must add Django support to my project

enter image description here

That enabled the project on the dropdown menu. After that, I just added on the enviroment variables the correct path to my project´s settings.py.

enter image description here

Hope this helps someone someday :)

like image 129
Pablo Estrada Avatar answered Oct 01 '22 23:10

Pablo Estrada


Open edit configuration wizard.

Menu > Run > Edit Configuration

Add new configuration by selecting the Django server from the left top button (button look like + sign). Look like below. Plus sign top left.

edit configuration wizard

If you don't configure the Django setting. It will show you the fix button to fix the Django Setting. Django Setting looks like this. You can manually set these setting by navigating like this.

File > Settings > Language and Framework > Django

Django Setting wizard looks like this.

Django Setting

set the project path, manage.py file and settings.py file.

like image 43
Hafiz Shehbaz Ali Avatar answered Oct 01 '22 22:10

Hafiz Shehbaz Ali