Django-Firebase cloudstore ORM

216 views
Skip to first unread message

sparsh goil

unread,
Jun 9, 2020, 7:53:29 PM6/9/20
to Django users
Hey, 
Does anyone know how to perfectly use Firebase with Django?

I am using Django-Firebase-ORM which automatically maps my models to cloud firestore database but I am getting error.
Model.py
from firebase_orm import models
# Create your models here.

class Article(models.Model):
    headline = models.TextField()
    type_article = models.TextField(db_column='type')

    class Meta:
        db_table = 'medications'

    def __str__(self):
        return self.headline

>python3 manage.py makemigrations

Error:
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 "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/apps/registry.py", line 122, in populate
    app_config.ready()
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 24, in ready
    self.module.autodiscover()
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/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 "/home/spaggy/Documents/Summer Internship 2020/AI_legal/AI_legal/case_archives/admin.py", line 4, in <module>
    admin.site.register(Article)
  File "/home/spaggy/Documents/Summer Internship 2020/venv/lib/python3.6/site-packages/django/contrib/admin/sites.py", line 103, in register
    for model in model_or_iterable:
TypeError: 'ModelBase' object is not iterable



Integr@te System

unread,
Jun 10, 2020, 4:11:11 AM6/10/20
to django...@googlegroups.com
Hi Goil,

Did you register your model to site admin contrib.




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2208da1b-3469-4a30-ab7e-4fda4016fe8bo%40googlegroups.com.

Kidwell Nyatsambo

unread,
Jun 21, 2020, 4:35:44 PM6/21/20
to django...@googlegroups.com

Please help which Anaconda version comes with Django.

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP5HUWpZ1-R8GTsCj-050VP%2B-cYqxqb7aUhwPA0DPDqmdt_OZQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages