Giter Club home page Giter Club logo

Comments (15)

noirbizarre avatar noirbizarre commented on June 29, 2024

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
  • ...

from django.js.

ikresoft avatar ikresoft commented on June 29, 2024

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

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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).

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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

from django.js.

ikresoft avatar ikresoft commented on June 29, 2024

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.

from django.js.

szelga avatar szelga commented on June 29, 2024

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

from django.js.

szelga avatar szelga commented on June 29, 2024

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

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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?

from django.js.

szelga avatar szelga commented on June 29, 2024

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).

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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 ?

from django.js.

szelga avatar szelga commented on June 29, 2024
  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.

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

OK, I'll test it today.

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

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.

from django.js.

noirbizarre avatar noirbizarre commented on June 29, 2024

And thanks for the fix !

from django.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.