javascript - Django cannot find the djangular/app.js file via the urls.py config. How to troubleshoot? -


i've spent few days trying figure out , it's driving me wall. i'm limited on can copy , paste, forgive 'code brevity'. have working version developed , have uploaded github.

i'm developing django website uses angularjs, i'm using djangular package, bit lets me import django variables angular. this section github:

to use angularjs module djangular provides you, you'll need add djangular app projects urls.

 urlpatterns = patterns('',       ...       url(r'^djangular/', include('djangular.urls')),       ...   ) 

and i've placed in project/urls.py file. i've done same github repository.

when reference url in appname/app/index.html, this:

<script src="{% static 'djangular/app.js' %}"></script> 

but leads 500 response server angular produces module 'djangular' not available! error. should happening url djangular/app.js in script tag above, should redirect urls.py inside djangular folder in python site-packages, points djangularmoduletemplateview.as_view(). seems work in github version, not in local version have reason.

if have script tag without "{%static '...'%}" part still 500, same error:

<script src="/djangular/app.js"></script> 

what config possibly have overlooked that's causing app not find right djangular config? i've stared @ both configurations long eyes glazing over, , i'm struggling find differences. else be?

i'm more happy provide more details if needed answer question.

i managed solve myself running ./manage syncdb

this creates various tables (the user table, , session table @ least) required djangular run.

then double checked <script> imports/includes.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -