0

i have problem with start in django. After command cd manage.py runserver, is problem no module named 'first' Sc with my file.(https://i.stack.imgur.com/wcRod.png)(https://i.stack.imgur.com/8o7sB.png)

(https://i.stack.imgur.com/Dod2r.png) and in views.py i have def index(request): return HttpResponse("Hello world")

Thanks for help.

I try change to url(r'^$',views.index, name='index') but deosn't working. Maybe problem is in files places?

szym3k33
  • 1
  • 1

2 Answers2

1

Try importing views like this: However, this doesn't work. Try creating your app outside of the project folder. Create your app where 'manage.py' exists.

from django.contrib import admin
from django.urls import path
from .views import index
urlpatterns = [
   path('admin/', admin.site.urls),
   path('', index, name='index')
1
0

can you paste the full stack trace? Also, did you modify your folder structure because new django installation has the core settings, urls, and wsgi in the core app folder, i.e. the name you specified with the startproject command?

Femolak
  • 31
  • 4