-
Access Models.py from external py script
almost 8 years ago
-
almost 8 years ago
You can write a django management command which can be run as
`python manage.py <command-name>`
it can be kept at app_name > management > commands > command_name.py
It will have access to all your django app code models/ methods from views or any classes.
Take the reference from Django-Custom-Command link.
You can call the same method from your web browser clicking a button if it links to that method using views.
-
1 Answer(s)