Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On install I get an error when attempting makemigrations #1

Open
peircej opened this issue Mar 21, 2023 · 1 comment
Open

On install I get an error when attempting makemigrations #1

peircej opened this issue Mar 21, 2023 · 1 comment

Comments

@peircej
Copy link

peircej commented Mar 21, 2023

I created a venv on Py3.8, activated that and installed the dependencies. When I call python manage.py makemigrations I get:

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/django/core/management/__init__.py", line 420, in execute
    django.setup()
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/django/apps/registry.py", line 116, in populate
    app_config.import_models()
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/django/apps/config.py", line 269, in import_models
    self.models_module = import_module(models_module_name)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/lpzjwp/code/behavioral-online-experiment/experiments/models.py", line 41, in <module>
    class Page(models.Model):
  File "/Users/lpzjwp/code/behavioral-online-experiment/experiments/models.py", line 62, in Page
    javascripts = MultiSelectField(choices=javascript_files, null=True, blank=True)
  File "/Users/lpzjwp/code/behavioral-online-experiment/pybole/lib/python3.8/site-packages/multiselectfield/db/fields.py", line 72, in __init__
    self.validators[0] = MaxValueMultiFieldValidator(self.max_length)
IndexError: list assignment index out of range
@jbuisine
Copy link
Member

Hi @peircej,
Thanks for your feedback. Indeed a new version of Django could cause this problem.

I just made the fix and a new version of the tool is now available. You can retrieve changes and update project dependencies:

pip install -r requirements.txt

Note: dependency versions are now fixed to avoid such issues in the future.

Tell me if it works now and I can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants