using django celery beat locally I get error 'PeriodicTask' object has no attribute '_default_manager'
<p>using django celery beat locally I get error 'PeriodicTask' object has no attribute '_default_manager'. I am using Django 1.10. When i schedule a task it works. But then a few moments later a red error traceback like the following occurs</p>

<pre><code>[2016-09-23 11:08:34,962: INFO/Beat] Writing entries...
[2016-09-23 11:08:34,965: INFO/Beat] Writing entries...
[2016-09-23 11:08:34,965: INFO/Beat] Writing entries...
[2016-09-23 11:08:34,966: ERROR/Beat] Process Beat
Traceback (most recent call last):
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/billiard/process.py", line 292, in _bootstrap
    self.run()
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/celery/beat.py", line 553, in run
    self.service.start(embedded_process=True)
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/celery/beat.py", line 486, in start
    self.scheduler._do_sync()
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/celery/beat.py", line 276, in _do_sync
    self.sync()
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/djcelery/schedulers.py", line 209, in sync
    self.schedule[name].save()
  File "/Users/ray/Desktop/myheroku/practice/lib/python3.5/site-packages/djcelery/schedulers.py", line 98, in save
    obj = self.model._default_manager.get(pk=self.model.pk)
AttributeError: 'PeriodicTask' object has no attribute '_default_manager'
</code></pre>

<p>after this  happens the next schedule wont run unless I "control+c" out of the terminal and start it again. I saw on git hub that this may be because I am using django 1.10. I have already git pushed this to my heroku server. How can I fix this issue? The git hub post said he fixed it by doing this</p>

<pre><code>Model = type(self.model)
obj = Model._default_manager.get(pk=self.model.pk)
</code></pre>

<p>I was willing to try this but I don't know where to put this and I don't want to cause a bigger unforeseen issue that this could cause. What are my options? am I supposed to manually go inside my remote app and reset it after every time it runs? thats unfeasible and defeats the purpose of task automation. </p>

<p>I figured it out. At line 98 in schedulers.py it was</p>

<pre><code>obj = self.model._default_manager.get(pk=self.model.pk)
</code></pre>

<p>so a line above it I added</p>

<pre><code>Model = type(self.model)
</code></pre>

<p>and changed </p>

<pre><code>obj = self.model._default_manager.get(pk=self.model.pk)
</code></pre>

<p>to    </p>

<pre><code>obj = Model._default_manager.get(pk=self.model.pk)
</code></pre>

<p>so completed it looks like this</p>

<pre><code>98  Model = type(self.model)
99  obj = Model._default_manager.get(pk=self.model.pk)
</code></pre>

python django heroku redis scheduled-tasks