Skip to content
Advertisement

Django Standalone Script in Django 4.1

I am trying to run a standalone script in django 4.1. I have the setup as suggested in this post at the top of my file:

Django Standalone Script

JavaScript

However, on the 4th line, I get the following error:

ModuleNotFoundError: No module named 'sport_api'

This is my INSTALLED_APPS in settings.py

JavaScript

How do I get around this error?

Update:

Directory Structure

Advertisement

Answer

You have to move the script to the manage.py layer. That’s the only thing that got this to work for me.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement