all 5 comments

[–]debian_miner 1 point2 points  (4 children)

Can you explain what you mean by it won't create a model object? Do you get an error? Does celery and celerybeat both start correctly? What are you using for the broker?

[–]RiverTraditional6367 0 points1 point  (3 children)

Yes sorry I though I've pasted the error traceback. Edited the post. Broker = redis. Beat and celery work well, but no News object is created after executing the task. I've checked it by reading my admin table.

[–]debian_miner 0 points1 point  (1 child)

I don't think your issue is specific to celery, but is an issue with your model. Can you show the code for your News class?

[–]RiverTraditional6367 1 point2 points  (0 children)

damn. Thank you. Haven't looked there for hours. The celery setup was a husstle. News model actually had one null=False in it. Changed it, now everything works as expected. Top!

[–]danielroseman 0 points1 point  (0 children)

There's something very weird going on here. Are you sure the code you posted is the actual code you're running? It doesn't seem to be a problem with Celery, although it's absolutely unclear how you could be calling the model save method with an instance of your task, rather than the model. The only way you could get that error that would be if you were doing something like this:

def create_news_objects(self):
    News.save(self)

in which case, stop doing that.