i have problem running Django server in Intellij / Pycharm (I tried in both).
There is that red cross:
And this is the error i get:
I have Python 2.7.10 and Django (via pip) installed on my computer. I've tried reinstalling both python and Django, but it didn't help. I've specified project sdk (Python).
Edit:
This is what it looks like in "Project Interpreter" page.
and Django configuration:
To enable Django support, follow these steps: Open the project Settings/Preferences dialog ( Ctrl+Alt+S ) and navigate to the Languages & Frameworks | Django page. Make sure that the checkbox Enable Django support is selected. Apply changes (if any) and close the dialog.
IntelliJ IDEA supports the latest Django versions.
If you cannot print the Django version from the python console in Pycharm, go to settings>Project:project_name>project Interpreter and from the list of installed packages see the installed Django and it's version for that project.
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.
If your IntelliJ is up to date, there is another solution.
I had the exact same problem in IntelliJ 2017.2 and it was driving me crazy until I read this post from a IntelliJ maintainer.
If you use IntelliJ Idea and "Load an existing project", it will model it as a Java project with a Python modules attached. You cannot get Django loaded, no matter what you do.
I handled this by purging the .idea
directory, and created a new Django project, with the pre-existing Django directory as the base directory in IntelliJ. I can now see Django in the project structure > project settings > module part of Intellij, and I can select the django settings file.
Delete .idea
folder
Create new project
Select Python > Django
Hit next
Select existing django project path (or start from scratch with a new folder)
Add DJANGO_SETTINGS_MODULE=yourprojectname.settings
to your run configuration (can be found in yourprojectname/wsgi.py
file).
Enjoy your Django development 🚀
Try adding DJANGO_SETTINGS_MODULE=untitled.settings
to the environment variables listed in the configuration menu by clicking the dropdown titled 'Django' in your first photo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With