Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix: "RuntimeWarning: Model <my_model> was already registered."

Tags:

django

ipython

Since upgrading Django, I've been getting this error in iPython when I do imports:

RuntimeWarning: Model 'docket.search' was already registered. Reloading models is not advised as it can lead to inconsistencies, most notably with related models.

I'm guessing this is some automatic feature of iPython, but is there an easy solution? Is this something I even need to solve?

like image 369
mlissner Avatar asked Aug 15 '15 14:08

mlissner


1 Answers

Exactly the same problem had happened to me. The problem was that I had defined a model twice! Removing one of them solved the problem.

like image 163
H.sojoodi Avatar answered Sep 20 '22 03:09

H.sojoodi