activating models

57 views
Skip to first unread message

Atıl Ardıç

unread,
Mar 9, 2020, 5:14:33 PM3/9/20
to Django users

I added polls app in below place;But i am getting errors while i was running makemigrations 

INSTALLED_APPS = [
    'polls.apps.PollsConfig'
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]


C:\Users\ibrahim\Documents\Python Scripts\mart2020\mysite>py manage.py makemigrations polls
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 "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\core\management\__init__.py", line 377, in execute
    django.setup()
  File "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "C:\Users\ibrahim\AppData\Local\Programs\Python\Python38-32\lib\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 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 970, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'polls.apps.PollsConfigdjango'; 'polls.apps' is not a package

Omar Abou Mrad

unread,
Mar 10, 2020, 1:36:59 AM3/10/20
to django...@googlegroups.com
We need to see your directory structure.

meanwhile see if 'polls' works instead 'polls.apps.PollsAppConfig'

--
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/d5c976f6-a6df-4f1e-bd77-0417d62049b2%40googlegroups.com.

SHANKAR JHA

unread,
Mar 10, 2020, 1:47:58 AM3/10/20
to django...@googlegroups.com
I think you forget to put a comma (,) at the last. 

Try using the polls and check if it's working or not.

It's best practice to put your app at the last because you want all the package to load in first when you open your website.
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
     'polls.apps.PollsConfig',
]



Atıl Ardıç

unread,
Mar 10, 2020, 11:41:14 AM3/10/20
to django...@googlegroups.com
Thanks Shankar :) it worked after putting a comma 


Reply all
Reply to author
Forward
0 new messages