Module Not Found Error after forking the oscar app

47 views
Skip to first unread message

ayo femi

unread,
May 25, 2019, 9:26:55 AM5/25/19
to django-oscar
Am experiencing module not found error after forking the oscar catalogue app. 
Tried adding the forked app to get_core_apps in the settings file, running python manage.py runserver returns  No module name 'apps', which was where i created catalogue app. The __init__.py is present in the apps folder and catalogue.

Meanwhile, an not getting this error for other apps in the same folder added to the INSTALLED_APPS
I have no clue of what might be wrong.
Enter code here...

from oscar import get_core_apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
# 'clue.apps.my_products',
'elasticsearch5',
# 'debug_toolbar',
    'compressor',
    'widget_tweaks',

] + get_core_apps(['clue.apps.catalogue'])



Samir Shah

unread,
May 25, 2019, 11:10:30 PM5/25/19
to django-oscar
What version of Oscar are you using? Also please share the full stack trace.

ayo femi

unread,
May 26, 2019, 2:05:22 AM5/26/19
to django-oscar
I have Django Oscar 1.6.7 installed in my environment.


(project_clue-lN_VOCeI) c:\git\project_clue>py web\manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper
 at 0x038BF978>
Traceback (most recent call last):
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\utils\autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\core\management\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\utils\autoreload.py", line 248, in raise_last_exception
    raise _exception[1]
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\core\management\__init__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\utils\autoreload.py", line 225, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\apps\registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\site-packages\d
jango\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "C:\Users\Ayo Paul\.virtualenvs\project_clue-lN_VOCeI\lib\importlib\__ini
t__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'apps'
.



 

Samir Shah

unread,
May 26, 2019, 10:55:46 AM5/26/19
to django-oscar
Django is failing to find the module you reference in `clud.apps.catalogue` - I guess that import path isn't correct. You can try importing it from the shell, and if it doesn't work you need to specify a path that does depending on where your module is located.

ayo femi

unread,
May 26, 2019, 4:47:46 PM5/26/19
to django...@googlegroups.com
I really appreciate your response.
What I did was to include the "apps/catalogue.__init__.py' in the get_core_apps
But I still don't know the implication of doing it this way but is working for now.
Also not sure if this is a bug in Django Oscar.


from oscar import get_core_apps
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
# 'clue.apps.my_products',
'elasticsearch5',
'debug_toolbar',
    'compressor',
    'widget_tweaks',

] + get_core_apps(['apps/catalogue.__init__.py'])



On Sun, 26 May 2019 at 15:55, Samir Shah <solari...@gmail.com> wrote:
Django is failing to find the module you reference in `clud.apps.catalogue` - I guess that import path isn't correct. You can try importing it from the shell, and if it doesn't work you need to specify a path that does depending on where your module is located.

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/2acb23fc-6aab-4724-90a7-72482b7484d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frantchesco Cecchin

unread,
May 26, 2019, 8:46:24 PM5/26/19
to django-oscar
Try to add this line in __init__ file of your forked catalogue app.
default_app_config = 'clue.apps.catalogue.apps.CatalogueConfig'

Samir Shah

unread,
May 26, 2019, 10:21:46 PM5/26/19
to django-oscar
I am not 100% sure, but think it's highly likely that the reason you're having to do this is because you're on Windows which handles file paths differently. Oscar doesn't officially support Windows, and I suspect you will run into more issues further down the line.

ayo femi

unread,
May 27, 2019, 3:44:24 AM5/27/19
to django...@googlegroups.com
The dafault_app_config is automatically generated by Oscar.  It is in the catalogue app __init__.py file after running the oscar_fork_app command . 
Still getting the same outcome
--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscribe@googlegroups.com.

ayo femi

unread,
May 27, 2019, 3:48:33 AM5/27/19
to django...@googlegroups.com
Sincerely would love to contribute to seeing Windows being supported in Django Oscar.

How do we go about it please ?
Thanks for the help 

On Monday, May 27, 2019, Samir Shah <solari...@gmail.com> wrote:
I am not 100% sure, but think it's highly likely that the reason you're having to do this is because you're on Windows which handles file paths differently. Oscar doesn't officially support Windows, and I suspect you will run into more issues further down the line.

--
https://github.com/django-oscar/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscribe@googlegroups.com.

Samir Shah

unread,
May 27, 2019, 3:58:11 AM5/27/19
to django-oscar
The get_core_apps issue should have been resolved in Oscar 2 (currently in beta), because it was removed completely and we now rely on Django's app framework.

I am sure there are still other issues with some of Oscar's dependencies - don't know exactly which ones because we don't develop with Windows, and there haven't been many bug reports. I guess a good place to start would be to identify where things don't work on Windows, and create an issue on Github that describes where the problems are. It would then need someone to spend the time trying to find solutions for them.

More than happy to facilitate code review for any fixes you are able to provide.

Thanks,

Samir
Reply all
Reply to author
Forward
0 new messages