[Fixed]-Django – Commands and context dictionaries

1πŸ‘

βœ…

I don’t understand what you mean by context dictionary here. The context in a view is for rendering a template; you don’t want to do that in your command. And in any case you don’t have a URL in the command, so there is no relationship to the view.

Instead you need to pass an argument, say the slug, to your command, and use that to get the event to delete. The documentation has an example that does almost exactly what you want.

Leave a comment