开发者

Django - javascript path

开发者 https://www.devze.com 2023-03-12 08:05 出处:网络
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.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消