0

The structure of my project is the next:

 MyProject

       apps

          homeapp

             admin.py

             apps.py

             migrations

                  init__.py

             models.py

             tests.py

             views.py

              init.py

       urls.py

homeapp-views.py:

from django.shortcuts import render
from django.shortcuts import HttpResponse
def home(request):
return render(request, 'home.html')

urls.py:

from django.contrib import admin
from django.urls import path
from django.conf.urls import include
from homeapp.views import home

python3.7+django2.2

I don't know how to describe my question when I was searching.Is it "How to import a module from a different folder in Python?"

o'o'o
  • 1
  • 1
  • Welcome to StackOverflow, please try to not post images of code / errors so it can be easier for us to help you. https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors – Ake Mar 29 '23 at 08:53
  • 1
    What you are looking for are [relative imports](https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) in python. – Daniel Azemar Mar 29 '23 at 08:56

0 Answers0