Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named app_resolver #7

Closed
ikresoft opened this issue Nov 18, 2012 · 15 comments
Closed

No module named app_resolver #7

ikresoft opened this issue Nov 18, 2012 · 15 comments
Labels

Comments

@ikresoft
Copy link

after using 0.3.2 version I get this error No module named app_resolver?

@noirbizarre
Copy link
Owner

app_resolver is unknown to me.
It doesn't seems to be a django.js error.
Can you describe a little bit more the problem ?

  • when is the error thrown ?
  • a stacktrace
  • ...

@ikresoft
Copy link
Author

Environment:

Request Method: GET
Request URL: http://www.faretti-shoes.com/djangojs/urls

Django Version: 1.4.2
Python Version: 2.6.6
Installed Applications:
('admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
'is_admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.comments',
'django.contrib.sitemaps',
'djangojs',
'dajaxice',
'tagging',
'pagination',
'filebrowser',
'ikresoft.ext',
'tinymce',
'cms',
'mptt',
'menus',
'south',
'reversion',
'sekizai',
'cms.plugins.flash',
'cms.plugins.link',
'cms.plugins.snippet',
'cms.plugins.text',
'cms.plugins.twitter',
'cms.plugins.inherit',
'cmsplugin_youtube',
'cmsplugin_contact',
'ikresoft.gallery',
'ikresoft.articles',
'registration',
'profiles',
'haystack',
'rosetta',
'nani',
'filer',
'cmsplugin_filer_file',
'cmsplugin_filer_folder',
'cmsplugin_filer_image',
'cmsplugin_filer_teaser',
'cmsplugin_filer_video',
'categories',
'ikresoft.editor',
'openshop',
'shop',
'shop.addressmodel',
'ikresoft.barkod',
'sifarnik',
'kolekcija',
'proizvodnja',
'zaposleni',
'plate',
'debug_toolbar')
Installed Middleware:
('django.middleware.gzip.GZipMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.doc.XViewMiddleware',
'pagination.middleware.PaginationMiddleware',
'cms.middleware.multilingual.MultilingualURLMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware')

Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response

  1.                     response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/usr/lib/pymodules/python2.6/django/views/generic/base.py" in view
  2.         return self.dispatch(request, _args, *_kwargs)
    
    File "/usr/lib/pymodules/python2.6/django/views/generic/base.py" in dispatch
  3.     return handler(request, _args, *_kwargs)
    
    File "/home/ikresoft/virtual/lib/python2.6/site-packages/django.js-0.3.2-py2.6.egg/djangojs/views.py" in get
  4.     data = self.get_context_data(request, _args, *_kwargs)
    
    File "/home/ikresoft/virtual/lib/python2.6/site-packages/django.js-0.3.2-py2.6.egg/djangojs/views.py" in get_context_data
  5.     return self.get_urls(module)
    
    File "/home/ikresoft/virtual/lib/python2.6/site-packages/django.js-0.3.2-py2.6.egg/djangojs/views.py" in get_urls
  6.                 urls.update(self.get_urls(pattern.urlconf_name, pattern.regex.pattern))
    
    File "/home/ikresoft/virtual/lib/python2.6/site-packages/django.js-0.3.2-py2.6.egg/djangojs/views.py" in get_urls
  7.                 urls.update(self.get_urls(pattern.urlconf_name, pattern.regex.pattern))
    
    File "/home/ikresoft/virtual/lib/python2.6/site-packages/django.js-0.3.2-py2.6.egg/djangojs/views.py" in get_urls
  8.         **import**(module)
    

Exception Type: ImportError at /djangojs/urls
Exception Value: No module named app_resolver

@noirbizarre
Copy link
Owner

OK, it seems to be specific to django-cms way of resolving apps: https://github.com/divio/django-cms/blob/master/cms/appresolver.py.

I'll try to fix this issue as soon as possible (I never used django-cms, I'll need to investigate).

@noirbizarre
Copy link
Owner

Can you provide a sample project to reproduce the bug ?
I will try to fix it before the next release (soon)

@ikresoft
Copy link
Author

django-cms is using this appresolver to resolve extra apps that doesn't exist in INSTALLED_APPS, so if there dynamic apps connected to pages, appresolver is puting urls of apps to root cms urls.

@szelga
Copy link
Contributor

szelga commented Jul 1, 2013

here's your sample: https://github.com/szelga/js-cms-test (sorry if it's too late).

@szelga
Copy link
Contributor

szelga commented Jul 2, 2013

OK, i managed to fix it: szelga@10d5082
it's kinda quick and dirty, so i dare not to offer it as a pull request.
tested with django-cms 2.4.2

@noirbizarre
Copy link
Owner

It's never too late !!!

I will look at your sample project et your fix ASAP.

2 possibilities:

  • you can clean and test your fix and submit a pull-request
  • I can do it myself

@noirbizarre
Copy link
Owner

I can't reproduce the bug with the sample project.
With both the provided version (4738b19 aka. the current master) and the latest stable (0.7.6), I have no error when accessing http://localhost:8000/djangojs/init.js.
Am I missing something?

@szelga
Copy link
Contributor

szelga commented Jul 3, 2013

have you created (and published) any django-cms pages?
preferrably 2: one standard page and one with an application attached (i have provided a sample application in the project).

@noirbizarre
Copy link
Owner

Yep, I created pages with and without application, nested pages... no errors.

I excuded admin URLs for better readabiity:

JS_URLS_NAMESPACES_EXCLUDE = (
    'admin',
)

and got this:

{
    "django_js_urls": "/djangojs/urls",
    "myapp-view2": "/test/",
    "js_catalog": "/djangojs/translation",
    "django_js_context": "/djangojs/context",
    "pages-root": "/",
    "django_js_init": "/djangojs/init.js",
    "pages-details-by-slug": "/<slug>/"
}

Are you expecting the pages to appears in ?

@szelga
Copy link
Contributor

szelga commented Jul 3, 2013

  1. on page http://127.0.0.1:8000/admin/cms/page/ create root page with some content, and, say, page with slug 'test2' hooked with 'My App' application (advanced settings tab). make sure that pages are published and you also clicked "publish draft" button. then test it.
  2. post here your pip freeze output.

@noirbizarre
Copy link
Owner

OK, I'll test it today.

@noirbizarre
Copy link
Owner

OK, I reproduce the bug but I need to restart the server.

I just took the try...except part of your fix, not the refactoring.
Maybe I'll do this refactoring one day, but not as part of a fix.

@noirbizarre
Copy link
Owner

And thanks for the fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants