10👍
I had the same problem as well, and the fix in IntelliJ IDEA is not obvious (especially since there is no notification with a “fix-it” link for this problem).
You’ll find you need to set Settings to your Django project’s settings.py file in Project Structure > Modules > [your Django project’s name] > Django.
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-Cannot access django app through ip address while accessing it through localhost
- [Django]-CORS error while consuming calling REST API with React
9👍
You can go to the tool bar which shows a dropdown and select your project ->edit configuration. There in the Environment variable area enter DJANGO_SETTINGS_MODULE mysite.settings and save .
- [Django]-Annotate a queryset with the average date difference? (django)
- [Django]-Django: For Loop to Iterate Form Fields
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-Specifying limit and offset in Django QuerySet wont work
- [Django]-Using django-admin on windows powershell
- [Django]-Python 3 list(dictionary.keys()) raises error. What am I doing wrong?
3👍
I faced the same problem and proposed solutions did not work.
I solved it by going in "File > Settings…"
Then search for "Django console" and add the following Environment variable: DJANGO_SETTINGS_MODULE=mysite.settings
- [Django]-CORS error while consuming calling REST API with React
- [Django]-Django apps aren't loaded yet when using asgi
- [Django]-Annotate a queryset with the average date difference? (django)
0👍
for new commers, below is the additional info’.
where you can find the place to set DJANGO_SETTINGS_MODULE in pycharm 2019.1 is:
config -> language and frameworks -> Django’s right pain.
the column just below the django project root you can cite your config file path.
and the environment variables column you can set DJANGO_SETTINGS_MODULE value.
- [Django]-In django, how do I sort a model on a field and then get the last item?
- [Django]-How to pass django rest framework response to html?
- [Django]-Name '_' is not defined