I am a noob and I want to know where put the ajax.py? In the dajax documentation they don give you that information. Is it in the '/static'
folder?
Asked
Active
Viewed 64 times
0
-
Can you show me the structure of a dajax application? – Cris Towi Jun 04 '13 at 22:31
1 Answers
1
i would suggest you to create a folder like lib
inside your django project, where you have your manage.py
, in lib folder you create a __init__.py
file so it acts as a module and then keep your ajax.py
inside that..
now you can do
from lib import ajax
in your code and it should work..
also as suggested by karthik..
in manage.py
import sys, os
sys.path.append(os.path.abspath(".")+"/lib")

abhishekgarg
- 1,480
- 9
- 14
-
or just add `lib` as a project path in the `manage.py` that way you can just do `import ajax` – karthikr Jun 04 '13 at 20:39
-
1yes, he can do that as well.. `import sys` `import os` `sys.path.append(os.path.abspath(".")+"/lib")` – abhishekgarg Jun 04 '13 at 20:44