Task: create study notes-map URL
Code:
urls.py
"define URL schema for learning_logs"
from django.conf.urls import url
from. Import views
urlpatterns = [
]-sharp
url(r"^$",views.index,name = "index"),
]
execution tips are as follows:
Traceback (most recent call last):
File "I:python_worklearning_loglearning_logsurls.py", line 5, in < module >
from . import views
ImportError: cannot import name "views"
attach views code
views.py
from django.shortcuts import render
def index (request):
""""""
return render(request,"learning_logs/index.html")
Xiaobai asks for advice