Can't imagine why you would want to do this via CGI, it can't perform very well. There is a TON of stuff that gets setup during initialization for wsgi/runserver, etc......
Syntax wise your import is way off since your models do not live in the Django folder, you can't import them like this. I'd take a look at deploying mod_wsgi and running the app there. On Sunday, April 7, 2013 10:11:00 PM UTC-5, Pradeep Kumar wrote: > > Hi, > > I am creating a widget for one of our projects for the first time. The > script file used calls a python file in cgi-bin/widget.py > > Is there a way I can access models of a particular project in widget.py > using import ? > > say : from django.*projectname.appname.models* import * > > > I tried relocating the cgi-bin/ folder inside one of the project folders > but it wasn't recognizing the import as it didn't recognize the modules. > > > Currently I am using REST api provided by tastypie and getting the > required info used for widget. Is there a better way to do it? > > > Please let me know the available options for creating such widget backend > scripts and any good links will be helpful (found very few but none > addressing my issue). > > > > Thanks, > Pradeep > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

