0

I have a view that I want to call using a management command, is this even possible ? I read through the django help, but I was not super clear on this aspect.

I am currently running it on a development REST server.My views just send out an email, so REST might not be necessarily required. I want to run this periodically. I was thinking management command is the best way to do this, since it will eliminate the need to run the development test server ?

user1524625
  • 271
  • 1
  • 7
  • 19
  • 8
    Why not just isolate the code that sends email, then call it from your management command as well as your view? – Peter DeGlopper Nov 06 '13 at 23:15
  • I second that. The purpose of a View is to handle an HTTP request. Move your code that sends the email to a function so you can call it in your management command. – Joucks Nov 06 '13 at 23:19

0 Answers0