open-craft / custom-form-app

An example app that can be used as a template for extending the registration form in the OpenEdx LMS.
16 stars 49 forks source link

when adding this app to LMS Django apps in the Bitnami instance and run DB migration script, Django couldn't find the module. #5

Open warrenchen968 opened 6 years ago

warrenchen968 commented 6 years ago

To whom it may concern,

I tried to use this instance in the EDX Bitnami instance and tried the following two options: 1. option with the default admin.py

when I run the DB migration script: sudo /opt/bitnami/apps/edx/bin/python.edxapp ./manage.py lms syncdb --migrate ext_registration --settings aws

The error shows:

Traceback (most recent call last): File "./manage.py", line 112, in startup.run() File "/opt/bitnami/apps/edx/edx-platform/lms/startup.py", line 52, in run django.setup() File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/opt/bitnami/apps/edx/venvs/edxapp/lib/python2.7/site-packages/django/apps/config.py", line 86, in create module = import_module(entry) File "/opt/bitnami/python/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named ext_registration

option 2: update the admin.py to:

"""Django admin pages for registration form extention configuration. """ from config_models.admin import ConfigurationModelAdmin from django.contrib import admin

from .models import ExtraUserInfo

Register your models here.

admin.site.register(ExtraUserInfo, ConfigurationModelAdmin)

Facing the same issue and error while migrating. Could you please tell me what's the solution? Thanks!

bradenmacdonald commented 6 years ago

@warrenchen968 Sorry for the delay. It appears that none of us were watching for bug reports on this repository.

The name of this package is custom_reg_form not ext_registration. Please make sure it is installed in the correct edxapp virtual environment (so if you run python and then type import custom_reg_form it works), and then try again. As long as you have added this to ADDL_INSTALLED_APPS according to the README, you do not need to specify any package name when you run the migrate command, so change your command to just sudo /opt/bitnami/apps/edx/bin/python.edxapp ./manage.py lms syncdb --migrate --settings aws