javascript - Error in load a .js file in Django app with Cocos2d-JS -


i'm developing game in cocos2d-js django backend. and, i'm getting error in chrome console:

get http://127.0.0.1:8000/users/filipefr/documents/appname/appname/static/static/js/platform/html5/cocos2d/platform/jsloader.js 404 (not found)  

although checked, , jsloader exists in folder.

in mac terminal, i'm getting error:

"get /users/filipefr/documents/appname/appname/static/static/js/platform/html5/cocos2d/platform/jsloader.js http/1.1" 404 2461 

you're using absolute path. should use relative path. check settings.py, should have this:

import os base_dir = os.path.dirname(os.path.dirname(__file__)) static_url = '/static/'  staticfiles_dirs = (     os.path.join(base_dir, 'static'), ) 

and on urls.py should have this:

url(r'^media/(?p<path>.*)$', 'django.views.static.serve', {              'document_root': settings.media_root, }), 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -