I am trying to set up Django the newest version with python 3 and I keep getting errors about the path way. this is what it is saying and the following is my configurations. Note: I have uninstalled and installed and even wrote it to the exact way their website directs with no luck. it just changes around the error.
terminal:
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/patrickjobe/Desktop/wordcount/wordcount/urls.py", line 20, in <module>
path('index/', views.index),
NameError: name 'path' is not defined
urls.py page configs
rom django.contrib import admin
from . import views
urlpatterns = [
path('index/', views.index),
path('admin/', admin.site.urls),
]
settings.py page
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS':['templates'],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
views.py page
from django.http import HttpResponse
from django.shortcuts import render
def index(request):
return render(request, 'index.html')
question from:
https://stackoverflow.com/questions/65865868/having-trouble-configuring-django-on-the-atom-editor-for-a-mac-computer 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…