neulab / cmulab

CMU Linguistic Annotation Backend
14 stars 1 forks source link

Setup fails on "makemigrations" #8

Closed neubig closed 5 years ago

neubig commented 5 years ago

I get the following error:

(python3) tanuki:cmulab neubig$ python manage.py makemigrations annotator
Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/base.py", line 361, in execute
    self.check()
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/base.py", line 390, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/management/base.py", line 377, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/checks/registry.py", line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
    url_patterns = getattr(resolver, 'url_patterns', [])
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/utils/functional.py", line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/urls/resolvers.py", line 579, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/utils/functional.py", line 80, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/urls/resolvers.py", line 572, in urlconf_module
    return import_module(self.urlconf_name)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/neubig/work/cmulab/cmulab/urls.py", line 18, in <module>
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  File "/Users/neubig/anaconda3/envs/python3/lib/python3.6/site-packages/django/conf/urls/static.py", line 22, in static
    raise ImproperlyConfigured("Empty static prefix not permitted")
django.core.exceptions.ImproperlyConfigured: Empty static prefix not permitted

Maybe there's an environmental variable or something I need to set?

antonisa commented 5 years ago

Whoops sorry I hadn't pushed one last thing that set settings.MEDIA_URL and settings.MEDIA_ROOT. The last commit should do it!

neubig commented 5 years ago

Thanks!