title: best way to store code for later execution (python)
body: <p>I have some tasks stored in db for later execution. For example i can fix task of sending email. And by cron exec task (send it). I search for best way to store code in db for later execution. For ex store it in raw string of python code and than do eval, but also i must store relative imports here.. </p>
  
  <p>for example for send email i must fix string like this:</p>
  
  <p>s = "from django.core.mail import send_mail\n
  send_mail('subj', 'body', 'email@box.ru',['email1@box.ru'], fail_silently=False)"</p>
  
  <p>and later eval.. any ideas to do it best way or mb better pattern for this kind of task?</p>