Answer the question
In order to leave comments, you need to log in
Why does the error "ImportError: No module named" appear?
there is this in the views.py file:
import _datetime
from django.http import HttpResponse
def cur_time():
now = _datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
from django.contrib import admin
from django.urls import path
from cyberfight.mainpage import views
urlpatterns = [
path('admin/', admin.site.urls),
path('index/', views.cur_time())
]
File "/home/dimaseg/PycharmProjects/cyberfight.ru/cyberfight/cyberfight/urls.py", line 19, in <module>
from cyberfight.mainpage import views
ImportError: No module named 'cyberfight.mainpage'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question