On 24 August 2010 06:54, Oivvio Polite <oiv...@polite.se> wrote: > Following advice on this list I've moved to virtualenv+pip to manage my > django stack, which so far is working out nicely. > > But what should I do about standalone scripts? Say I have a project > called mysite. If I'm in a virtualenv and execute a standalone script, > mysite won't be on my pythonpath and the script won't be able to import > it. > > For now I've solved this by symlinking mysite from my virtualenv > site-packages folder, but that sort of defeats the purpose of having > using virtualenv. > > What's the right way to go about it?
Following on from the other replies, here's a neat blog post that sums up your options - http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ It is also useful to know that if you need to activate a certain virtualenv for a script, you can do that by simply using the python executable in the bin/ directory of the virtualenv directory. I use this to run cronjobs so the virtualenv environment is set up for them. > Oivvio > > > > -- > http://pipedreams.polite.se/about/ > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.