Re: Rolling my own basic authentication?

2006-08-25 Thread magus
Commenting on my own posts here :-) magus wrote: > Sean Perry wrote: > > magus wrote: > > > I'd like to roll my own basic authentication for a web service, i.e. I > > > don't want to use the contrib.auth module. If possible I'd like to > > > avoid relying on the server for this. Anyone who can

problems with unicode in website

2006-08-25 Thread Eugene Pyvovarov
hello everybody. I'm new in django... just want to create base apps from tutorial on djangoproject website. I am using mysql 4.1 and python 2.4, django from svn When I create database in iso-8859-1 - all stuff working good, but when I befin to do the same website and making my database in utf-8

Re: i18n: Translating default model values

2006-08-25 Thread Ian Clelland
On 8/20/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Another question regarding internationalization: How can I > internationalize the default model SQL files? Sorry, I've been away for a few days, and just catching up on the mailing list :) You can't do this with sqlinitialdata,

Re: Error messages with Apache/mod_python

2006-08-25 Thread andyhume
Ah, solved it. Just had to add the path to my settings file to the sys.path in the apache conf. :) Cheers, Andy. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Confused on Where to Put SQL

2006-08-25 Thread Andy Todd
On 8/25/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 8/24/06, bradford <[EMAIL PROTECTED]> wrote: > > > > it's actually going to be thousands of sql queries for each user. > > would doing it all in one object lock out all of the users for the > > entire time the "magic" is being done (until

Error messages with Apache/mod_python

2006-08-25 Thread andyhume
Hello, I'm too new to Django and mod_python in general to understand where I'm going wrong here. I would be very grateful if somone could have a look at the traceback below and let me know what the problem might be.Thanks very much. --- Mod_python error: "PythonHandler

Re: Oh, no, don't evaluate that QuerySet!

2006-08-25 Thread Russell Keith-Magee
On 8/24/06, Karen Tracey <[EMAIL PROTECTED]> wrote: Anyway, things I've learned:- It's better to explictly set a context variable to False vs. just notsetting it.  (This perhaps should have been obvious, but it neveroccurred to me that a side-effect of not setting a variable would be the whole

Re: Webdav access - OT

2006-08-25 Thread Curtis
PyFileServer - http://pyfilesync.berlios.de/pyfileserver.html seems to be very similar (at least in theory) to what you want. It's a WSGI WebDav server. Cheers, -Curt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Extracting arguments to web service methods

2006-08-25 Thread Ivan Sagalaev
magus wrote: > I'll have to look at it in more detail but it looks close to what I > want. It does leave one thing out though--creating a 401 response if > authentication is missing. Ah... Yes, I have it in another place since I have a mixed authorization. But it's simple to add where it checks

Re: Italian Documentation

2006-08-25 Thread Daniele Spino
I understand. Thanks. A trivial question: Is it better to wait 1.0 for me to learn django? It will be completely different from 0.95? Can I talk you in italian? Daniele --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Extracting arguments to web service methods

2006-08-25 Thread magus
Ivan Sagalaev wrote: > magus wrote: > > Well, the auth module _requires_ the session stuff. Which in this case > > is overkill. All I really need is to return a 401 and get a basic > > authentication. > > I've posted some time ago on this list a simple middleware that does > HTTP authorization

Re: Stumped on how to implement flatpages

2006-08-25 Thread [EMAIL PROTECTED]
Score! That was exactly the problem! I opened up the DB, and the site_id was 5, though my site_id in settings was 1. I guess I went wrong when I was mucking around with the sites section in the admin. Instead of editing example.com to match my current domain, I kept adding new ones, and the

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Ian Holsman
On 26/08/2006, at 8:13 AM, Pedro Lima wrote: > > BTW, depending on your application you may want to make the hash with > the email and something specific from your site to be able to validate > the link latter. If you only set the email in the hash someone can do > cryptString('[EMAIL

Re: Rolling my own basic authentication?

2006-08-25 Thread magus
Sean Perry wrote: > magus wrote: > > I'd like to roll my own basic authentication for a web service, i.e. I > > don't want to use the contrib.auth module. If possible I'd like to > > avoid relying on the server for this. Anyone who can offer some > > pointers on how to raise a 401 on a request

Re: Dreamhost: admin works, rest doesn't

2006-08-25 Thread Paulo
Go checkout DH's status page < http://status.dreamhost.com/ >. You MySQL DB server might have been knocked offline. If your sites' uptime is important to you get as far away from DH as possible. Granted you get what you pay for so a $12 hosting account with more bells and whistles than you can

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Pedro Lima
BTW, depending on your application you may want to make the hash with the email and something specific from your site to be able to validate the link latter. If you only set the email in the hash someone can do cryptString('[EMAIL PROTECTED]') and register.

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread [EMAIL PROTECTED]
Shortening to http://{{ domain }}/account/reg/{{verifyurl}}/ made no difference --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread [EMAIL PROTECTED]
And only some outlooks. The one I'm using right now gets it right, for example. Stupid outlook. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Stumped on how to implement flatpages

2006-08-25 Thread Carl Holm
Have you checked to make sure that the 'SITE_ID" variable in settings.py matches the ID column in the django_flatpage table for the specified URL ? - CL [EMAIL PROTECTED] wrote: >I read the documentation on the flatpages, included the middleware, >added the app, sync'd the database, and made

Re: included templates to load own objects

2006-08-25 Thread Alan Green
Hi Mae, Two thoughts here: 1. Have a look at the TemplateContextProcessors: http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext 2. Custom tags aren't that hard to write. Alan. On 8/25/06, Mae <[EMAIL PROTECTED]> wrote: > > Hi all, here's my

Re: Diamanda wiki v.0.0.2

2006-08-25 Thread [EMAIL PROTECTED]
I think I'll make "generic" categories where wiki pages and other components like news could be added :) more to come :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: my private django repository goes public

2006-08-25 Thread Guillermo Fernandez Castellanos
With SVN (http://subversion.tigris.org/). On the command line: svn co http://svn.sourceforge.net/viewvc/django-userlibs/trunk/ some_directory But if you are under Windows, I recommend TortoiseSVN (http://tortoisesvn.tigris.org/). In this case create an empty directory, right click on it, chose

Re: my private django repository goes public

2006-08-25 Thread [EMAIL PROTECTED]
Ehm maybe a stupid question, but how do i download those files? --~--~-~--~~~---~--~~ 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

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Waylan Limberg
On 8/25/06, Waylan Limberg <[EMAIL PROTECTED]> wrote: > On 8/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > [snip] > > > > I've gone through and stripped out every extra space I can find, > > thinking that was the problem, but still that dang trailing slash comes > > down to the next

Re: import models doesn't work in a script

2006-08-25 Thread 83311
Waylan Limberg wrote: > > Thx - it works - but why? > > ;-) > > I'm guessing you used manage.py shell??? That sets the > DJANGO_SETTINGS_MODULE to the setting.py file in the current directory > for you so everything just works. Nope - I've used the "normal" Python-Interpreter. Timothy

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Waylan Limberg
On 8/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > [snip] > > I've gone through and stripped out every extra space I can find, > thinking that was the problem, but still that dang trailing slash comes > down to the next line. Ideas? > For what its worth, Gmail does indeed display that on

Re: import models doesn't work in a script

2006-08-25 Thread Waylan Limberg
On 8/25/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > Try this: > > > > import sys > > import os > > sys.path.append('path to where mysite is') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > > > from mysite.myapp.views import * > > from

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Jay Klehr
At least for a test, if it doesn't happen with a shorter URL, then it's clearly an encoding issue. You could try going the other way too and making it longer, to see if more than the ending slash is bumped off. Quoted Printable only uses 1 equal sign though, now that I think about it more,

Re: import models doesn't work in a script

2006-08-25 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > Try this: > > > > import sys > > import os > > sys.path.append('path to where mysite is') > > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > > > from mysite.myapp.views import * > > from mysite.myapp.models import * > > Thx -

Re: import models doesn't work in a script

2006-08-25 Thread 83311
Nathan R. Yergler wrote: > Because the environment variable (DJANGO_SETTINGS_MODULE) needs to point > to the Python module in Python package syntax (ie, dotted path syntax). Okay - I thought it must be in Linux-Syntax (full-path). But why does it works in the Interpreter with the Linux-Syntax

Re: import models doesn't work in a script

2006-08-25 Thread Nathan R. Yergler
Because the environment variable (DJANGO_SETTINGS_MODULE) needs to point to the Python module in Python package syntax (ie, dotted path syntax). So the package ("mysite" in the example below) must be on the Python path (which is what sys.path.append does below). On Fri, 2006-08-25 at 11:52

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread [EMAIL PROTECTED]
Not handy, but maybe I'll try shortening the URL and see if that helps. --~--~-~--~~~---~--~~ 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

Re: import models doesn't work in a script

2006-08-25 Thread 83311
[EMAIL PROTECTED] wrote: > Try this: > > import sys > import os > sys.path.append('path to where mysite is') > os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' > > from mysite.myapp.views import * > from mysite.myapp.models import * Thx - it works - but why? ;-) Timothy

Re: Is the built-in WSGI web server mult-threaded?

2006-08-25 Thread Waylan Limberg
On 8/25/06, Rob Hudson <[EMAIL PROTECTED]> wrote: > > As a fall back we may be able to set up a Lighttpd web server locally > to get the multi-threaded experience but that's a little bit of a > bigger and more complex installation. Keeping it all in Python was > looking rather attractive. You

Re: IN field lookup with empty list

2006-08-25 Thread Enrico
I think your patch will do the trick, but maybe the problem should be solved in the "source" of the problem. Instead of removing empty IN's, it would be better if they don't show up at all. I tried a fix myself but it didn't worked: django/db/models/query.py # ... def

import models doesn't work in a script

2006-08-25 Thread Timothy Kesten
Hi Folks, I've created a project, an app, a Model. In Python-Interpreter an import works: >>> from kb.models import Main, Details >>> Same in a script occurs errors like: Traceback (most recent call last): File "fillkb.py", line 1, in ? from kb.models import Main, Details File

Re: import models doesn't work in a script

2006-08-25 Thread [EMAIL PROTECTED]
Try this: import sys import os sys.path.append('path to where mysite is') os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings' from mysite.myapp.views import * from mysite.myapp.models import * --~--~-~--~~~---~--~~ You received this message because you

Dreamhost: admin works, rest doesn't

2006-08-25 Thread Chase
Hi all I know the Dreamhost/Django connection has plenty of weird issues, but I haven't run into this one before. All of a sudden, about 12 hours ago, a django (0.91) site we're hosting on Dreamhost went down. The admin site is still accessible and works fine, but the rest of it throws 500

Ordering problems

2006-08-25 Thread Seth Buntin
I have this in my model: class Syllabus(models.Model): program = models.ForeignKey(SyllabusProgram) course_number = models.IntegerField() def __str__(self): return "%s %s" %(self.program, self.course_number) class Meta: ordering = ['program', 'course_number', ] It orders

Re: User Registration weirdness. Ian, help!

2006-08-25 Thread Jay Klehr
Looks to me like a "quoted-printable" email encoding issue, that's what the two equal signs on the end probably come from. The line that the URL is on looks to exceed the allowed character limit, so the encoding has added the double equal sign, and bumped the text to the next line. An email

User Registration weirdness. Ian, help!

2006-08-25 Thread [EMAIL PROTECTED]
OK, the code I'm using came from Jeff Croft's Lost-Theories source, which in turn cribbed heavily from zyons... so with that background out of the way... When the user gets their verification email, the trailing slash isn't sitting on the same line as the rest of the link.. it looks something

Re: Italian Documentation

2006-08-25 Thread [EMAIL PROTECTED]
Picio wrote: > Hello, > is there anyone that knows about any Italian translated Django > documentation? > I'm translating the basic tutorial (1,2,3,4) for myself, is it helpful > for anybody? > Let me know. I'm afraid it will soon be obsolete and require a lot of work to keep it in sync with the

TemplatePages directory

2006-08-25 Thread Baurzhan Ismagulov
Hello, I'm trying TemplatePages. So far, it does what I want, namely, avoid writing a views.py function for every static page. Some issues: * I have the following directory structure: /dir/myprj/myapp/ /dir/verdjnlib/ I add /dir to PYTHONPATH. In this layout, I have to put the html

Re: Problem setting up Apapche FastCGI and Django

2006-08-25 Thread viestards
> Did you actually started the fastcgi django process on port 3066? yes, I restarted manage.py runfcgi once again and it is on process list. Viestards > hth, > Edgars > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Help about tutorial1 (about Poll object)

2006-08-25 Thread Nicolas Steinmetz
Waylan Limberg a écrit : > Did you close your shell and restart it so that the changes can be imported? No I did not. As my (python) shell was open, I only did : from mysite.polls.models import Poll, Choice > I just checked the tutorial and you aren't expressly told that you > have to do so,

Re: Rolling my own basic authentication?

2006-08-25 Thread Sean Perry
magus wrote: > I'd like to roll my own basic authentication for a web service, i.e. I > don't want to use the contrib.auth module. If possible I'd like to > avoid relying on the server for this. Anyone who can offer some > pointers on how to raise a 401 on a request that doesn't contain the >

Rolling my own basic authentication?

2006-08-25 Thread magus
I'd like to roll my own basic authentication for a web service, i.e. I don't want to use the contrib.auth module. If possible I'd like to avoid relying on the server for this. Anyone who can offer some pointers on how to raise a 401 on a request that doesn't contain the Authentication: header?

Re: Extracting arguments to web service methods

2006-08-25 Thread magus
Jacob Kaplan-Moss wrote: [..] > > Another thing I'm wondering here is relating to authentication. > > `django.contrib.auth` relies on sessions, which is good for sites but > > is unnecessary for web services (again I'm looking at del.icio.us as a > > good example). > > The session stuff is only

Re: Is the built-in WSGI web server mult-threaded?

2006-08-25 Thread Rob Hudson
What would it take to make it multi-threaded? Just the WSGI server part? I'm thinking again of the case where we'd like to ship this to scientists for anonymous review and we'd like as real of an experience as possible. As a fall back we may be able to set up a Lighttpd web server locally to

Re: Help about tutorial1 (about Poll object)

2006-08-25 Thread Waylan Limberg
On 8/25/06, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > [snip] > > it seems it does not work... and I do not have : > > # Make sure our __str__() addition worked. > >>> Poll.objects.all() > [] > > instead of it I have : > > # objects.all() displays all the polls in the database. > >>>

Help about tutorial1 (about Poll object)

2006-08-25 Thread Nicolas Steinmetz
Hello, I'm new in Django (so hello world :) ) but I have one question about tutorial1. Cf : http://www.djangoproject.com/documentation/tutorial1/ In polls/models.py, we have already two classes : from django.db import models # Create your models here. class Poll(models.Model):

Re: Admin: linking to foreignKey / m2m tables

2006-08-25 Thread Jay Parlar
Is the edit_inline option to ForeignKey what you're looking for? Jay P. --~--~-~--~~~---~--~~ 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

Re: Re: Re: Re: Extending user model in 0.95?

2006-08-25 Thread James Bennett
On 8/25/06, Jakub Labath <[EMAIL PROTECTED]> wrote: > Internal dispatcher sounds good :-). Only thing that worries my is the > word internal. Is this something that is likely to stay or will this > be gone when the next version comes along. The decision I'll make will > likely have long lasting

Re: Stumped on how to implement flatpages

2006-08-25 Thread Jay Parlar
Are you 100% sure that the URL you created in the db has both the leading and trailing slashes? That screwed me up the first time I tried using flatpages. And FYI, this is how I have my MIDDLEWARE_CLASSES defined: MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware',

Italian Documentation

2006-08-25 Thread Picio
Hello, is there anyone that knows about any Italian translated Django documentation? I'm translating the basic tutorial (1,2,3,4) for myself, is it helpful for anybody? Let me know. Thanks a lot Picio --~--~-~--~~~---~--~~ You received this message because you

Re: Re: Re: Extending user model in 0.95?

2006-08-25 Thread Jakub Labath
Hi All, On 8/25/06, James Bennett <[EMAIL PROTECTED]> wrote: > > Check out Django's internal dispatcher; whenever an instance of a > model is saved, the dispatcher signals 'pre_save' and 'post_save' are > fired before and after the save, respectively, with information about > the class of model

Problem setting up Apapche FastCGI and Django

2006-08-25 Thread viestards
I'm stuck with setting up django on Apache 1.3.7 with FastCGI. I', trying to follow Django documentation, but that does not seems to work here is part from my httpd.conf FastCGIExternalServer /usr/home/arvis/django/tst/mysite/site.fcgi -host 127.0.0.1:3066 ServerName testa.darba.info

Re: Diamanda wiki v.0.0.2

2006-08-25 Thread maddiin
im curious how you decide and look forward to your next update. maddiin --~--~-~--~~~---~--~~ 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

Re: Dynamic Menus...

2006-08-25 Thread Jonathan Buchanan
> And (obviously?) dont rely on the correct make and model coming back > from your form. You'll eventually get someone constructing their own > POST data for a laugh and seeing what happens if they had selected > Renault Impala... :) Here's example source for an implementation of just that in

Re: Unicode, unicode, more unicode

2006-08-25 Thread Gábor Farkas
Sean Schertell wrote: > Fweeew!!! > > That's really good news. I'd have been really disappointed if I > couldn't do these sites in django. Hooray! > yes, as others already said, if you do not need to "work with" those strings, you can just set everything (page-templates, database) to

Re: Dynamic Menus...

2006-08-25 Thread spacedman
And (obviously?) dont rely on the correct make and model coming back from your form. You'll eventually get someone constructing their own POST data for a laugh and seeing what happens if they had selected Renault Impala... :) --~--~-~--~~~---~--~~ You received

Re: Unicode, unicode, more unicode

2006-08-25 Thread Ivan Sagalaev
Sean Schertell wrote: > I'm planning to do two large bilingual sites (english/japanese). Does > django's lack of unicode support mean that I won't be able to collect > form data from utf-8 pages? Oh, no this whole conversion is just about convenience. You can do multilingual things in

Re: Unicode, unicode, more unicode

2006-08-25 Thread Jay Klehr
It shouldn't, if all you're doing is saving and redisplaying Unicode characters between the database and your site, you should be fine in that regard. I believe a lot of the issues come up when you're trying to use string comparing and modifying functions that aren't Unicode safe. PHP isn't

Re: Unicode, unicode, more unicode

2006-08-25 Thread Ivan Sagalaev
Victor Ng wrote: > I was wondering if anyone else is using Django to handle a > multi-language site - and what people thought of getting Django to use > unicode strings everywhere. There is an ongoing effort of converting Django to use unicode internally carried out by Gabor. Search