Error with makemigrations and migrate

I edited the file for a custom registration form. After running

make update-db

I get

Your models have changes that are not yet reflected in a migration, and so won't be applied. Run ' makemigrations' to make new migrations, and then re-run ' migrate' to apply them.

as an error message. So following this I try running

python makemigrations

and get this as an error

Traceback (most recent call last): File "./", line 20, in <module> from safe_lxml import defuse_xml_libs ImportError: No module named safe_lxml

Tried looking on web no luck so far. Please Help.

Version: Ironwood(Docker)
OS: Linux

1 Like

me too
try to run this command

1 Like

@Hrithik_Raj is it work with you?

nope. After running the suggested command the update happens but the expected change is not seen.
Thanks for replying tho.

finally, I found the solution:
try to run these commands:

cd /edx/app/edxapp/edx-platform
./ lms makemigrations reg_extension_form
./ lms migrate reg_extension_form
sudo /edx/bin/supervisorctl restart lms

note: replace reg_extension_form with your folder name that have customization

References :

@Hrithik_Raj, have you tried installing safe_lxml manually on your devstack? You can do it like this:

make lms-shell
pip install -e /edx/app/edxapp/edx-platform/common/lib/safe_lxml/

Then you can run the makemigrations again.

1 Like