Skip to content

bugfix: fix import on default template model

Sylvain Lehmann requested to merge bugfix/template_model into master

The default template model causes an error for a user following the documentation ̀https://docs.startinblox.com/import_documentation/djangoldp_guide/install-djangoldp-server.html`

Traceback (most recent call last):
  File "/home/user/PycharmProjects/djangoldp-boilerplate/sibserver/manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
  File "/home/user/tmp/djangoldp-boilerplate/lib/python3.8/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/user/tmp/djangoldp-boilerplate/lib/python3.8/site-packages/django/core/management/__init__.py", line 357, in execute
    django.setup()
  File "/home/user/tmp/djangoldp-boilerplate/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/user/tmp/djangoldp-boilerplate/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/user/tmp/djangoldp-boilerplate/lib/python3.8/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/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 "/home/user/PycharmProjects/djangoldp-boilerplate/sibserver/djangoldp_boilerplate/models.py", line 3, in <module>
    class Dummy(Model):
  File "/home/user/PycharmProjects/djangoldp-boilerplate/sibserver/djangoldp_boilerplate/models.py", line 4, in Dummy
    name = models.CharField(max_length=255, blank=True)
NameError: name 'models' is not defined
Configuration error: Command '['/home/user/tmp/djangoldp-boilerplate/bin/python', '/home/user/PycharmProjects/djangoldp-boilerplate/sibserver/manage.py', 'configure']' returned non-zero exit status 1.

This should fix the import

Edited by Sylvain Lehmann

Merge request reports