summaryrefslogtreecommitdiff
path: root/app/cron/create_country_sidebar.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2012-09-22 22:27:04 -0400
committerluxagraf <sng@luxagraf.net>2012-09-22 22:27:04 -0400
commitefb623af0bcb47d510501c282e1326b11343a29c (patch)
tree3a35fb19f5eba3b219c65277a5fb712cbe9604ac /app/cron/create_country_sidebar.py
parent0b481fd7931c2ae20ca21f89a87f2ba6a6c01e10 (diff)
site reorg
Diffstat (limited to 'app/cron/create_country_sidebar.py')
-rw-r--r--app/cron/create_country_sidebar.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/cron/create_country_sidebar.py b/app/cron/create_country_sidebar.py
new file mode 100644
index 0000000..f660c73
--- /dev/null
+++ b/app/cron/create_country_sidebar.py
@@ -0,0 +1,19 @@
+import sys, os
+
+sys.path.append('/home/luxagraf/webapps/django1_1')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/apps')
+sys.path.append('/home/luxagraf/webapps/django1_1/luxagraf/lib')
+sys.path.append('/home/luxagraf/webapps/django1_1/lib/python2.5/')
+os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+
+from django.template import Context
+from django.template import loader
+from django.conf import settings
+from locations.models import Country,Region
+c = Context({'country_list': Country.objects.filter(visited=True),})
+t = loader.render_to_string('includes/country_sidebar_template.html',c)
+fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/country_sidebar.html')
+file = open(fpath, 'w')
+file.write(t)
+file.close() \ No newline at end of file