Pycharm unable to resolve Django reference - python

I pulled a project from my GitHub to my laptop. After I install my requirements.txt file Pycharm is giving me an error "unresolved reference 'contrib/middleware'" in settings.py despite having Django installed and support enabled. The project is working in Pycharm, I'm just getting my text highlighted and imports aren't working. I've deleted the virtual environment, deleted the project, and pulled it again and I'm getting the same errors

I was able to resolve the issue by uninstalling and reinstalling. May not be a long-term solution but it is resolved for now.

Related

Wierd StaticCompilationError caused by django-static-precompiler

On project we use django-static-precompiler and scss. When I ran localy got this weird error that points to nothing literally. No info at internet or references at docs. I thought it connected to sass packecge but it already installed at my system.
OR
Just install the newest version

VSCode Django import warning

trying out the VSCode editor, but immediately ran into a problem. I have a django 2.0.5 installation in a virtual environment, however, the out of the box linter yells at me. This is one of the errors (better said, warnings, because the server is running fine, and everything gets displayed properly) E0611:No name 'path' in module 'django.urls'
I'm sure it's easy to solve, but it's beyond me at this point

Error importing numpy & graphlab after installing ipython

I have got a strange issue.
I am now using graphlab/numpy to develop a project via Pycharm 5. OS is Mac OS 10.11.5. I created a p2.7 virtual environment for the project. Programme runs well. But after I install ipython, I can no longer import graphlab and numpy correctly.
Error message:
AttributeError: 'module' object has no attribute 'core'
System keeps telling that attribute ‘core' and 'connect' are missing. But I am pretty sure that they can be found in graphlab/numpy folders, and no duplicates.
Project runs all right in terminal. Now I have to uninstall ipython. Then everything is ok again.
Please kindly help.
Please remember that console applications and GUI application do not share the same environment on OS X.
This also means that if you install a Python package from the console, this would probably not be visible to PyCharm.
Usually you need to install packages using PyCharm in order to be able to use them.
Upgrading pip itself then reinstalling worked for me

Autocompletion not working in virtual environment pycharm

I am currently working on a Django Project and installed djangorestframework on my installed apps. My pip freeze file you can see below:
Django==1.9.2
django-filter==0.12.0
djangorestframework==3.3.2
djangorestframework-jwt==1.7.2
eventbrite==3.3.3
Markdown==2.6.5
Pygments==2.1
PyJWT==1.4.0
requests==2.9.1
wheel==0.24.0
My project python interpreter is also pointing to the right directory
But the issue is auto completion feature is not working for djangorestframework, as you can see below. Pycharm is not recognizing my imports here.
I have also enabled Django Support in Pycharm.
Could anyone suggest me what should I do to enable autocompletion here? Thank you
Okay my issue is resolved
1 - Go to `file --> Invalidate Caches/Restart`
2- Wait for Pycharm to build new indexes
3- Then try to import your python modules.
It worked for me :)

Running django-admin.py startproject is giving me an error

I've just started looking into python and django.. Im pretty sure ive successfull installed both python and the django framework and i managed to add python and django-admin.py to my system path but now when i run the command django-admin.py startproject My_Test_Site, in the folder i want to create a new project directory in (just following the tutorials), i get the following error:
What am i doing wrong?
This is not a Django error. It appears it cannot find the Python module unicodedata which is part of the Python Standard Library (docs). I see that there is also a bug report about this issue (Python 2.7 on Windows, see here). On the other hand, some people there report that reinstalling their Python installation fixed the problem. You could give that a try.
notice the last line, it says import unicodedata, importError
im guessing you probably didnt install your django properly.
so reinstall it and check that django is in your "path", i believe django does this automatically when it installs but doesnt hurt to double check.
if reinstalling django still doesn't work, i suggest you uninstall python and django related stuff.
then install python, install pip, then use pip install django.

Categories