Feature Spotlight: Creating and managing Django projects
Happy Friday everyone,
PyCharm is known for its superior support of the Django web framework. It’s been supported since the inception of PyCharm, and with each release we improve it by polishing the existing features and adding new ones.
With the latest PyCharm 4.5 release, we’ve improved Django 1.8 code insight and added a big new feature: the manage.py console.
This new tool introduces a new user interface and provides autocompletion for manage.py tasks and their arguments. The manage.py console also preserves the command history so you can easily fetch previous commands just by pressing Up / Down arrows. Quick documentation is also supported by pressing Ctrl+Q on a manage.py command.
Note: Django support is available only in PyCharm Professional Edition.
Given the number of big and small changes to Django support, recently we updated our main Creating and managing Django projects tutorial. Do check it out if you are migrating to PyCharm as a new development environment and want to get used to its basics. Or if you just want to revisit the whole picture of Django development with PyCharm.
Talk to you soon,
-Dmitry
radium says:
July 25, 2015Will it work if I use docker? Because in that case I should run these commands inside a docker container.
Dmitry Filippov says:
July 27, 2015Currently PyCharm doesn’t support Python interpreters inside docker containers. However you can setup a project interpreter inside a docker container via ssh as a remote interpreter as if it would be a VM: https://blog.jetbrains.com/pycharm/2015/03/feature-spotlight-python-remote-development-with-pycharm/
Dustin Rodriguez says:
August 22, 2015I haven’t had the opportunity to try it out yet, but how does PyCharm cope with DjangoCMS projects? If I create a regular Django project and do DjangoCMS stuff within it, will I run into roadblocks? Would I be better off just treating it like a standard Python project?
Also, to Bed Pad: Using ZEND means using PHP. Almost anything else is preferable. The things PHP lets people do to code… it’s horrific!
Dmitry Filippov says:
August 25, 2015You can open already existing Django/DjangoCMS project or create a new one either a pure Python or Django project.
In PyCharm’s settings you can enable/disable Django support for your project.
John says:
October 2, 2015Hi Dmitry,
I’ve just tried to work through the “Creating and managing Django projects” guide.
The following error occurs at the “Launching the Django server” step:
django.core.exceptions.ImproperlyConfigured: Application labels aren’t unique, duplicates: admin
References on the web suggest this is a naming problem.
http://stackoverflow.com/questions/24319558/how-to-resolve-django-core-exceptions-improperlyconfigured-application-labels
Does the guide need to be updated with this? Or am I simply making a mistake somewhere?
Appreciate your thoughts.
Many thanks,
John
(Python 2.7; Django 1.8.4)
John says:
October 2, 2015Hi Dmitry,
There seems to be an error in PyCharm.
“django.contrib.admin” is inserting twice into settings.py – see below. Upon removing the duplicate the app runs as expected. This present after django project creation.
INSTALLED_APPS = (
‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘django.contrib.admin’,
‘polls’,
)
PyCharm 4.5.4
Build: #PY-141.2569, built on August 28, 2015.
Regards,
John
Dmitry Filippov says:
October 2, 2015Hi John,
we have an issue already filed here:
https://youtrack.jetbrains.com/issue/PY-17078
you can add your comments there. A developer is already assigned to fix this problem.
Allan Elder says:
March 31, 2016Hi
Has the tutorial been moved again?
The link in the blog now takes us to the Quick Start Guide….
Dmitry Filippov says:
April 5, 2016Yes, it has been moved from the website to our online help. Thanks for pointing this out. I’ve changed the link.
Bbiswas says:
November 30, 2017I am sill getting the error django.core.exceptions.ImproperlyConfigured: Application labels aren’t unique, duplicates: admin despite trying all the solutions above