Good day! I will try to explain this problem in much detail as I can.
I have built a django app (in this case it is named Partners App) and configured its
admin.py files. It seems to be working since in my openedx tutor instance, the models I’ve created reflects in the admin side of my website as you can see in the image below.
But whenever I click on it, it returns a 500 error. I checked the log files and that’s when I found out that the tables were not even created in the database. It just reflects in the admin side and I don’t know why. I tried searching for a fix and I’ve applied everything that I’ve searched for.
For example, when I am running the
tutor local quickstart command, it is to be expected that the migrations should take effect, but it doesn’t detect the partners app’s
Some of you might ask, " Did you check if it is in the
INSTALLED_APPS?" well, the answer is yes. My django app is detected by the openedx instance. But why would the app be detected but its
models.py can’t be detected?
To explain the problem further, a suggestion from a research has explained that I should specify the app if I were to create tables via migrations, so that’s what I did. I tried to run
tutor local run lms ./manage.py lms makemigrations partners and here’s what happened:
Migrations for ‘partners’:
- Create model Expert
- Create model Partner
- Create model PartnerCourse
- Add field partner to expert
With this, I suspect that the makemigrations command worked successfully. So I tried running the next command to create my tables which is
tutor local run lms ./manage.py lms migrate partners, but here’s when the error popped out where I can’t find any fixes yet and can’t progress any further.
Despite that the
makemigration worked, I don’t know why the
migrate command didn’t. By this time, none on the internet helped me so far. I would be waiting for answers and guidance from the experts.