I have two machine for example development, one is MacOS the other is a Linux Ubuntu. I create a Django project in MacOS machine but now i need to develop this Django project in Linux Ubuntu, so i need to import the project in Ubuntu to edit and run, this article will tell you how to do it in Ubuntu correctly.
1. Import Existing Django Project.
The source code is maintained on github, and i use smartgit to control the source code versions. Please refer article How To Use SmartGit In Ubuntu to learn more. Then you can use smartgit to clone the Django project source code to your local machine. Next you can import the project in PyCharm follow below steps.
- Start PyCharm and click File —> Open menu item to open the Django project selection window.
- Select the Django project saved folder, then click OK button.
- Now the existing Django project has been opened in PyCharm correctly.
2. Enable Django Support For Existing PyCharm Project.
After you edit source code then you need to run the Django project with follow steps.
- Select the existing Django project in PyCharm in left panel.
- Click Run —> Run menu item in the top tool bar.
- Then click Edit Configurations… menu item in the popup menu list.
- Run configuration window will popup and there is an error message in the bottom left, the error message is Error: Please enable Django support for the project.
- Just click the Fix button at bottom right then it will popup another Settings window like below.
- Check the Enable Django Support checkbox, then select the Django project root folder, the project settings.py file and the project manage.py file. Then click Apply and OK button, then you can run your Django project with the specified configurations. Now you have successfully import the existing Django project to the PyCharm installed on Ubuntu OS.