ModuleNotFoundError: No module named 'useracc' When deploying to heroku

Viewed 149

Actually I m deploying my project to heroku to check how its working. I have created an app for user registrations and login management. App is working fine in the development server. I have registered the app in the settings installed app. When i am trying to deploy the app in the heroku, it's failing continuously with the same error module not found. below is my traceback of the error.

Traceback (most recent call last):
remote:          File "manage.py", line 22, in <module>
remote:            main()
remote:          File "manage.py", line 18, in main
remote:            execute_from_command_line(sys.argv)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
remote:            utility.execute()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 377, in execute
remote:            django.setup()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
remote:            apps.populate(settings.INSTALLED_APPS)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
remote:            app_config = AppConfig.create(entry)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
remote:            module = import_module(entry)
remote:          File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
remote:            return _bootstrap._gcd_import(name[level:], package, level)
remote:          File "<frozen importlib._bootstrap>", line 994, in _gcd_import
remote:          File "<frozen importlib._bootstrap>", line 971, in _find_and_load
remote:          File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
remote:        ModuleNotFoundError: No module named 'useracc'
remote: 
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote:
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:

I have also tried disabling the collectstatic just to check the error but it doesn't seem to be a solution of this problem. one more thing that i have noticed that vs code is showing that apps folder in grey color not in white which is a usual color. just like vs code shows .gitignore in grey color same its showing that app folder name in grey. i don't know why.

1 Answers

So i found the actual thing after checking lots of things. The problem is that when i have created the virtual env a .gitignore file is created with the command written inside it '*'. This causing error because whenever i create commit it doesn't include that app folder and ignore it. I forgot to check it while creating the commit for pushing it into heroku. When i removed that asterik and tried git status it showed that app folder untracked and bingo that was the error actually. Right now i don't know what that asterik means in a gitignore file. I will search for it. So this is the real problem. Thankyou all for your precious time to look into this matter. Hope this will help someone in future.

Related