Django - javascript path
sometime simplest things are so complex!
I ha开发者_Python百科ve some javascript which works fine. I decided to put it in a seperate javascript file that I want to link to my template. I have put it in folder scripts/a_ajax.js off the root of the application. Whatever folder structure I've tried has not worked. I've also read something about that I must put a reference in urlpatterns but I'm not sure what I had to do.
Can anyone help tell me what I have to do to embed this code as a file?
thx
If your Django version is 1.3+: https://docs.djangoproject.com/en/dev/howto/static-files/
If your Django version 1.2.* or lower: https://docs.djangoproject.com/en/1.2/howto/static-files/
精彩评论