Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
The command & error from createsuperuser:
macpro1:dripFeedSite bobaalsma$ python manage.py createsuperuser
Traceback (most recent call last):
  File "manage.py", line 19, in 
execute_from_command_line(sys.argv)
  File 
"/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File 
"/Library/Python/2.7/site-packages/django/core/management/__init__.py", 
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", 
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py",
 
line 70, in handle
default_username = get_default_username()
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", 
line 105, in get_default_username
default_username = get_system_username()
  File 
"/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", 
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 503, in getdefaultlocale
return _parse_localename(localename)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 435, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

Funny thing here is that "unknown locale: UTF-8" because yesterday the 
missing locale was connected to the language setting (although I don't 
recall the literal text)

Some settings do go right, though:
macpro1:dripFeedSite bobaalsma$ python manage.py shell
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import os
>>> os.environ
{'LC_CTYPE': 'UTF-8', 'TERM_PROGRAM_VERSION': '303.2', 'LOGNAME': 
'bobaalsma', 'USER': 'bobaalsma', 'PATH': 
'/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin',
 
'HOME': '/Users/bobaalsma', 'DISPLAY': '/tmp/launch-v6JEoW/org.x:0', 
'TERM_PROGRAM': 'Apple_Terminal', 'LANG': 'nl-NL', 'TERM': 
'xterm-256color', 'Apple_PubSub_Socket_Render': 
'/tmp/launch-h01Q9P/Render', 'TZ': 'Europe/Amsterdam', 'SHLVL': '1', 
'TMPDIR': '/var/folders/c8/j7h0mxjn7x993xm51xqyfplwgn/T/', 
'TERM_SESSION_ID': '5CEEB33C-3AC2-475C-807B-3A3909952D3F', 'SSH_AUTH_SOCK': 
'/tmp/launch-H5Mr23/Listeners', 'SHELL': '/bin/bash', '_': 
'/Library/Frameworks/Python.framework/Versions/2.7/bin/python', 'OLDPWD': 
'/Users/bobaalsma', '__CF_USER_TEXT_ENCODING': '0x1F5:0:5', 
'Apple_Ubiquity_Message': '/tmp/launch-iTRGIn/Apple_Ubiquity_Message', 
'PWD': '/Users/bobaalsma/Programmatuurontwikkeling/DripFeed/dripFeedSite', 
'DJANGO_SETTINGS_MODULE': 'dripFeedSite.settings', 'COMMAND_MODE': 
'unix2003'}

I'm not really sure what to do here: obviously creating a superuser is not 
an everyday thing, so maybe an other route will suffice. On the other hand: 
this situation feels like an unpredictable system :((





Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:
>
> I'm a newbie following the tutorial. In this, creating a superuser is 
> described, using 
>
> manage.py createsuperuser --username=joe --email=j...@example.com
>
>
> Using this leads to an error, which I could match to the closed ticket 
> #16017.
>
> But I couldn't find how to proceed from there. It seems some software was 
> changed about 4 weeks ago:
> "Made createsuperuser more robust when getting current OS username."
>
> So where can I find it?
> [I'm assuming there is a procedure for this, but I'm sorry to say I 
> couldn't find that either]
>
> Regards,
> Bob
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/I0tSu_BgzHQJ.
To post to this group, send email to django-users@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.



Conditions in template slows down the software

2012-09-14 Thread Sandeep kaur
I have used many condition in my templates, in order to filter my
results. My template file uses this code  :

{% for clients in client %}
{% for amounts in amount %}
{% for suspences in suspence %}
{% for tadas in tada %}
 {% for transports in transport %}
 {% if clients.job_no == amounts.job_no%}
 {% if clients.job_no == suspences.job_no %}
{% if clients.job_no == tadas.job_no %}
{% if clients.job_no == transports.job_no %}
  

{{ clients.job_no}}
 {{ clients.date }}
 {{ clients.receipt_no }}
 {{clients.name_and_address}}
{{amounts.field}}
...
...

This code slows down the system to a great extent. Please suggest me
an alternate and better solution.

-- 
Sandeep Kaur
E-Mail: mkaurkha...@gmail.com
Blog: sandymadaan.wordpress.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-users@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: Conditions in template slows down the software

2012-09-14 Thread Jani Tiainen

kirjoitti:

I have used many condition in my templates, in order to filter my
results. My template file uses this code  :

{% for clients in client %}
 {% for amounts in amount %}
 {% for suspences in suspence %}
 {% for tadas in tada %}
  {% for transports in transport %}
  {% if clients.job_no == amounts.job_no%}
  {% if clients.job_no == suspences.job_no %}
{% if clients.job_no == tadas.job_no %}
 {% if clients.job_no == transports.job_no %}
   

{{ clients.job_no}}
 {{ clients.date }}
 {{ clients.receipt_no }}
 {{clients.name_and_address}}
{{amounts.field}}
...
...

This code slows down the system to a great extent. Please suggest me
an alternate and better solution.



You should process your data in a view to be suitable for rendering 
rather than using template to do data processing.


--
Jani Tiainen

- Well planned is half done and a half done has been sufficient 
before...


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@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: Alternatives to CBVs (class based views)

2012-09-14 Thread Cal Leeming [Simplicity Media Ltd]
On Fri, Sep 14, 2012 at 12:12 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> On Thu, Sep 13, 2012 at 12:58 AM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
> > Hi all,
> >
> > There is a lot of debate on whether there is a real future for the Django
> > CBVs (class based views).
>
> Sigh.


Thank you for the detailed response on this - hopefully this thread will
serve as a reference point for people in the future


>
> No - there isn't *any* debate about the future of CBVs. There *are* a
> lot of people who apparently don't like them who keep making a lot of
> noise. Every single time I've spoken with one of those people at
> length, the problem has reduced to either:
>
>  1) I don't like classes/OO. There's no winning these people over.


Well that's certainly not the reason I dislike them - OO makes views
tidier, simple.


>  2) CBV's aren't documented well. You won't get any argument from me
> on (2). I'll take the hit for that -- the initial documentation for
> CBVs was my doing, and it has lots of room for improvement.


+1




> I'm not aware of anyone in the core that has advocated removing
> class-based views from Django.


> > Personally, I find them tedious, and just wanted a
> > way to keep my views clean.
> >
> > So, here is a really minimalistic way of having class based views,
> without
> > the fuss.
> >
> > http://djangosnippets.org/snippets/2814/
> >
> > This is a fork from:
> >
> > http://stackoverflow.com/questions/742/class-views-in-django
> > http://djangosnippets.org/snippets/2041/
> >
> > My thanks to eallik for his initial post on stackoverflow for this.
> >
> > Personally I think Django's CBVs should offer a really minimalistic base
> > like this, as well as the existing CBV stuff already in the core - so as
> to
> > not force people into needing to learn an entirely new way of doing
> things,
> > but at the same time allowing them to reap some of the benefits of using
> > callable classes as views.
> >
> > Any thoughts?
>
> What you've described -- a single entry point class-based view base
> class -- *does* exist. It's called django.views.generic.View. Override
> the "dispatch" method, or write a "get/post/put/etc" method, and
> you've got a class-based view.
>

I noticed this yesterday whilst trawling through the documentation again,
so I will look at this again.


>
> I also think you should read the discussions that led to the current
> form of Class-based views. The pattern you've proposed from Stack
> Overflow was one of many suggestions that were made, and were rejected
> because of inherent problems with the approach. The discussions are
> summarised in the wiki:
>
> https://code.djangoproject.com/wiki/ClassBasedViews


Thanks for sending this link through, looks very detailed, I will spend an
hour or two reading through it all and put some thoughts back.


>
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@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-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Tom Evans
On Fri, Sep 14, 2012 at 8:52 AM, Bob Aalsma  wrote:
> The command & error from createsuperuser:
> macpro1:dripFeedSite bobaalsma$ python manage.py createsuperuser
> …

Can I ask you to try some things, just to see how your environment is
setup. All of these commands run on the bash shell as a regular user.

1) The output of running "locale". Hopefully OS X has this, it should
show your current locale settings, as OS X sees them. Eg:

> $ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_ALL=

2) What does python see as your locale as? Full output from this command:

> $ python -c 'import locale ; print locale.getdefaultlocale()'
('en_GB', 'UTF-8')

3) How about this variant - attempting to coerce the correct lang:

> $ LANG="nl_NL.UTF-8" python -c 'import locale ; print 
> locale.getdefaultlocale()'
('nl_NL', 'UTF-8')

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
macpro1:~ bobaalsma$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
macpro1:~ bobaalsma$ python -c 'import locale; print 
locale.getdefaultlocale()'
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 503, in getdefaultlocale
return _parse_localename(localename)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 435, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
macpro1:~ bobaalsma$ LANG="nl_NL.UTF-8" python -c'import locale ; print 
locale.getdefaultlocale()' 
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 503, in getdefaultlocale
return _parse_localename(localename)
  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", 
line 435, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

Op vrijdag 14 september 2012 11:17:24 UTC+2 schreef Tom Evans het volgende:
>
> On Fri, Sep 14, 2012 at 8:52 AM, Bob Aalsma 
> > 
> wrote: 
> > The command & error from createsuperuser: 
> > macpro1:dripFeedSite bobaalsma$ python manage.py createsuperuser 
> > … 
>
> Can I ask you to try some things, just to see how your environment is 
> setup. All of these commands run on the bash shell as a regular user. 
>
> 1) The output of running "locale". Hopefully OS X has this, it should 
> show your current locale settings, as OS X sees them. Eg: 
>
> > $ locale 
> LANG=en_GB.UTF-8 
> LC_CTYPE="en_GB.UTF-8" 
> LC_COLLATE="en_GB.UTF-8" 
> LC_TIME="en_GB.UTF-8" 
> LC_NUMERIC="en_GB.UTF-8" 
> LC_MONETARY="en_GB.UTF-8" 
> LC_MESSAGES="en_GB.UTF-8" 
> LC_ALL= 
>
> 2) What does python see as your locale as? Full output from this command: 
>
> > $ python -c 'import locale ; print locale.getdefaultlocale()' 
> ('en_GB', 'UTF-8') 
>
> 3) How about this variant - attempting to coerce the correct lang: 
>
> > $ LANG="nl_NL.UTF-8" python -c 'import locale ; print 
> locale.getdefaultlocale()' 
> ('nl_NL', 'UTF-8') 
>
> Cheers 
>
> Tom 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TgI2QVXz9NMJ.
To post to this group, send email to django-users@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.



Markers on geodjango

2012-09-14 Thread Coulson Thabo Kgathi
can i place markers on geodjango maps, cant figure out how to do that

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PA5XOTjKhsIJ.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
SOLVED by Tom Evans:
insert 
unset LC_CTYPE ; export LANG="nl_NL.UTF-8"
into .bash_profile



Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:
>
> I'm a newbie following the tutorial. In this, creating a superuser is 
> described, using 
>
> manage.py createsuperuser --username=joe --email=j...@example.com
>
>
> Using this leads to an error, which I could match to the closed ticket 
> #16017.
>
> But I couldn't find how to proceed from there. It seems some software was 
> changed about 4 weeks ago:
> "Made createsuperuser more robust when getting current OS username."
>
> So where can I find it?
> [I'm assuming there is a procedure for this, but I'm sorry to say I 
> couldn't find that either]
>
> Regards,
> Bob
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Lb8favCcs-YJ.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Tom Evans
On Fri, Sep 14, 2012 at 10:26 AM, Bob Aalsma
 wrote:
> macpro1:~ bobaalsma$ locale
> LANG=
> LC_COLLATE="C"
> LC_CTYPE="UTF-8"
> LC_MESSAGES="C"
> LC_MONETARY="C"
> LC_NUMERIC="C"
> LC_TIME="C"
> LC_ALL=
> macpro1:~ bobaalsma$ python -c 'import locale; print
> locale.getdefaultlocale()'
>
> Traceback (most recent call last):
>   File "", line 1, in 
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
> line 503, in getdefaultlocale
> return _parse_localename(localename)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
> line 435, in _parse_localename
> raise ValueError, 'unknown locale: %s' % localename
> ValueError: unknown locale: UTF-8
> macpro1:~ bobaalsma$ LANG="nl_NL.UTF-8" python -c'import locale ; print
> locale.getdefaultlocale()'
> Traceback (most recent call last):
>   File "", line 1, in 
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
> line 503, in getdefaultlocale
> return _parse_localename(localename)
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py",
> line 435, in _parse_localename
> raise ValueError, 'unknown locale: %s' % localename
> ValueError: unknown locale: UTF-8
>

Sorry, part of this thread went off-list. For the archives, OS X sets
LC_CTYPE="UTF-8", which IMO is nonsensical. This will always make
python fall over when it tries to determine the correct locale, regardless of OS

> $ unset LANG ; export LC_CTYPE="UTF-8" ; python -c 'import locale; print 
> locale.getdefaultlocale()'
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/locale.py", line 503, in getdefaultlocale
return _parse_localename(localename)
  File "/usr/local/lib/python2.7/locale.py", line 435, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

So the fix is to undo the damage, set a proper LANG environment
variable so that everything is aware what the locale is, which can be
done in your .bash_profile, or a number of OS X specific ways:

http://apple.stackexchange.com/questions/21096/where-does-lang-variable-gets-set-in-mac-os-x
http://fruitfulerrors.blogspot.co.uk/2011/01/osx-106-lcctype.html

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: Markers on geodjango

2012-09-14 Thread Marcos Moyano
http://invisibleroads.com/tutorials/geodjango-googlemaps-build.html
Like that?

Marcos

On Fri, Sep 14, 2012 at 6:30 AM, Coulson Thabo Kgathi wrote:

> can i place markers on geodjango maps, cant figure out how to do that
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/PA5XOTjKhsIJ.
> To post to this group, send email to django-users@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.
>



-- 
Some people, when confronted with a problem, think “I know, I'll use
regular expressions.” Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: OR together multiple extra clauses

2012-09-14 Thread Tomas Neme
I haven't done this, so I might be wrong, but...

> queryset.extra(
> where=['unaccent("table_name"."column_name"::text) LIKE
> unaccent(%s)'],
> params=['%%%s%%' % value]
> )

first, wouldn't just setting params=[value] work? furthermore, isn't
that the whole point of the params thing? maybe unaccent(%%%s%%)'
params=[value].

secondly.. wouldn't chaining .extra() methods work?

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: Possible spam from mailing list? ("China Mobile")

2012-09-14 Thread Nikolas Stevenson-Molnar
It seems to me that I get one of these emails for every post I make,
about one day later. That includes replies to this very thread. I think
they come from the same email address, so they'd be easy to block on an
individual level. But my guess is that everyone posting to django-users
is receiving these, so it would be good for a group admin to address
this at the group level (someone suggested removing that user).

_Nik

On 9/13/2012 7:53 PM, Kurtis Mullins wrote:
> I actually just received another one of those emails. The funny part
> is that it used this exact thread's subject in the message. I'm
> curious as to whether this 139.com  is emailing
> everybody who sends an email to the list or if it only sends emails to
> people in who are involved in the same thread(s) as the user responsible.
>
> On Thu, Sep 13, 2012 at 10:32 PM, Rivsen  > wrote:
>
> 13672725...@139.com  , he has canceled
> his cell phone number, please administrator kick him.
>
> I use my phone call this number and be informed that the number no
> longer exists.
>
>
> 2012/9/13 Rivsen mailto:rivsen1...@gmail.com>>
>
> I received this e-mail too. It's about someone using 139.com
>  email join the group, and now this e-mail
> address was closed by 139.
>
> Maybe hes mobile phone lost orarrears.
>
>
> 2012/9/13 Jon Blake  >
>
> I've had a coup[le of these, now.
>
>
> On Tuesday, September 11, 2012 5:27:59 AM UTC+10, Kurtis
> wrote:
>
> I just received a very unusual e-mail that included a
> recent post's subject. The post in question was: "Re:
> form doesn't validate when trying to upload file". It
> was sent directly to my email address; by-passing the
> User Group.
>
> Google roughly translated this email as coming from
> "China Mobile" and included the domain "139.com
> ". Has anyone else seen this sort of
> thing? Unfortunately, I am unable to read the language
> and the Google Translation isn't very clear; but it's
> definitely displayed using a very clean and fancy
> template. I'm not sure if it's spam or something else.
>
> Just figured I'd see if anyone else has gotten an
> email similar to this. Thanks.
>
> -- 
> You received this message because you are subscribed to
> the Google Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/yZnQCJfOEekJ.
>
> To post to this group, send email to
> django-users@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-users@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-users@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-users@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: OR together multiple extra clauses

2012-09-14 Thread Stratos Moros
On Fri, 14 Sep 2012 17:24:21 +0300, Tomas Neme   
wrote:



I haven't done this, so I might be wrong, but...


queryset.extra(
where=['unaccent("table_name"."column_name"::text) LIKE
unaccent(%s)'],
params=['%%%s%%' % value]
)


first, wouldn't just setting params=[value] work? furthermore, isn't
that the whole point of the params thing? maybe unaccent(%%%s%%)'
params=[value].

secondly.. wouldn't chaining .extra() methods work?



Setting just params=[value] wouldn't work for me since I want to query
for rows that contain the string value, similar to how `contains` work.

Doing where=['... unaccent(%%%s%%)'], params=['value'] would produce
"... unaccent(%'value'%)" (notice the % outside the quotes) since the extra
method will quote the params before inserting them in the string.

Chaining calls to extra wouldn't work either because the where clauses will
be ANDed together.

The way I solved it is by keeping around a copy of the queryset, calling  
extra
on the copy multiple times and ORing the whole querysets. It looks  
something

like this:

original = deepcopy(queryset)
queryset & (original.extra(...) | original.extra(...))

The ORM is smart enough to realize that the two queries are identical,  
except
from the where clause and then it can combines them. The resulting SQL  
isn't

optimal but postgresql's query optimizer fixes that.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Thomas Lockhart

On 9/14/12 3:47 AM, Bob Aalsma wrote:

SOLVED by Tom Evans:
insert
unset LC_CTYPE ; export LANG="nl_NL.UTF-8"
into .bash_profile
That is a solution, but depends on who is running and whether it is a 
login shell.


I strongly recommend adding the lines I mentioned earlier to the top of 
your manage.py so your Django installation will run properly under other 
accounts and startup environments. I'm not sure why you had trouble 
doing that or what your symptoms were.


hth

 - Tom





Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:


I'm a newbie following the tutorial. In this, creating a superuser
is described, using

manage.py createsuperuser --username=joe --email=j...@example.com  



Using this leads to an error, which I could match to the closed
ticket #16017.

But I couldn't find how to proceed from there. It seems some
software was changed about 4 weeks ago:
"Made createsuperuser more robust when getting current OS username."

So where can I find it?
[I'm assuming there is a procedure for this, but I'm sorry to say
I couldn't find that either]

Regards,
Bob

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Lb8favCcs-YJ.

To post to this group, send email to django-users@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-users@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.



check if an user is authenticated from another app

2012-09-14 Thread refreegrata
Hello list.

Obviously, I come here with a question. I have a web application developed 
with Django. It's working Ok. The app is just for internal use and the 
access to every view is only avaliable for authenticated users with 
permissions over the section (except for the view  log-in)

Now other app written over other framework, running over his own web server 
and port (node.js)  (but related with the django app)must to access at the 
same database to return certain information but it must to check if the 
user is authenticated. Here is my doubt, because Django manage the 
authentification ¿How can I check this in django and advise to the node.js 
app? Are any token in the database to check when an user is authenticated? 
How can I extract the user information from the request/session, delegate 
this to a function in django-python and get this information in the 
node.js? Maybe I must to build some web service in Django or program the 
token saving?

I'm a little lost. Sorry for this. Any idea?

Bye

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/1zNHOC1u-VIJ.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Bob Aalsma
Well, I have tried your suggestion in all places I could think of and none 
of those helped: the createsuperuser kept returning the same error message. 
I posted this as a reply some 24 hours ago.

 


Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:
>
> I'm a newbie following the tutorial. In this, creating a superuser is 
> described, using 
>
> manage.py createsuperuser --username=joe --email=j...@example.com
>
>
> Using this leads to an error, which I could match to the closed ticket 
> #16017.
>
> But I couldn't find how to proceed from there. It seems some software was 
> changed about 4 weeks ago:
> "Made createsuperuser more robust when getting current OS username."
>
> So where can I find it?
> [I'm assuming there is a procedure for this, but I'm sorry to say I 
> couldn't find that either]
>
> Regards,
> Bob
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WnCSyDEH9WYJ.
To post to this group, send email to django-users@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: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Thomas Lockhart

On 9/14/12 10:07 AM, Bob Aalsma wrote:
Well, I have tried your suggestion in all places I could think of and 
none of those helped: the createsuperuser kept returning the same 
error message. I posted this as a reply some 24 hours ago.
Yes, with no details of what "all the places I could think of" means. 
They are two lines, and placed near the top should have worked for you.


I'll send you my manage.py directly.

 - Tom






Op donderdag 13 september 2012 16:58:11 UTC+2 schreef Bob Aalsma het 
volgende:


I'm a newbie following the tutorial. In this, creating a superuser
is described, using

manage.py createsuperuser --username=joe --email=j...@example.com  



Using this leads to an error, which I could match to the closed
ticket #16017.

But I couldn't find how to proceed from there. It seems some
software was changed about 4 weeks ago:
"Made createsuperuser more robust when getting current OS username."

So where can I find it?
[I'm assuming there is a procedure for this, but I'm sorry to say
I couldn't find that either]

Regards,
Bob

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/WnCSyDEH9WYJ.

To post to this group, send email to django-users@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-users@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: UnboundLocalError: local variable 'full_path' referenced before assignment

2012-09-14 Thread hellj
Is there any kind of workaround for this?  I'm worried that rows are not 
making it into the db because of this problem which I'm also having. 

On Wednesday, February 8, 2012 4:44:12 PM UTC-5, akaariai wrote:
>
> Quickly looking through the code it seems this is a bug in Django. The 
> full_path variable is used in a place where it is not guaranteed to be 
> initialized. In fact, the whole loaddata.py file seems like a good 
> candidate for some cleanup. 9 levels of indentation in a method and 
> this sort of bug is likely... 
>
> The code was going to tell you that fixture loading didn't succeed, so 
> the error when reporting this error isn't that critical. 
>
> Please file a bug in trac about this. Try to include enough 
> information so that the error can be reproduced. A failing test case 
> in django's test suite is perfect, a sample project demonstrating the 
> problem is good and verbal explanation will do. 
>
>  - Anssi 
>
> On Feb 8, 10:27 pm, rok  wrote: 
> > When executing the "manage.py syncdb" I get the following error: 
> > 
> > Creating tables ... 
> > Installing custom SQL ... 
> > Installing indexes ... 
> > Traceback (most recent call last): 
> >   File "./manage.py", line 26, in  
> > execute_from_command_line(sys.argv) 
> >   File "/home/rok/apps/django-trunk/django/core/management/ 
> > __init__.py", line 440, in execute_from_command_line 
> > utility.execute() 
> >   File "/home/rok/apps/django-trunk/django/core/management/ 
> > __init__.py", line 379, in execute 
> > self.fetch_command(subcommand).run_from_argv(self.argv) 
> >   File "/home/rok/apps/django-trunk/django/core/management/base.py", 
> > line 196, in run_from_argv 
> > self.execute(*args, **options.__dict__) 
> >   File "/home/rok/apps/django-trunk/django/core/management/base.py", 
> > line 232, in execute 
> > output = self.handle(*args, **options) 
> >   File "/home/rok/apps/django-trunk/django/core/management/base.py", 
> > line 371, in handle 
> > return self.handle_noargs(**options) 
> >   File "/home/rok/apps/django-trunk/django/core/management/commands/ 
> > syncdb.py", line 164, in handle_noargs 
> > call_command('loaddata', 'initial_data', verbosity=verbosity, 
> > database=db) 
> >   File "/home/rok/apps/django-trunk/django/core/management/ 
> > __init__.py", line 147, in call_command 
> > return klass.execute(*args, **defaults) 
> >   File "/home/rok/apps/django-trunk/django/core/management/base.py", 
> > line 232, in execute 
> > output = self.handle(*args, **options) 
> >   File "/home/rok/apps/django-trunk/django/core/management/commands/ 
> > loaddata.py", line 239, in handle 
> > (full_path, ''.join(traceback.format_exception(sys.exc_type, 
> > UnboundLocalError: local variable 'full_path' referenced before 
> > assignment 
> > 
> > Does this ring a bell to anyone? I'm running the django trunk from Feb 
> > 8th (so 1.4 candidate). 
> > Rok

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/ficmZhhNIL0J.
To post to this group, send email to django-users@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 sms

2012-09-14 Thread Lunga Baliwe
Good day,

I am writting a website that sends sms to a cell phone. I am 
using django-sendsms-0.2.2. I followed the README.rst doc and the output 
does appear on the console. How do I make it to actually send the sms?

Your help will appreciated.

Kind regards,
Lunga

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/NywGfiMlZtQJ.
To post to this group, send email to django-users@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 sms

2012-09-14 Thread Aaron C. de Bruyn
On Fri, Sep 14, 2012 at 11:40 AM, Lunga Baliwe  wrote:
> I am writting a website that sends sms to a cell phone. I am using
> django-sendsms-0.2.2. I followed the README.rst doc and the output does
> appear on the console. How do I make it to actually send the sms?

You might want to contact the developer of the application.  But
without any error messages or showing the relevant sections of your
code, it will be tough for anyone to offer assistance.

https://github.com/stefanfoulis/django-sendsms

-A

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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: Submitting data from a form

2012-09-14 Thread Joseph Mutumi
Hi,

Let me give you a code sample that would be hopefully a push in the right
direction.
Simply follow these steps:

   1. Create your model. Its the code interface to your data source
   (database)
   2. Create your form. Forms are used for processing input data
   (validation, error reporting etc)
   3. Create your view. You should at least be able to link up a url
   pattern to a view. If you can't please go through the tutorial
   4. Create your template. This is the html returned to the client.

Note: Samples for your consideration:

#--- in models.py
from django.db import models
from django import forms

CHOICES = (('big', 'big'),('medium', 'medium'), ('small', 'small'))

class SimpleColumn(models.Model):
my_column = models.CharField(max_length=255, choices=CHOICES)

class SimpleColumnForm(forms.ModelForm):
class Meta:
model = SimpleColumn

#-- in views.py
from django.shortcuts import render
from models import SimpleColumnForm

def view_column(request):
if request.method == "POST":
form = SimpleColumnForm(request.POST)
if form.is_valid():
form.save()
else:
form = SimpleColumnForm()
return render(request, 'view_column.html', {'form': form})



{% csrf_token %}
{{ form }}
Save


Please go through the tutorial!
https://docs.djangoproject.com/en/1.4//intro/tutorial01/
It is very well written and after 1 hour or so you will have gotten the
concepts.

Enjoy Django!


On Thu, Sep 13, 2012 at 2:58 PM, Tom Evans  wrote:

> On Thu, Sep 13, 2012 at 6:26 AM, KVR  wrote:
> > Hi,
> > I am a Django learner .
> > I need to do a requirement as described below.
> >
> > 1.There is a column in a model
> > 2.I want to create a template with a select button in that.
> > 3.On selecting an option and submitting, the column should be updated
> with
> > the submitted value.
> >
> > Please give me some idea on how to do this?
> >
>
> The Django tutorial is a 4 part tutorial guiding you through creating
> a model, creating a view that uses that model, and creating forms to
> create or edit a model. It is specifically designed to take someone
> who has never used django to a point where they can create models,
> views and forms to process those models.
>
> I suggest you attempt to complete the tutorial, and come ask questions
> on here iff you get stuck.
>
> https://docs.djangoproject.com/en/1.4//intro/tutorial01/
>
> Cheers
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@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-users@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.



handling xml response

2012-09-14 Thread Sait Maraşlıoğlu
I dont know, how to handle an xml response with django.
dhtmlx returns someting like that.
?gr_id=*6*&c0=*abc*&c1=*dsdsd*&c2=*6*&c3=*1234*&c4=*this%20is%20Sparta!*
gr_id = 6
c0= abc
c1 = dsdsd
c2= 6
and so on ...

These fields corresponds a field in my django model and I dont have an idea 
how to handle it. I think I can change the row ids from c0,c1,c2 to 
something sensible.
I cant do that hardcoded, have to that in a better way, I would right some 
code to parse it, but cant think of anything.
thx.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/E_yPkC6Z-8cJ.
To post to this group, send email to django-users@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: check if an user is authenticated from another app

2012-09-14 Thread Mike Dewhirst

On 15/09/2012 2:56am, refreegrata wrote:

Hello list.

Obviously, I come here with a question. I have a web application
developed with Django. It's working Ok. The app is just for internal use
and the access to every view is only avaliable for authenticated users
with permissions over the section (except for the view  log-in)

Now other app written over other framework, running over his own web
server and port (node.js)  (but related with the django app)must to
access at the same database to return certain information but it must to
check if the user is authenticated. Here is my doubt, because Django
manage the authentification ¿How can I check this in django and advise
to the node.js app? Are any token in the database to check when an user
is authenticated?


Not quite. I think your other app needs to discover it via the Django 
authentication API ...


https://docs.djangoproject.com/en/1.4//topics/auth/#api-reference

If your other app has authentication methods you might be able to match 
hashing algorithms between it and Django and it can do its own 
authentication directly without needing Django.


https://docs.djangoproject.com/en/1.4//topics/auth/#how-django-stores-passwords

How can I extract the user information from the

request/session,


https://docs.djangoproject.com/en/1.4/ref/request-response/#django.http.HttpRequest.user

delegate this to a function in django-python and get

this information in the node.js? Maybe I must to build some web service
in Django or program the token saving?

I'm a little lost. Sorry for this. Any idea?

Bye

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/1zNHOC1u-VIJ.
To post to this group, send email to django-users@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-users@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: Possible spam from mailing list? ("China Mobile")

2012-09-14 Thread Russell Keith-Magee
Hi,

Unfortunately, this appears to be a problem with (yet another) service
provider not playing nice with mailing lists. Someone has subscribed
to Django Users, and their mail provider (China Mobile in this case)
has decided to reply to the original author, instead of the "reply to"
address.

This happens from time to time; we occasionally get the same effect
when someone's mailbox fills up. The only way to resolve the issue is
to identify the rogue subscription, and kill it.

However, to compound matters, the "find members" functionality on
Google Groups is fairly limited, and in this case, it probably
wouldn't help anyway - the message is from an automated service that
passes email messages to an SMS number -- 13672725001 looks to me like
a Chinese cell phone number.

If anyone is able to identify the rogue subscription, I'll gladly kill
it; but there's not much we can do otherwise.

Yours,
Russ Magee %-)

On Fri, Sep 14, 2012 at 11:43 PM, Nikolas Stevenson-Molnar
 wrote:
> It seems to me that I get one of these emails for every post I make, about
> one day later. That includes replies to this very thread. I think they come
> from the same email address, so they'd be easy to block on an individual
> level. But my guess is that everyone posting to django-users is receiving
> these, so it would be good for a group admin to address this at the group
> level (someone suggested removing that user).
>
> _Nik
>
>
> On 9/13/2012 7:53 PM, Kurtis Mullins wrote:
>
> I actually just received another one of those emails. The funny part is that
> it used this exact thread's subject in the message. I'm curious as to
> whether this 139.com is emailing everybody who sends an email to the list or
> if it only sends emails to people in who are involved in the same thread(s)
> as the user responsible.
>
> On Thu, Sep 13, 2012 at 10:32 PM, Rivsen  wrote:
>>
>> 13672725...@139.com , he has canceled his cell phone number, please
>> administrator kick him.
>>
>> I use my phone call this number and be informed that the number no longer
>> exists.
>>
>>
>> 2012/9/13 Rivsen 
>>>
>>> I received this e-mail too. It's about someone using 139.com email join
>>> the group, and now this e-mail address was closed by 139.
>>>
>>> Maybe hes mobile phone lost or arrears.
>>>
>>>
>>> 2012/9/13 Jon Blake 

 I've had a coup[le of these, now.


 On Tuesday, September 11, 2012 5:27:59 AM UTC+10, Kurtis wrote:
>
> I just received a very unusual e-mail that included a recent post's
> subject. The post in question was: "Re: form doesn't validate when trying 
> to
> upload file". It was sent directly to my email address; by-passing the 
> User
> Group.
>
> Google roughly translated this email as coming from "China Mobile" and
> included the domain "139.com". Has anyone else seen this sort of thing?
> Unfortunately, I am unable to read the language and the Google Translation
> isn't very clear; but it's definitely displayed using a very clean and 
> fancy
> template. I'm not sure if it's spam or something else.
>
> Just figured I'd see if anyone else has gotten an email similar to
> this. Thanks.

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/django-users/-/yZnQCJfOEekJ.

 To post to this group, send email to django-users@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-users@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-users@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-users@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-users@googlegroups.com.
To unsubscribe

Re: Django sms

2012-09-14 Thread Lunga Baliwe
The code I wrote is the one on  
https://github.com/stefanfoulis/django-sendsms which is:

settings.py
SENDSMS_BACKEND = 'sendsms.backends.console.SmsBackend'

view.py
from sendsms import api
def home(request):
api.send_sms(body='I can haz txt', from_phone='0768903661', 
to=['0768903661'])
return render_to_response('home.html')

After I ran the server, this what I get on the console:
from: 0768903661
to: 0768903661
flash: False
I can haz txt
---

Maybe its like Dennis said, that this is meant for testing purpose, do I 
have to subscribe to twilio in order to be able to actually send the sms?


On Friday, September 14, 2012 8:40:10 PM UTC+2, Lunga Baliwe wrote:
>
> Good day,
>
> I am writting a website that sends sms to a cell phone. I am 
> using django-sendsms-0.2.2. I followed the README.rst doc and the output 
> does appear on the console. How do I make it to actually send the sms?
>
> Your help will appreciated.
>
> Kind regards,
> Lunga
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Gobzn88UMnYJ.
To post to this group, send email to django-users@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: Possible spam from mailing list? ("China Mobile")

2012-09-14 Thread Kurtis Mullins
Thanks for looking into it, Russ!

On Fri, Sep 14, 2012 at 9:24 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> Hi,
>
> Unfortunately, this appears to be a problem with (yet another) service
> provider not playing nice with mailing lists. Someone has subscribed
> to Django Users, and their mail provider (China Mobile in this case)
> has decided to reply to the original author, instead of the "reply to"
> address.
>
> This happens from time to time; we occasionally get the same effect
> when someone's mailbox fills up. The only way to resolve the issue is
> to identify the rogue subscription, and kill it.
>
> However, to compound matters, the "find members" functionality on
> Google Groups is fairly limited, and in this case, it probably
> wouldn't help anyway - the message is from an automated service that
> passes email messages to an SMS number -- 13672725001 looks to me like
> a Chinese cell phone number.
>
> If anyone is able to identify the rogue subscription, I'll gladly kill
> it; but there's not much we can do otherwise.
>
> Yours,
> Russ Magee %-)
>
> On Fri, Sep 14, 2012 at 11:43 PM, Nikolas Stevenson-Molnar
>  wrote:
> > It seems to me that I get one of these emails for every post I make,
> about
> > one day later. That includes replies to this very thread. I think they
> come
> > from the same email address, so they'd be easy to block on an individual
> > level. But my guess is that everyone posting to django-users is receiving
> > these, so it would be good for a group admin to address this at the group
> > level (someone suggested removing that user).
> >
> > _Nik
> >
> >
> > On 9/13/2012 7:53 PM, Kurtis Mullins wrote:
> >
> > I actually just received another one of those emails. The funny part is
> that
> > it used this exact thread's subject in the message. I'm curious as to
> > whether this 139.com is emailing everybody who sends an email to the
> list or
> > if it only sends emails to people in who are involved in the same
> thread(s)
> > as the user responsible.
> >
> > On Thu, Sep 13, 2012 at 10:32 PM, Rivsen  wrote:
> >>
> >> 13672725...@139.com , he has canceled his cell phone number, please
> >> administrator kick him.
> >>
> >> I use my phone call this number and be informed that the number no
> longer
> >> exists.
> >>
> >>
> >> 2012/9/13 Rivsen 
> >>>
> >>> I received this e-mail too. It's about someone using 139.com email
> join
> >>> the group, and now this e-mail address was closed by 139.
> >>>
> >>> Maybe hes mobile phone lost or arrears.
> >>>
> >>>
> >>> 2012/9/13 Jon Blake 
> 
>  I've had a coup[le of these, now.
> 
> 
>  On Tuesday, September 11, 2012 5:27:59 AM UTC+10, Kurtis wrote:
> >
> > I just received a very unusual e-mail that included a recent post's
> > subject. The post in question was: "Re: form doesn't validate when
> trying to
> > upload file". It was sent directly to my email address; by-passing
> the User
> > Group.
> >
> > Google roughly translated this email as coming from "China Mobile"
> and
> > included the domain "139.com". Has anyone else seen this sort of
> thing?
> > Unfortunately, I am unable to read the language and the Google
> Translation
> > isn't very clear; but it's definitely displayed using a very clean
> and fancy
> > template. I'm not sure if it's spam or something else.
> >
> > Just figured I'd see if anyone else has gotten an email similar to
> > this. Thanks.
> 
>  --
>  You received this message because you are subscribed to the Google
>  Groups "Django users" group.
>  To view this discussion on the web visit
>  https://groups.google.com/d/msg/django-users/-/yZnQCJfOEekJ.
> 
>  To post to this group, send email to django-users@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-users@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-users@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-users@googlegroups.com.
> > To