The Django app does not recognize a file that is in the folder for me

31 views
Skip to first unread message

מוריה יצחקי

unread,
Oct 21, 2021, 12:26:36 PM10/21/21
to django...@googlegroups.com
image.png
Hi everyone
I have an app.py file and the views.py file does not recognize it even though they are in the same folder.
In which file should I update that django will also recognize the app.py file
Thank you all!!!!



Steven Mapes

unread,
Oct 22, 2021, 9:30:21 AM10/22/21
to Django users
It'll most likely be because you are executing a file with a relative path and the Django is probably running in another folder so your best bet is to import BASE_DIR from settings.py then append the path to the app from your project root so <app_name>/app.py

ตี๋ ยกซด

unread,
Oct 22, 2021, 10:51:39 AM10/22/21
to django...@googlegroups.com
จัดการมันทันทีเลย

ในวันที่ ศ. 22 ต.ค. 2021 20:32 น. Steven Mapes <st...@jigsawtech.co.uk> เขียนว่า:
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ed80fb87-5014-49c5-9c2c-78640665ddeen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages