Re: Avoiding restarts on the development server
On 7/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi > > I use the development server that comes with Django. I'm currently > trying out some changes to the contrib/admin application, and find > thatI have to restart the server every time I change one of the > templates. Is there some way I can avoid this? You shouldn't have to. What effect do you see if you don't restart the dev server? The old templates get rendered? I'm pretty sure that when using the dev server, templates don't get cached, they should be reread every time a page is loaded. Maybe this doesn't apply for the Admin though. On a side note: What's your need for making changes to contrib/admin? What kind of functionality are you looking for that's not already provided? 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django friendly hosting in Canada?
On 7/3/06, Iain Duncan <[EMAIL PROTECTED]> wrote: > > Anyone have good recomendations for a canadian hosting company that > makes setting up Django sites easy? Will pay higher prices for good > service and stability. > Well, I'm Canadian, but I'm currently using Dreamhost. With Jeff Croft's great tutorial, it was a breeze to setup. And if you Google for "Dreamhost promo codes" you can find some that get you $97 off the two year price. The two year price is *normally* $197, so after the discount it's just $100 for two years. I've not heard of any Canadian sites yet that support Django, but that doesn't mean they're not out there. 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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Still stuck trying to set up testing
Hi On Thu, 08 Jun 2006 23:07:51 -0400, Todd O'Bryan wrote: > And then I need to be running under program control again to add all > my test data to the the db. > > Please tell me that I'm overthinking this and there's some easy way > out of this! The other posters in this thread do give nice solutions. I just extracted the minimum needed to create a testing DB in memory using sqlite. This is what I have: - cut here - import os os.environ['DJANGO_SETTINGS_MODULE']='MYSITE.settings' def createdb(): from django import db from django.conf import settings settings.DATABASE_ENGINE = "sqlite3" settings.DATABASE_NAME = ":memory:" reload(db) from django.core.management import syncdb from django.dispatch import dispatcher from django.dispatch.errors import DispatcherKeyError from django.contrib.auth.management import create_superuser from django.contrib.auth import models as auth_app from django.db.models import signals db.connection.close() # disable the "create a super user" question try: dispatcher.disconnect(create_superuser, sender=auth_app, signal=signals.post_syncdb) except DispatcherKeyError: # This must be run only once per session pass syncdb() - cut here - This presumes that MYSITE is in sys.path. I find that using nosetest (http://somethingaboutorange.com/mrl/projects/nose/) from the directory below MYSITE works pretty well, since it takes care of sys.path. Another comment: The placement of from django import db, and reload(db) seems to be critical. The django.db module needs to be imported before django.settings, and has to be reloaded after changing settings.DATABASE_ENGINE. If you were already using sqlite I guess that's not a problem. > > Thanks, -- you know its kind of tragic we live in the new world but we've lost the magic -- Battery 9 (www.battery9.co.za) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django on Debian Sarge?
> which would indicate that Gentoo's stable mod_python still isn't new > enough, odd as that sounds. It's only one patchlevel higher than > Sarge's version. > > >>...My home dev box is >>gentoo, all I had to do was emerge mod_python and the mysqldb e-build ( >>can't remember name ), checkout django from svn, and follow the >>instructions on the tutorial. > > > OK, well, that's reassuring, and maybe indicates that that comment is > wrong and Sarge is likely to work too. Hey Dustin, I just checked my version numbers and I am definitely running mod_python 3.1.4. Serving with apache2 is working fine ( also from the gentoo ebuild ). Powers-that-be, what should be done about misleading comments on the sites? Thanks iain --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: SubClassing problem
On Sun, 2006-07-02 at 23:12 +0200, Laurent Rahuel wrote: > Hi, > > I got a serious problem with model inheritance in my Django model. Here's a > sample: > > from django.db import models > > class MPTTTree(models.Model): > created_at = models.DateTimeField(_('creation date'), auto_now_add=True) > updated_at = models.DateTimeField(_('last update date'), auto_now=True) > parent = models.ForeignKey("self", null = True, blank = True) > lhs = models.IntegerField(default=0, db_index = True) > rhs = models.IntegerField(default=0, db_index = True) > level = models.IntegerField(default=0, db_index = True) > > class Test(MPTTTree): > name = models.CharField(_('Name'), maxlength=255) > > I can run python manage.py sql myTest and I get this result : > > BEGIN; > CREATE TABLE "mytest_test" ( > "id" serial NOT NULL PRIMARY KEY, > "created_at" timestamp with time zone NOT NULL, > "updated_at" timestamp with time zone NOT NULL, > "parent_id" integer NULL, > "lhs" integer NOT NULL, > "rhs" integer NOT NULL, > "level" integer NOT NULL, > "name" varchar(255) NOT NULL > ); > CREATE TABLE "mytest_mptttree" ( > "id" serial NOT NULL PRIMARY KEY, > "created_at" timestamp with time zone NOT NULL, > "updated_at" timestamp with time zone NOT NULL, > "parent_id" integer NULL, > "lhs" integer NOT NULL, > "rhs" integer NOT NULL, > "level" integer NOT NULL > ); > > ALTER TABLE "mytest_test" > ADD CONSTRAINT > "parent_id_referencing_mytest_mptttree_id" FOREIGN KEY > ("parent_id") > REFERENCES "mytest_mptttree" ("id"); > > ALTER TABLE "mytest_mptttree" > ADD CONSTRAINT > "parent_id_referencing_mytest_mptttree_id" FOREIGN KEY > ("parent_id") > REFERENCES "mytest_mptttree" ("id"); > > COMMIT; > > I can easely understand the second alter statment but I guess there's a > little > problem with the first one. The constraint should reference "mytest_test" and > not "mytest_mptttree". Looks like a bug, but since model inheritance does not work in any case it's not something to worry about right at the moment. Even if you fix this your code will not work as you expect it to. Model inheritance does not work with the current trunk. It is in development and will be completed "as soon as possible" (I spent quite a bit of time working on it yesterday again). Regards, Malcolm --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Automatic redirecting after login
(who's working on the project with Nick) It turns out that this is easy if you use django.contrib.auth.views.login as your default login view and django.contrib.auth.forms.AuthenticationForm as the manipulator for the login form you create. But how many people actually do this? There's one big problem I see with this: The default location to redirect to is hard-coded as '/accounts/profile' in the view. It should be configurable just as the default template name is. Also, the name of the redirect parameter is configurable, (It's django.contrib.auth.REDIRECT_FIELD_NAME), but you have to hard-code it in the template anyway, because you can't look that up from the template, and you have to store the redirect URL as a hidden field in the login form. I refactored this by making the default redirect configurable and going ahead and including a hidden field in the AuthenticationForm manipulator. If people think this cleans things up any, I'd be happy to try to figure out how to submit a patch. But, I suspect that because of these problems, most people just roll their own for these two based on the supplied code. Todd --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Hola
On 7/2/06, mamcxyz <[EMAIL PROTECTED]> wrote: > Con respecto a django, no hay mucha informacion en español, asi que te > tocaria leer la documentacion (que es buena) en ingles. This is a shame, of course, but my Spanish is too bad to do much about it. :( --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Automatic redirecting after login
try /accounts/login/?next=/foobar ? On 03/07/2006, at 5:03 AM, bsdlogical wrote: > > Luigi Pantano wrote: > >> try this >> >> from django.http import HttpResponseRedirect >> >> ... ... >> >> def login(request): >>''' some code to put here ''' >>return HttpResponseRedirect("index.htm") >> >> >> >> > I see what you're saying, but I was thinking something more on a > selective basis. This would redirect all users, but those that log > in to > the main site shouldn't be redirected anywhere. Those that login > from a > different site should be redirected back to it. > > I have in mind code that would check the referrer in the main site > login, but I wanted to check for different methods. > > Thanks! > > Nick > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django on Debian Sarge?
On Sun, Jul 02, 2006 at 09:09:59PM -0700, Iain Duncan wrote: > > I haven't installed on Sarge, but on Gentoo it's no problem because > installing the newest stable packages is the default ( sarge's are > tested much longer with much longer release cycle ). I normally would assume so, but here is what bothered me. From the install page comments: > pol April 21, 2006 at 4:23 p.m. > > Though is says states that only "mod_python 3.x" is required, this is > wrong. You must ahve version 3.2.7 at least. Debian (sarge) stable only > includes 3.1.3, so you will have to get and install the newest version > of mod_python manually. but lindy laurence # emerge mod_python -p These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] dev-python/mod_python-3.1.4-r1 lindy laurence # which would indicate that Gentoo's stable mod_python still isn't new enough, odd as that sounds. It's only one patchlevel higher than Sarge's version. > ...My home dev box is > gentoo, all I had to do was emerge mod_python and the mysqldb e-build ( > can't remember name ), checkout django from svn, and follow the > instructions on the tutorial. OK, well, that's reassuring, and maybe indicates that that comment is wrong and Sarge is likely to work too. Dustin pgpexRcom6bJ0.pgp Description: PGP signature
Re: Broken File Uploads
On Jul 2, 2006, at 1:54 PM, Tyson Tate wrote: ... > image = models.ImageField(upload_to="media/portfolio", > height_field='height', width_field='width', core=True) ... That line was my problem. upload_to is not relative to the root, but to the media/ directory. I set upload_to to "portfolio" and all is well. However, visiting "http://localhost.com:8000/media/portfolio/ image.jpg" gives me a 404, even though the image is in the directory. Do I need to add a special line to my urls.py file? My settings are as such: MEDIA_ROOT = '/Users/ttate/Desktop/fallingbullets/media/' MEDIA_URL = 'http://localhost:8000/media/' ADMIN_MEDIA_PREFIX = '/admin_media/' TIA, Tyson --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Limiting Choices in AddManipulator
Hi, Maybe you could try this: user_choices = [(u.id, u) for u in User.objects.filter(query)] form['field_name'].formfield.choices = user_choices choices expects a list of tuples in the form of (value, display), so that it generates a select field like this: display1 display2 . etc Regards, Jorge On 7/1/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > How can I limit the choices in an AddManipulator? > > I have a m2m relation to User, and it presents all users. I'd like to > filter and only present a subset. > > I've tried setting the choices of the SelectMultipleField, but haven't > had any luck finding the correct incantation. I've gotten as far as > trying this after I create the form > > form['field_name'].formfield.choices = User.objects.filter(query) > > but get some error regarding unpacking a tuple. (I think this is more a > Python gotcha than a Django one.) > > Any help? > Todd > > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
SubClassing problem
Hi, I got a serious problem with model inheritance in my Django model. Here's a sample: from django.db import models class MPTTTree(models.Model): created_at = models.DateTimeField(_('creation date'), auto_now_add=True) updated_at = models.DateTimeField(_('last update date'), auto_now=True) parent = models.ForeignKey("self", null = True, blank = True) lhs = models.IntegerField(default=0, db_index = True) rhs = models.IntegerField(default=0, db_index = True) level = models.IntegerField(default=0, db_index = True) class Test(MPTTTree): name = models.CharField(_('Name'), maxlength=255) I can run python manage.py sql myTest and I get this result : BEGIN; CREATE TABLE "mytest_test" ( "id" serial NOT NULL PRIMARY KEY, "created_at" timestamp with time zone NOT NULL, "updated_at" timestamp with time zone NOT NULL, "parent_id" integer NULL, "lhs" integer NOT NULL, "rhs" integer NOT NULL, "level" integer NOT NULL, "name" varchar(255) NOT NULL ); CREATE TABLE "mytest_mptttree" ( "id" serial NOT NULL PRIMARY KEY, "created_at" timestamp with time zone NOT NULL, "updated_at" timestamp with time zone NOT NULL, "parent_id" integer NULL, "lhs" integer NOT NULL, "rhs" integer NOT NULL, "level" integer NOT NULL ); ALTER TABLE "mytest_test" ADD CONSTRAINT "parent_id_referencing_mytest_mptttree_id" FOREIGN KEY ("parent_id") REFERENCES "mytest_mptttree" ("id"); ALTER TABLE "mytest_mptttree" ADD CONSTRAINT "parent_id_referencing_mytest_mptttree_id" FOREIGN KEY ("parent_id") REFERENCES "mytest_mptttree" ("id"); COMMIT; I can easely understand the second alter statment but I guess there's a little problem with the first one. The constraint should reference "mytest_test" and not "mytest_mptttree". Any idea ?? Regards, Laurent. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django on Debian Sarge?
> Hi, I was looking at trying Django for a project and noticed that in the > comments to the installation directions it was claimed that Debian > Sarge's mod_python isn't recent enough to run Django. That would be a > big complication. Is anyone running Django on Sarge, and can anyone > confirm that it does/does not need something besides the bog-standard > apache2/mod_python/postgres/etc already in the stable package pool? > > Though it's much less important, I wouldn't mind knowing the same answer > for Gentoo (with just x86 keywords) since it might be handy to do some > development on a Gentoo laptop. I haven't installed on Sarge, but on Gentoo it's no problem because installing the newest stable packages is the default ( sarge's are tested much longer with much longer release cycle ). My home dev box is gentoo, all I had to do was emerge mod_python and the mysqldb e-build ( can't remember name ), checkout django from svn, and follow the instructions on the tutorial. This is assuming you have apache and your database engine set up already, but that's really just more of the same. I didn't need to use anything except regular gentoo ebuilds. Iain --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django friendly hosting in Canada?
Anyone have good recomendations for a canadian hosting company that makes setting up Django sites easy? Will pay higher prices for good service and stability. Thanks Iain --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django on Debian Sarge?
Hi, I was looking at trying Django for a project and noticed that in the comments to the installation directions it was claimed that Debian Sarge's mod_python isn't recent enough to run Django. That would be a big complication. Is anyone running Django on Sarge, and can anyone confirm that it does/does not need something besides the bog-standard apache2/mod_python/postgres/etc already in the stable package pool? Though it's much less important, I wouldn't mind knowing the same answer for Gentoo (with just x86 keywords) since it might be handy to do some development on a Gentoo laptop. Dustin pgpZNjkLIvwIb.pgp Description: PGP signature
Broken File Uploads
I'm using the latest Django SVN on my MacOS X box with Python 2.4.3. Everything has worked so far, except for file uploads. I've got something like the following model: from django.db import models class PortfolioImage(models.Model): image = models.ImageField(upload_to="media/portfolio", height_field='height', width_field='width', core=True) alt = models.CharField(blank=True, maxlength=100) class Admin: pass class PortfolioItem(models.Model): title = models.CharField(maxlength=100) home_image = models.ForeignKey(PortfolioImage, related_name="item_home_image") class Admin: pass However, whenever I try to upload an image, I get the following in the console from the server and the admin interface pretends like the file has been uploaded, even though there's no file in my media directory. File "/path-to-python-egg/django/core/servers/basehttp.py", line 273, in run self.finish_response() File "/path-to-python-egg/django/core/servers/basehttp.py", line 312, in finish_response self.write(data) File "/path-to-python-egg/django/core/servers/basehttp.py", line 391, in write self.send_headers() File "/path-to-python-egg/django/core/servers/basehttp.py", line 443, in send_headers self.send_preamble() File "/path-to-python-egg/django/core/servers/basehttp.py", line 372, in send_preamble self._write( File "/path-to-python-lib/python2.4/socket.py", line 256, in write self.flush() File "/path-to-python-lib/python2.4/socket.py", line 243, in flush self._sock.sendall(buffer) error: (32, 'Broken pipe') I'm quite positive that my settings are correct: MEDIA_ROOT = '/Users/ttate/Desktop/fallingbull ets/media/' MEDIA_URL = 'http://localhost:8000/media/' ADMIN_MEDIA_PREFIX = '/media/' media/ has 777 permissions. Any ideas? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Removing a file from object
Hi, I've got a model with a FileField and blank=True. When I create an object by using the admin interface and fill in a file, everything is ok. When I edit the object again, there's no way to remove the file (without uploading a new file). Is this something yet to be done? Rudolph --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Advanced Locale from URL middleware
Hi Adrian, Here is my blog post about it (in french and english): http://www.jondesign.net/articles/2006/jul/02/langue-depuis-url-django-url-locale-middleware/ I'll put it on the wiki. Jon --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Automatic redirecting after login
Luigi Pantano wrote: >try this > >from django.http import HttpResponseRedirect > >... ... > >def login(request): >''' some code to put here ''' >return HttpResponseRedirect("index.htm") > > > > I see what you're saying, but I was thinking something more on a selective basis. This would redirect all users, but those that log in to the main site shouldn't be redirected anywhere. Those that login from a different site should be redirected back to it. I have in mind code that would check the referrer in the main site login, but I wanted to check for different methods. Thanks! Nick --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Automatic redirecting after login
Luigi Pantano wrote: >try this > >from django.http import HttpResponseRedirect > >... ... > >def login(request): >''' some code to put here ''' >return HttpResponseRedirect("index.htm") > > > > I see what you're saying, but I was thinking something more on a selective basis. This would redirect all users, but those that log in to the main site shouldn't be redirected anywhere. Those that login from a different site should be redirected back to it. I have in mind code that would check the referrer in the main site login, but I wanted to check for different methods. Thanks! Nick --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Hola
No. Tienes que venir aprendido :) http://www.python.org Saludos, 2006/7/2, Joan <[EMAIL PROTECTED]>: > > Quisiera saber si en este grupo podemos aprender el lenguaje de > programación para crear software u otros programas. Saludos > >Joan Translation: He wants to know if in this group somebody could learn the programing language in order to creat sofware o other programs. The replay is the must know the programming language in advance. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Hola
No. Este grupo es especifico sobre django, una plataforma de desarrollo web basada en python, por lo tanto solo sirve para hacer aplicaciones/sitios Web. Sin embargo, si te interesa ese tipo de desarrollos, la curva de aprendizaje es baja. Pero debes tener fundamentos de programacion y de python. Puedes buscar "dive into python" en español y manuales de python en español. Con respecto a django, no hay mucha informacion en español, asi que te tocaria leer la documentacion (que es buena) en ingles. --~--~-~--~~~---~--~~ Ha recibido este mensaje porque está suscrito a Grupos de Google "Django users" grupo. Si quiere publicar en este grupo, mande un correo electrónico a django-users@googlegroups.com Para anular la suscripción a este grupo, envíe un mensaje a [EMAIL PROTECTED] Para visualizar más opciones, visite este grupo enhttp://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Avoiding restarts on the development server
Hi I use the development server that comes with Django. I'm currently trying out some changes to the contrib/admin application, and find thatI have to restart the server every time I change one of the templates. Is there some way I can avoid this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Automatic redirecting after login
try this from django.http import HttpResponseRedirect ... ... def login(request): ''' some code to put here ''' return HttpResponseRedirect("index.htm") -- Luigi Pantano --- AICQ - Associazione Italiana Cultura Qualità: http://www.aicq.it/aicqsi.html AIN - Associazione Informatici Nisseni: http://www.informaticinisseni.org/ b0rnfr33th1nk3r - sito personale: http://b0rnfr33th1nk3r.objectis.net/ Clug: http://caltanissetta.linux.it IPUG - Italian Python User Group: http://www.italianpug.org Misado's (C) LAB: http://misadoslab.trouge.net/ Python Tips & Tricks: http://py-tips-tricks.python-hosting.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Automatic redirecting after login
Is there a way to ask a page to redirect somewhere after a certain action is completed? Specifically, after a user has logged in? I have a sub-site running at /orgs/keyclub. When users click "Login" from the sub-site, they are directed to the main site's login page (to prevent code duplication - both sites have access to the same login data). I'm wondering if it's possible to have the main site redirect back to the sub-site after the login is completed. That way, users won't have to navigate back manually to the sub-site. I tried making the sub-site's login link point to /login.html?next=/orgs/keyclub, but this didn't work. I would greatly appreciate any help. Thanks, Nick --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: regex: how to do this in one line of code?
James Bennett wrote: > The fact that you've got three different regular expressions with > three different substitutions to do means that this needs to be three > logical operations. However, you can make this slightly easier on > yourself by building a dictionary of the patterns and substitutions, > then looping over it to do all the heavy lifting. For example: That's pretty cool! Big thanks to James! Regards, - Eric --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: regex: how to do this in one line of code?
On 7/2/06, nkeric <[EMAIL PROTECTED]> wrote: > I'm quite a newbie to regex, could the above code be done in a single > line of regex replacing? The fact that you've got three different regular expressions with three different substitutions to do means that this needs to be three logical operations. However, you can make this slightly easier on yourself by building a dictionary of the patterns and substitutions, then looping over it to do all the heavy lifting. For example: sub_dict = { '[\s]+': ' ', '[-]+': '-', '[.]+': '.' } for pat, sub in sub_dict.iteritems(): decoded_string = re.sub(pat, sub, decoded_string) This also has the advantage of making it easy to add new substitutions later if you find you need them. -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
regex: how to do this in one line of code?
hi all, a small question, I'm trying to clean up a string, replacing multiple spaces with a single space, multiple "-"s "."s with single "-" & ".", my current code is: decoded_string = re.sub('[\s]+', ' ', decoded_string) decoded_string = re.sub('[-]+', '-', decoded_string) decoded_string = re.sub('[.]+', '.', decoded_string) I'm quite a newbie to regex, could the above code be done in a single line of regex replacing? pls enlightenment me, TIA :) Regard, - Eric --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: UNIQUE Index in more then one columns.
Thank your for your answer. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: How install mysqldb under CentOS3 (or enable pyvault?)
mamcxyz wrote: > Any input? CentOS 3 requires a bootstrap RPM: http://www.python.org/pyvault/centos-3-i386/pyvault-release-bootstrap-3-3.el3.pyv.noarch.rpm I never created compat libs for mysql on this platform, though. Contributors welcome. :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 unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---