Cris Towi
Cris Towi

Reputation: 1211

Where put my dajax file? Django

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?

Upvotes: 0

Views: 65

Answers (1)

abhishekgarg
abhishekgarg

Reputation: 1473

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")

Upvotes: 1

Related Questions