Django & subprocess

2012-09-15 Thread malinoff
Hi all, please, i need your help.

I use suprocess module, executing 'stockfish' uci engine, like: engine = 
subprocess.Popen('stockfish', stdin=subprocess.PIPE, stdout=subprocess.PIPE)

My module use opened subprocess receiving some information from Django's 
form, for example - move like 'e2e4'

I use sessions to save information about engine and chess table, so, when 
the page is loading the first time, my engine works properly - it draws 
chesstable on the page and so on, using engine.stdin.write() method.

But when i use form to send user's move to the engine, Django says: I/O 
operation on closed file - right on the engine.stdin.write() line, and it 
seems that PIPEs were closed, but WHEN they were, i cant catch.

Can someone help me?

-- 
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/-/d-_s3TKtADkJ.
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 newbie with issues

2012-09-15 Thread Karen Tracey
On Wed, Sep 12, 2012 at 5:46 AM, Morrti  wrote:

> Thanks for your comments on version numbers, but moving to 1.4 isn't a
> quick option for me/us so I'm stuck on 1.1 for a while.
>
> Trying to run the app and instead of getting the "welcome" page I get the
> following, see below.
>
> Not withstanding my version issue, anyone got any ideas on this.
>
> [snip]
>
> Traceback (most recent call last):
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", 
> line 279, in run
> self.result = application(self.environ, self.start_response)
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/servers/basehttp.py", 
> line 651, in __call__
> return self.application(environ, start_response)
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/wsgi.py", 
> line 230, in __call__
> self.load_middleware()
>
>   File 
> "/Users/timmorris/Sites/django/django-trunk/django/core/handlers/base.py", 
> line 42, in load_middleware
> raise exceptions.ImproperlyConfigured, 'Error importing middleware %s: 
> "%s"' % (mw_module, e)
>
> ImproperlyConfigured: Error importing middleware django.middleware.common: 
> "cannot import name force_text"
>
>
>
force_text did not exist in 1.1, but it exists in current master. Getting
an error referring to it rather implies that you're running a mutant
version with some leftover py/pyc files form when you were running current
master (which appears to be what you were running for the first traceback
posted -- the " __init__() keywords must be strings" error there is what
you get today on master if you run with Python earlier than 2.6.5).

I'd start over with a completely new install, in a completely new directory
tree. (I also would not include "django-trunk" in the name of that tree, if
it was actually intended to hold 1.1.something.)

Karen
-- 
http://tracey.org/kmt/

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



sorl-thumbnail or easy-thumbnail

2012-09-15 Thread galgal
What image engine to choose sorl-thumbnail or easy-thumbnail? I saw on 
github, that easy-thumbanil is still updates, and sorl last update is about 
5 months ago.
I use sorl for a while but want to try something else. Does easy-thumbnail 
work in admin when image are displayed? sorl has a special admin class - i 
haven't found it about easy-thumbnail

-- 
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/-/-6KzpYRGIkwJ.
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.contrib.markup deprecated in 1.5 - what's the alternative?

2012-09-15 Thread Phil Gyford
I noticed that django.contrib.markup is marked as deprecated in Django
1.5 . If
I'm starting a new project now, what alternative should I be using, to
avoid running into problems with future versions of Django? I could
write my own Markdown (or whatever) filter, but I wondered if there
was going to be a standard replacement built-in?

For bonus points - why are those filters being deprecated?

-- 
http://www.gyford.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: django.contrib.markup deprecated in 1.5 - what's the alternative?

2012-09-15 Thread Jirka Vejrazka
Hi Phil,

  incidentally, I was looking at this just recently. The
contrib.markup was deprecated mainly due to security issues with 3rd
party libraries that could not be fixed in Django itself and were
compromising its security. For more, read
https://code.djangoproject.com/ticket/18054

  Can't tell you what the replacement is. I rolled up my own markup
filter, but I only have a handful of trusted users for my web app so I
don't have to be too concerned with trusting their inputs.

  You can copy the markup filter from 1.4 - just be aware of the
security consequences.

  HTH

Jirka

-- 
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: tree.io installation with django

2012-09-15 Thread Fabian Weiss
I do so! I tried now this one: 
http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/
And it works! :) 
http://project.immersight.de/

I tried again all I could find in the net for treeio, but nothing works :(
How can I totally remove all my steps? Is it just to delete the 
directories? Or is there something to do in a database?

Maybe I have a version of django which is too new? It is 1.4.1
http://nopaste.immersight.de/?34b6a29be67dd853#dvMCsmIWwYZUWV2qKMFxGLMI4pq+O3PiPy2iHAp3ZzQ=


Am Mittwoch, 12. September 2012 21:06:04 UTC+2 schrieb Cal Leeming 
[Simplicity Media Ltd]:
>
> I think this looks like an incompatible Django version to be honest, 
> coupled with some other weird/wonderful problems.
>
> The invalid syntax thing is also a bit odd, as it looks valid to me.
>
> My advice would be to start again from scratch with the installation 
> tutorial, and see if you can get any further - 
>
> Cal
>
> On Wed, Sep 12, 2012 at 7:52 PM, Fabian Weiss 
> 
> > wrote:
>
>> Hi Cal! :)
>>
>> THX for you reply, but I need more informations! I changed the line you 
>> said in settings.py, but what shall I do know? Again python manage.py 
>> update_ve and ./bin/patch??
>> I tried again the last step:
>>
>> python manage.py installdb
>>> Traceback (most recent call last):
>>>   File "manage.py", line 74, in 
>>> import settings
>>>   File "/srv/http/de.immersight.project/treeio/settings.py", line 59, in 
>>> 
>>> MEDIA_ROOT = path.join(STATIC_DOC_ROOT, 'media/')
>>> NameError: name 'STATIC_DOC_ROOT' is not defined
>>
>>
>> when I reload the apache I have still 500 internal error. Here is the 
>> errorlog:
>>
>> tail ../logs/errorlog 
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] SyntaxError: 
>>> invalid syntax
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] mod_wsgi 
>>> (pid=17796): Target WSGI script 
>>> '/srv/http/de.immersight.project/treeio/wsgi' cannot be loaded as Python 
>>> module.
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] mod_wsgi 
>>> (pid=17796): Exception occurred processing WSGI script 
>>> '/srv/http/de.immersight.project/treeio/wsgi'.
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] Traceback 
>>> (most recent call last):
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]   File 
>>> "/srv/http/de.immersight.project/treeio/wsgi", line 9, in 
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] import 
>>> django.core.handlers.wsgi
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]   File 
>>> "/usr/local/lib/python3.2/dist-packages/django/core/handlers/wsgi.py", line 
>>> 131
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] path_info 
>>> = force_unicode(environ.get('PATH_INFO', u'/'))
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24]   
>>> ^
>>> [Wed Sep 12 20:46:23 2012] [error] [client 109.193.24.24] SyntaxError: 
>>> invalid syntax
>>
>>
>> I really urgently have to set up this system :(
>> Would be great if I can accomplish this!! Thanks alot for your help!
>> Greetings Fabian
>>
>>
>>
>>
>> Am Mittwoch, 12. September 2012 12:14:51 UTC+2 schrieb Cal Leeming 
>> [Simplicity Media Ltd]:
>>>
>>> Hmm - this should really just work out of the box, but looking at the 
>>> docs, it doesn't give you much information about running wsgi/fcgi etc.
>>>
>>> Try this;
>>>
>>> Change this line:...
>>>
>>>  -- 
>> 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/-/6aEUH98wPG0J.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Cvu8VpNsXVoJ.
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: tree.io installation with django

2012-09-15 Thread Nick Apostolakis
On Sat, Sep 15, 2012 at 11:41 PM, Fabian Weiss
wrote:

> I do so! I tried now this one:
> http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/
> And it works! :)
> http://project.immersight.de/
>
> I tried again all I could find in the net for treeio, but nothing works :(
> How can I totally remove all my steps? Is it just to delete the
> directories? Or is there something to do in a database?
>
> Maybe I have a version of django which is too new? It is 1.4.1
>
> http://nopaste.immersight.de/?34b6a29be67dd853#dvMCsmIWwYZUWV2qKMFxGLMI4pq+O3PiPy2iHAp3ZzQ=
>
>
>
Why don't you use django 1.3 as it is described in the requirements file?
Thats a simple way to see if you problems stem from django version
incompatibility

-- 
---
Nick Apostolakis
email:nicka...@oncrete.gr
Web Site: http://nick.oncrete.gr
---

-- 
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: Django sms

2012-09-15 Thread Lunga Baliwe
Thanks Dennis,

I'm kind of newbie to software,  but now I have an idea of what I need to 
do because two of cellphone service providers in South Africa(Vodacom and 
MTN - thanks for the list) do support email2sms.
I now have an idea of what I need to do, if I end up using the Django-sms 
app, I will post back.

The website will send sms' to a group of people who are members of an 
organisation informing them of meetings and other group announcements.

Thanks for the clear explanation and for your help.  

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/-/nxdB59nEMrYJ.
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, how to automatically sort the database's entries when I add an entry?

2012-09-15 Thread Nicolas Dubien
Hi,

I'm using a quite huge database with twenty thousand entries or more. At 
the beginning, I used to sort it each time (.sort_by("my_field_name")) I 
need the page but I saw that it took me lot of time to generate the page.

I'm looking for a solution, that allows me to show the data without sorting 
it each time I want to see it. For a instance, sorting the database each 
time I add an entry or each time I add several entries could be a solution.
Is it possible to keep the database sorted by a field without changing the 
pk?

I tried the class Meta with the argument ordering but it didn't work (even 
if I flush the db).

Yours,
-DubZzz

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



Newbie, trying [read: failing] to set up Django

2012-09-15 Thread Helly
Hello all,

I've been trying to set up Django for quite some time now. I'm on Mac OS X 
Lion 10.7.4. As to my level of expertise, let's just say I'm pretty new 
to...computers. I guess I figured I'd just stumble around until it worked. 
How hard could it be right? Wrong. It seems like you all don't mind helping 
out newbies though, so I thought I'd give this a shot.

I'm running into problems with synchronizing Django with my database. I 
installed MySQL and MySQLdb. I created a database and edited the 
settings.py file according to instructions in the tutorial. However, I 
couldn't get it to work with the python manage.py syncdb command due to an 
"architecture" error. Keep in mind that I had, at this point, spent a 
really long time trying to set these babies up, and this is what finally 
stumped me.

So, I told MySQL and MySQLdb that I was taking my ball home if that's how 
they wanted to play. I downloaded and installed Homebrew, Macports, and 
postgreSQL (through Homebrew) with minimal fumbling. There was one error 
with my PATH but I fixed it in my .bash_profile. As per the advice of the 
internet and Homebrew's brew doctor, I amended "PATH so that 
/usr/local/bin occurs before /usr/bin." This allowed me to start up psql 
and create a database - at least it seemed like it worked, there was no 
satisfying little message about its dimensions like in MySQL.

Anyhoo, now when I do python manage.py runserver or python manage.py syncdb 
it tells me lots of stuff and "ImportError: No module named 
psycopg2.extensions." What does this mean, and how do I fix it? I am 
totally at a loss.

I'm sorry if the way I posed the question is long/confusing, but I wasn't 
really sure what information would be important. I can post the whole 
output from the terminal if it's helpful. It's really long though, and I 
had a hunch the last part is the important part. Any help would be greatly 
appreciated.

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



Customizing the Django Admin Interface

2012-09-15 Thread JJ Zolper
Hello,

I was able to locate the Django files for the admin under contrib in the 
source. I was curious if I could get some tips about customizing the 
interface.

One website I read said I shouldn't change any of the Django source but if 
I want to set up a slightly different login page for example, to put the 
admin files in my local directories that I'm working with.

The real question is that I was able to edit some template files to change 
some of the wording displayed but when I tried to edit the CSS files to get 
a different design I did not see any changes when I restarted my server. Is 
there some sort of collectstatic command that needs to be run? Any input on 
how to propagate these CSS files through would be great.

Thanks,

JJ Zolper

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