Amir ehsan Mohebi
Amir ehsan Mohebi

Reputation: 85

unresolved reference 'path' - django

I installed python 3.6.2 and django 1.11.6. I then added 'pip' and 'django' path inside "PATH" variable in environmental variables in both sections

User Variables :

C:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Scripts C:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Lib\site-packages\django C:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Lib\site-packages

System Variables :

c:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Scripts C:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Lib\site-packages C:\Users\Moh3n\AppData\Local\Programs\Python\Python36\Lib\site-packages\django

Then I created a project with django and created a simple app named polls.

In polls/urls.py I added the import statement from django.urls import path

polls/urls.py

Then pycharm poped a box saying

unresolved reference 'path'

I didn't pay attention at first and then in mysite/urls.py added the same import statement.

mysite/urls.py

The same thing happened for include, path. At the end when I ran server in cmdier with the code

py manage.py runserver

I saw this traceback:

Traceback

If you could help me to find where the problem is, I'd really appreciate.

Upvotes: 1

Views: 4421

Answers (2)

Inyoka
Inyoka

Reputation: 1446

To check for outdated packages using pip type:

pip list --outdated

Then install the latest Django version. (At this time it is 2.0.3). Using this command (altering the version number if needed).

pip install django==2.0.3

This will update your Django installation and allow you to use the latest Django tutorial.

Upvotes: 0

Chandan Venkatesh
Chandan Venkatesh

Reputation: 114

use this

from django.conf.urls import url,include

Upvotes: 5

Related Questions