I am unable to run python script inside my django project.
mkdir scriptstouch scripts/__init__.pytouch scripts/update_keyword.py
def run():
# Fetch all questions
print("run script")
Then I run my script with the help of the following command:
python manage.py runscript update_keyword.py
Now I am getting following error:
Unknown command: 'runscript'
Type 'manage.py help' for usage.
I have follow this blog https://django-extensions.readthedocs.io/en/latest/runscript.html . Kindly Help.
Django does not know this command since it is not listed anywhere. When you want to run a command with manage.py, use Django's Admin Command.
EDIT Or if you really want to use django_extensions for some reason, use their GitHub docs as reference. There it states you need to add this app to INSTALLED_APPS:
INSTALLED_APPS = (
...
'django_extensions',
...
)
Check the installation:
https://django-extensions.readthedocs.io/en/latest/installation_instructions.html
I guess you have missed this:
INSTALLED_APPS = (
...
'django_extensions',
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With