subscribe user to erang

This commit is contained in:
sanj 2010-07-23 16:08:48 +05:30
parent 9508000a92
commit 999767a16a
2 changed files with 6 additions and 1 deletions

View File

@ -10,6 +10,8 @@ try:
except: except:
import simplejson as json import simplejson as json
from django.core.mail import send_mail from django.core.mail import send_mail
from settings import ERANG_SUBSCRIBE_URL
import urllib2
def index(request): def index(request):
index_data = {} index_data = {}
@ -157,6 +159,8 @@ def save_email(request):
if validateEmail(email): if validateEmail(email):
t = Signup(email=email) t = Signup(email=email)
t.save() t.save()
erang_subscribe_url = ERANG_SUBSCRIBE_URL + "email"
subscribed = urllib2.urlopen(erang_subscribe_url).read()
return HttpResponse("1") return HttpResponse("1")
else: else:
return HttpResponse("0") return HttpResponse("0")

View File

@ -28,7 +28,7 @@ DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
ERANG_SUBSCRIBE_URL = "http://a.organisedmail.com/nok.x?s=dGhlYXRyZWZvcnVt&ctid=YWRjZWUzOGVjMGYyZGUwNmYyOWFkZTk5ZWYyMjNjMjQ&emaddr="
# Local time zone for this installation. Choices can be found here: # Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems. # although not all choices may be available on all operating systems.
@ -123,6 +123,7 @@ INSTALLED_APPS = (
'django_extensions', 'django_extensions',
'debug_toolbar', 'debug_toolbar',
'sorl.thumbnail', 'sorl.thumbnail',
'south',
) )
#overwrite default settings with local settings #overwrite default settings with local settings