Re: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.3 pre-alpha
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.gis',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.markup',
 'domain',
 'testcal',
 'buildmanager',
 'httptester',
 'locations',
 'django_tables',
 'wqm',
 'django_extensions',
 'graphing',
 'calender',
 'backups',
 'gdata',
 'backends',
 'logtracker',
 'samples',
 'gencal',
 'logger',
 'user_registration',
 'docs',
 'hq',
 'smsnotifications',
 'ajax',
 'django_granular_permissions',
 'reporters',
 'webapp',
 'aquaReports',
 'requestlogger',
 'admin',
 'djangogcal',
 'aquatest',
 'reports',
 'standards',
 'patterns',
 'xformmanager',
 'receiver',
 'messaging']
Installed Middleware:
['django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.csrf.CsrfMiddleware',
 'hq.middleware.hq.HqMiddleware',
 'domain.middleware.DomainMiddleware']


Template error:
In template
/media/Otoro/Development/python/commcare-hq/apps/hq/templates/hq/partials/header.html,
error at line 10
   Caught ViewDoesNotExist while rendering: Could not import
smsnotifications.views. Error was: No module named forms
   1 : {% load i18n %}


   2 : 


   3 :   {% if user.is_authenticated %}


   4 :   Logged in as {{user}}{% if
user.selected_domain %} in domain {{
user.selected_domain}}{% endif %}  |


   5 :   {% ifnotequal user.active_domains|length  1 %}


   6 :     Change
Domain   |


   7 :   {% endifnotequal %}


   8 :


   9 :   {% if user.is_selected_dom_admin %}


   10 :     Domain
Settings   |


   11 :   {% endif %}


   12 :     Account
Settings   |


   13 :     Admin   |


   14 :     Help   |


   15 :     {% trans
"Log out" %}


   16 :


   17 :   {%else%}


   18 :   {% trans "Log in"
%}


   19 :   {%endif%}


   20 :


Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py"
in get_response
  100. response = callback(request, *callback_args,
**callback_kwargs)
File "apps/domain/decorators.py" in _inner
  85. return view_func(request, *args, **kwargs)
File "apps/hq/views.py" in dashboard
  57. return render_to_response(request, template_name, context)
File "rapidsms/lib/rapidsms/webui/utils.py" in render_to_response
  121. return django_r_to_r(template_name, rs_dict, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/shortcuts/__init__.py"
in render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader.py" in
render_to_string
  186. return t.render(context_instance)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  173. return self._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
render
  796. bits.append(self.render_node(node, context))
File "/usr/local/lib/python2.6/dist-packages/django/template/debug.py" in
render_node
  72. result = node.render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/loader_tags.py"
in render
  125. return compiled_parent._render(context)
File "/usr/local/lib/python2.6/dist-packages/django/template/__init__.py" in
_render
  167. return self.nodelist.render(context)
File "/usr/loca

Re: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
Sorry on that..
No i have not imported smsnotification.forms in the smsnotification model.
i have from smsnotifications.forms import SmsNotificationForm in the views

I further tried to import the smsnotifications.forms import
SmsNotificationForm in the django shell it worked okey.
but importing views  " from smsnotifications import views"
i get
Traceback (most recent call last):
  File "", line 1, in 
  File "apps/smsnotifications/views.py", line 51, in 
from smsnotifications.forms import SmsNotificationForm
ImportError: No module named forms

but commenting the import of SmsNotificationForm and coding the form
directly to the views works okey..

I further try to removed all other imports..except for from
smsnotifications.forms import SmsNotificationForm
and reduce all the veiw function to pass
ie
def index(request):
   pass
just to see if the import will work and i still get the error..

-- 
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.



Re: Djangoprojects tutorial

2010-06-28 Thread Allen Machary
Hi Eduan
I looks like you have not added your polls app in the Settings.py
file.
Open your setting.py file
find the installed apps.. which will look something like this.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
)

Now you have to add your polls app to the tuple of installed apps.
So should look somthing similar to this.
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'mysite.polls',
)

Allen M.

-- 
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.



Re: Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-28 Thread Allen Machary
anyone with any idea on this..?

-- 
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.



Caught ViewDoesNotExist while rendering: Could not import smsnotifications.views. Error was: No module named forms

2010-06-27 Thread Allen Machary
Hi All,
i have a problem in import problem. in importing forms.py in views.py
here are my files both located in smsnotifications app
 -- smsnotifications/forms.py
from django.forms import ModelForm
from smsnotifications.models import SmsNotification
class SmsNotificationForm(ModelForm):
class Meta:
model = SmsNotification
exclude = ('modified','created',)

-- smsnotifications/views.py
import logging
import hashlib
import settings
import traceback
import sys
import os
import uuid
import string
from datetime import timedelta
from graphing import dbhelper

from django.http import HttpResponse
from django.http import HttpResponseRedirect, Http404
from django.template import RequestContext
from django.core.exceptions import *
from django.views.decorators.http import require_http_methods
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from django.db import transaction
from django.db.models.query_utils import Q
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import redirect_to_login
from django.contrib.auth.forms import AdminPasswordChangeForm
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
#from django import forms

from rapidsms.webui.utils import render_to_response, paginated
#from rapidsms.reporters.models import *

#from xformmanager.models import *
#from hq.models import *
#from graphing.models import *
#from receiver.models import *

import hq.utils as utils
import hq.reporter as reporter
import hq.reporter.custom as custom
import hq.reporter.metastats as metastats

import hq.reporter.inspector as repinspector
import hq.reporter.metadata as metadata

from domain.decorators import login_and_domain_required
from reporters.utils import *
from reporters.views import message, check_reporter_form,
update_reporter
from reporters.models import Reporter, PersistantBackend,
PersistantConnection
from locations.models import Location, LocationType
from wqm.models import WqmAuthority, SamplingPoint
from smsnotifications.models import SmsNotification,
NotificationChoice
from smsnotifications.forms import SmsNotificationForm


logger_set = False


@login_and_domain_required
def index(request):
template_name = 'sindex.html'

notifications = SmsNotification.objects.all()
points = SamplingPoint.objects.all().order_by("name")
districts = WqmAuthority.objects.all()

return render_to_response(request,
template_name, {
"notifications": paginated(request, notifications,
prefix="smsnotice"),
"points" : points,
"districts":districts,
})

#...@require_http_methods(["GET", "POST"])
#...@login_and_domain_required
#def add_notifications(req):
#
#def get(req):
#template_name = "sms-notifications.html"
#notifications = SmsNotification.objects.all()
#districts = WqmAuthority.objects.all()
#points = SamplingPoint.objects.all()
#testers = get_tester(req.user)
#return render_to_response(req,
#template_name, {
#"notifications": paginated(req, notifications,
prefix="smsnotice"),
#"points" : points,
#"districts" : districts,
#"testers" : testers,
#"notification_types_choices" :
NotificationChoice.objects.all(),
#})
#
#@transaction.commit_manually
#def post(req):
## check the form for errors
#notice_errors = check_notice_form(req)
#
## if any fields were missing, abort.
#missing = notice_errors["missing"]
#exists = notice_errors["exists"]
#
#if missing:
#transaction.rollback()
#return message(req,
#"Missing Field(s): %s" % comma(missing),
#link="/smsnotification/add")
## if authorised tester with same notification and point
exists, abort.
#if exists:
#transaction.rollback()
#return message(req,
#"%s already exist" % comma(exists),
#link="/smsnotification/add")
#
#try:
## create the notification object from the form
#notification = SmsNotification()
#
#rep = Reporter.objects.get(pk =
req.POST.get("authorised_sampler",""))
#notification.authorised_sampler = rep
#
#choice = NotificationChoice.objects.get(pk =
req.POST.get("notification_type",""))
#notification.notification_type = choice
#
#point = SamplingPoint.objects.get(pk =
req.POST.get("sampling_point",""))
#notification.sampling_point = point
#
#notification.digest = req.POST.get("digest","")
#
#
## save the changes to the db
#notification.save()
#transaction.commit()
#
## full-page notification
#return message(req,
#"SMS notification %s a

Re: Django Sphinx Foreign key search

2010-05-22 Thread Allen Machary
search_string = req.REQUEST.get("search", "")

query = Model1.objects

if search_string == "":
query = query.all()
else:
query = query.filter(
   Q(text_field__icontains=search_string) |
   Q(fek_field__text_field__icontains=search_string))

the query variable will return the search results, searching the
text_field from model1 and then model2

On 5/22/10, urukay  wrote:
>
> No that's not what i want..i want search model over another model.
>
>
>
> esatterwh...@wi.rr.com wrote:
>>
>> You probably want to use the indexer argument. It allows you to
>> specify which indexes you want sphinx to search over. Of course you
>> have to tell sphinx which indexes ( models ) you want it to search in.
>>
>> http://www.sphinxsearch.com/docs/current.html#ref-indexer
>>
>> On May 21, 8:47 am, urukay  wrote:
>>> Well, still trying to solve it...maybe i found the right way to do it,
>>> but
>>> it's still in progress. If anything shows up, i'll keep you updated.
>>> Hopefully this during few days i'll solve it.
>>>
>>> Radovan
>>>
>>>
>>>
>>>
>>>
>>> yafeng wu wrote:
>>>
>>> > Hi,
>>>
>>> > I got the same problem when building my website. Have you solved it?
>>> > Please let me know.
>>>
>>> > Thanks,
>>>
>>> > On Apr 13, 4:04 am, urukay  wrote:
>>> >> Hi,
>>>
>>> >> I'm trying to create full text search on model, everything goes fine
>>> >> when
>>> >> searching TextFields but I have a problem with ForeignKey field.
>>>
>>> >> How can i do that? Can anyone point me to the right direction?
>>>
>>> >> Thanks
>>>
>>> >> Model example:
>>>
>>> >> class Model1(models.Model):
>>>
>>> >>      text_field =models.TextField(max_length=250)
>>> >>      fek_field = models.ForeignKey('Model2')
>>>
>>> >> class Model2(models.Model):
>>> >>      text_field = models.TextField(max_length=250)
>>>
>>> >> --
>>> >> View this message in
>>> >>
>>> context:http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28219147p282...
>>> >> Sent from the django-users mailing list archive at Nabble.com.
>>>
>>> > --
>>> > 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.
>>>
>>> --
>>> View this message in
>>> context:http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28228784p286...
>>> Sent from the django-users mailing list archive at Nabble.com.
>>>
>>> --
>>> 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
>>> athttp://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.
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28228784p28644474.html
> Sent from the django-users mailing list archive at Nabble.com.
>
> --
> 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.



Re: Django Sphinx Foreign key search

2010-05-22 Thread Allen Machary
search_string = req.REQUEST.get("search", "")

query = Model1.objects

if search_string == "":
query = query.all()
else:
query = query.filter(
   Q(text_field__icontains=search_string) |
   Q(fek_field__text_field__icontains=search_string))

the query variable will return the search results.

On 5/22/10, urukay  wrote:
>
> No that's not what i want..i want search model over another model.
>
>
>
> esatterwh...@wi.rr.com wrote:
>>
>> You probably want to use the indexer argument. It allows you to
>> specify which indexes you want sphinx to search over. Of course you
>> have to tell sphinx which indexes ( models ) you want it to search in.
>>
>> http://www.sphinxsearch.com/docs/current.html#ref-indexer
>>
>> On May 21, 8:47 am, urukay  wrote:
>>> Well, still trying to solve it...maybe i found the right way to do it,
>>> but
>>> it's still in progress. If anything shows up, i'll keep you updated.
>>> Hopefully this during few days i'll solve it.
>>>
>>> Radovan
>>>
>>>
>>>
>>>
>>>
>>> yafeng wu wrote:
>>>
>>> > Hi,
>>>
>>> > I got the same problem when building my website. Have you solved it?
>>> > Please let me know.
>>>
>>> > Thanks,
>>>
>>> > On Apr 13, 4:04 am, urukay  wrote:
>>> >> Hi,
>>>
>>> >> I'm trying to create full text search on model, everything goes fine
>>> >> when
>>> >> searching TextFields but I have a problem with ForeignKey field.
>>>
>>> >> How can i do that? Can anyone point me to the right direction?
>>>
>>> >> Thanks
>>>
>>> >> Model example:
>>>
>>> >> class Model1(models.Model):
>>>
>>> >>      text_field =models.TextField(max_length=250)
>>> >>      fek_field = models.ForeignKey('Model2')
>>>
>>> >> class Model2(models.Model):
>>> >>      text_field = models.TextField(max_length=250)
>>>
>>> >> --
>>> >> View this message in
>>> >>
>>> context:http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28219147p282...
>>> >> Sent from the django-users mailing list archive at Nabble.com.
>>>
>>> > --
>>> > 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.
>>>
>>> --
>>> View this message in
>>> context:http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28228784p286...
>>> Sent from the django-users mailing list archive at Nabble.com.
>>>
>>> --
>>> 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
>>> athttp://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.
>>
>>
>>
>
> --
> View this message in context:
> http://old.nabble.com/Django-Sphinx-Foreign-key-search-tp28228784p28644474.html
> Sent from the django-users mailing list archive at Nabble.com.
>
> --
> 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.



Re: One to One chat like Facebook?

2010-05-16 Thread Allen Machary
you can try looking-up on pinax apps.. and put it on ur project..
check out (might give you some light )
http://groups.google.com/group/pinax-users/browse_thread/thread/6ea6b0d5f79a69ac/ee84295138dc3e58?lnk=gst&q=wsgi#ee84295138dc3e58

Allen M.,

On 5/16/10, Dexter  wrote:
> I don't know, but I guess you could easily make your own.
>
> Django and Comet would be a nice combination
>
> Grtz, Dexter
>
> On Sun, May 16, 2010 at 12:13 PM, Anand Agarwal  wrote:
>
>> Hi All
>>
>> Is there any chat application in django similar to facebook chat?
>>
>>
>> Regards
>> Anand
>> Got an Idea? BootStrap it Today!!
>>
>> --
>> 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.
>
>

-- 
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.



Re: django signal and instace..... HELP!!

2010-04-22 Thread Allen Machary
The MeasuredValue gets saved after the sample is saved,  Is there another way 
to still use the sample instance (or force it to save ), Cause the function ( 
to send msg )  to should be sent only when the sample is created..

Any help will be appriciated.

thnx greatlemer

-- 
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.



django signal and instace..... HELP!!

2010-04-20 Thread Allen Machary
Hellow..
I have a problem on django signal and instances.
i have a right some code that runs a function after a certain model is
created but could not use the instace filter

Help

def send_sms_notifications(sender, instance, created, **kwargs): #get
sender, instance, created
# TODO: Lookup the reporters based on the sample point and
# figure out who to send to, what to send
# print sender.notes

reporter = instance.taken_by
point = instance.sampling_point

# A temporary SMS Response
# TODO: Auto generate response SMS.
msg = "Your sample data is submitted sucessfully.!"
# sending an sms to a submitter.
thread = Thread(target=_send_sms,args=(reporter.id, msg ))
thread.start()

# create massage for the authorised testers.
msg2 = "Test taken at site %s - %s." %
(instance.sampling_point.wqmarea, instance.sampling_point)
#ss =
Sample.objects.filter(taken_by=reporter,sampling_point=instance.sampling_point,
date_received=instance.date_received)

# The instance is displayed here.
print '### %s ' % (instance)
# I can get the instace id. OK
print '<<< %d' % (instance.id)
sample_id = instance.id


m_values = MeasuredValue.objects.filter(sample__id = sample_id)

# I NEED TO GET MEASUREDVALUE WITH RESPECT TO THE SAMPLE
# NO DATA IS RETURN HERE...
print '- %s ' % (m_values)
for m_value in m_values:
print "<< %s:%s" % (m_value.parameter.test_name,
m_value.value)
msg2 += " %s:%s" % (m_value.parameter.test_name,
m_value.value)

msg2 += '. Comment: %s'%(instance.notes)

# figure out who to send sms to in the notifation table.
notices = SmsNotification.objects.filter(sampling_point = point)
for notice in notices:
reporter = notice.authorised_sampler
# TODO: generate a sms according the the authorised tester.
# this is temp sms to authorised sampler
# send the sms
thread = Thread(target=_send_sms,args=(reporter.id, msg2 ))
thread.start()

def _send_sms(reporter_id, message_text):
data = {"uid":  reporter_id,
"text": message_text
}
encoded = urllib.urlencode(data)
headers = {"Content-type": "application/x-www-form-urlencoded",
   "Accept": "text/plain"}
try:
conn = httplib.HTTPConnection("localhost:8000") # TODO: DON'T
HARD CODE THIS!
conn.request("POST", "/ajax/messaging/send_message", encoded,
headers)
response = conn.getresponse()
except Exception, e:
# TODO: better error reporting
raise


# Register to receive signals each time a Sample is saved
post_save.connect(send_sms_notifications, sender=Sample)

-- 
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.