Re: HttpResponse.delete_cookie() gives me an error

2010-08-18 Thread Dane Larsen
Environment: Request Method: GET Request URL: http://*.com/colors/delete/colorcompare89441/ Django Version: 1.2.1 Python Version: 2.6.5 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',

Generic Relations: questions

2010-08-18 Thread v0idnull
I asked a while back about having generic relations and someone pointed me to http://docs.djangoproject.com/en/1.2/ref/contrib/contenttypes/#generic-relations This wasn't what I was looking for. What I was looking for is this model I made: class Relationship(models.Model): id =

Re: HttpResponse.delete_cookie() gives me an error

2010-08-18 Thread Rolando Espinoza La Fuente
On Wed, Aug 18, 2010 at 5:58 PM, larsendt wrote: > The relevant code is simple: > >    response = HttpResponseRedirect('/colors/') >    response.delete_cookie(key=color_id, path='/') >    return response > > But when I try to run it, I get the error: > >    TypeError at

override admin formset fields

2010-08-18 Thread Andrés Otárola
Hi, the default field for a formset in admin is the AdminDateWidget, but i need to use a custom widget and pass the localize=True parameter to the field, but I cant find where I need to override the field, this is what ive got but no effect: class

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Graham Dumpleton
On Aug 18, 6:31 pm, Mathieu Leduc-Hamel wrote: > Richard, > > it's not the good way to do this, in the settings.py cause as i said before, > the code in the settings.py is executed every time somebody initiate a > session for the first time. The point there is a way to have

Re: Can I simply disable the CSRF? crazy

2010-08-18 Thread chenge
On 8月18日, 上午4时29分, Rolando Espinoza La Fuente wrote: > On Tue, Aug 17, 2010 at 8:01 AM, chenge wrote: > > I'm new to django. CSRF let me crazy! > > Can't use {% csrf_token %} tag inside your 's? > > See csrf_exempt >

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Dear Daniel, I must admit that I am a fresh man in Django developement, so there's indeed many concepts and procedures not clear to me, I was affected by J2EE's concepts heavily. I am ready to inspect which.py files will be executed automatically when an app start up, till now what I know are

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Emm, this may another way to reach it, I'll consider it. On 8月18日, 下午10时06分, skyjur wrote: > You could try to create an app with models.py file and put your calls > in models.py. Then register your app in installed apps, above all > other apps. > >

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Hi, Emily, I am very glad to share my design with all, but I want to show it when it can work. So let me inspect it for more days, I will introduce my design for you later. Thanks for your careness. On 8月18日, 下午6时18分, Emily Rodgers wrote: > Hi, > > I still don't

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Hi, Emily, I am very glad to share my design with all, but I want to show it when it can work. So let me inspect it for more days, I will introduce my design for you later. Thanks for your careness. On 8月18日, 下午6时18分, Emily Rodgers wrote: > Hi, > > I still don't

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Sounds good idea. I'll try it. On 8月18日, 下午3时04分, Richard Colley wrote: > Why not call your "boot" code from settings.py? > > On Aug 18, 4:05 pm, Tang Daogang wrote: > > > > > hi, Emily, > > > Let me introduce Scala/Lift as example. > > > Every

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Mathieu, Thanks for you continuous attention. I will try twod.wsgi as a scheme later. On 8月18日, 下午4时31分, Mathieu Leduc-Hamel wrote: > Richard, > > it's not the good way to do this, in the settings.py cause as i said before, > the code in the settings.py is executed every

Re: CSRF verification failures (admin)

2010-08-18 Thread Russell Keith-Magee
2010/8/18 Aspontus : > Sorry, I haven't thought it through. > Server is running: > - Debian  GNU/Linux 5.0 with 2.6.32.2 kernel > - Python 2.5.2 > - Django 1.2.1 > -  MySQL 5.0.51 (with MySQLdb 1.2.2) - default engine InnoDB > -  Apache2 with mod_python 3.3.1 > Browsers are in

HttpResponse.delete_cookie() gives me an error

2010-08-18 Thread larsendt
The relevant code is simple: response = HttpResponseRedirect('/colors/') response.delete_cookie(key=color_id, path='/') return response But when I try to run it, I get the error: TypeError at /colors/delete/colorcompare29108/ translate() takes exactly one argument (2 given)

Re: Bind variables in Oracle backend - how to use them?

2010-08-18 Thread buddhasystem
Thanks, I'll look into that. In the meantime, I managed to just use the cursor from cx_Oracle (as in the example on Oracle site) and the code looks slightly more elegant. However, both "my" and yours solution suffer from the same defect imho -- that the ORM machinery of Django is unusable. We

Re: Bind variables in Oracle backend - how to use them?

2010-08-18 Thread Tim Sawyer
Friends, I'm in need of an implementation which calls for using bind variables (in Oracle sense, not generic) in my SQL in a Django application. Any experience with that, anyone? Here's an example using bind variables to return output values from a PL/SQL block. >>> import cx_Oracle >>>

Re: How to create custom form widgets ?

2010-08-18 Thread Nick
Here's an example: http://joshourisman.com/2008/11/19/custom-fields-and-widgets-django-forms/ Another good way to go would be to look at the django widgets in the source code and follow their example On Aug 18, 1:44 pm, ydjango wrote: > I am using a 3rd party javascript

Django-sphinx DOC ID, different column

2010-08-18 Thread Lukáš
Hey, I use sphinx on regular basis with PHP and now I wanted to implement it to my Django project. Everything went smoothly, but when I tried my first search, I got an error. Exception Value:'Product' object has no attribute 'id' Exception Location:

How to create custom form widgets ?

2010-08-18 Thread ydjango
I am using a 3rd party javascript library with some custom components like combo box. I want to use this 3rd party combo box instead of the default combo box that django forms modelchoicefield(widget= forms.select(...),...) displays. I guess I will have to create another widget replace widget=

Re: can't import any of my libraries inside of my app folder

2010-08-18 Thread Sector7B
disregard, i didn't change my code, but my IDE did. fyi: "python manage.py shell" actually showed me the exact error. On Aug 18, 12:18 pm, Sector7B wrote: > **Disclaimer i'm using Django for GAE, but i really think this is a > Django thing** > > Last night i had a

Re: How to automatically insert user_id in admin

2010-08-18 Thread Martin Tiršel
I will answer myself. The solution is ModelAdmin.save_model(...) method: class TaskAdmin(admin.ModelAdmin): exclude = ('user', ) def save_model(self, request, obj, form, change): obj.user = request.user obj.save() Martin On Wed, 18 Aug 2010 02:01:33 +0200, Martin

Re: connect to database from template

2010-08-18 Thread Renne Rocha
You have to do a view that handle the action of getting the content of the treeview... It seems you don't know how Django works. Take a look at the tutorial first. Don't code Django like you code PHP... On Wed, Aug 18, 2010 at 11:01 AM, Imad Elharoussi wrote: > I

Re: project management app

2010-08-18 Thread piz...@gmail.com
Hi, I've seen this mail and I'm also developing a project management application on my own (at least until I have the first beta) but if you want to take a look you can get it from my personal server, it's a bazaar repository: bzr://halcyon.zapto.org/supervise If the server does not

Re: project management app

2010-08-18 Thread tiemonster
Beta testing is an interesting option. Perhaps I can host the latest subversion somewhere and let you try it out. It may take a couple weeks, though. On Aug 17, 4:39 pm, chris hendrix wrote: > yeah i couldn't get it installed either.  I'm wondering if the project > was

Re: Migration: AlreadyRegistered

2010-08-18 Thread Christos Jonathan Hayward
I'm not using virtualenv. django.contrib.admin wants a DJANGO_SETTINGS_MODULE to be set: Inner Sanctum ~/directory $ python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>>

can't import any of my libraries inside of my app folder

2010-08-18 Thread Sector7B
**Disclaimer i'm using Django for GAE, but i really think this is a Django thing** Last night i had a bunch of code working, did a commit went to bed. Got up this morning and started my django app and suddenly any library i try to import from myapp fails with something like this: "Could not

Re: per-object permission

2010-08-18 Thread Наталя Триф'як
Hello! I have per-object permission problem too. I am investigating django-authority now: http://packages.python.org/django-authority/. Maybe it helps you. netik -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: CSRF verification failures (admin)

2010-08-18 Thread Aspontus
Sorry, I haven't thought it through. Server is running: - Debian GNU/Linux 5.0 with 2.6.32.2 kernel - Python 2.5.2 - Django 1.2.1 - MySQL 5.0.51 (with MySQLdb 1.2.2) - default engine InnoDB - Apache2 with mod_python 3.3.1 Browsers are in default polish configuration and I've tested it with

Re: Bind variables in Oracle backend - how to use them?

2010-08-18 Thread buddhasystem
Thank you, however, I am at loss to the syntax of specifying the bind variables for the raw Django query! I've tried everything (like separating the select statement and the "exec" addition with ;) and still get a variety of error messages. Do you know how to write a query with binds that will

Re: 'module' object has no attribute 'instancemethod' error

2010-08-18 Thread Wim Feijen
And I solved the problem as well, a new.pyc file was dangling somewhere in my project root, so that was why new.SomeThing didn't work. Oh, I'm happy now! On 18 aug, 16:13, Wim Feijen wrote: > Nice app Reinout! This does really help in cleaning up! > > Unfortunately, it does

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Daniel Roseman
On Aug 18, 7:05 am, Tang Daogang wrote: > hi, Emily, > > Let me introduce Scala/Lift as example. > > Every lift project has a file named 'Boot.scala', this file will only > be executed once when this project boots up. In this file, we can > write some initial codes to

Re: 'module' object has no attribute 'instancemethod' error

2010-08-18 Thread Wim Feijen
Nice app Reinout! This does really help in cleaning up! Unfortunately, it does not solve this problem. But I'll try to dig some deeper. On 11 aug, 13:19, Reinout van Rees wrote: > On 08/10/2010 09:53 PM, WimFeijenwrote: > > > Exception Type: ViewDoesNotExist at / > >

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Mathieu Leduc-Hamel
The problem with that way, as said before is that you don't really know if your code will be executed at startup in the wsgi context... and exactly at what time. 2010/8/18 skyjur > You could try to create an app with models.py file and put your calls > in models.py. Then

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread skyjur
You could try to create an app with models.py file and put your calls in models.py. Then register your app in installed apps, above all other apps. source: http://stackoverflow.com/questions/2610088/can-djangos-auth-user-username-be-varchar75-how-could-that-be-done On Aug 18, 1:18 pm, Emily

Re: connect to database from template

2010-08-18 Thread Imad Elharoussi
I want to connect to a server and get a tree object regularily and show the modifications in the treeview do you know how can i do this? 2010/8/18 Renne Rocha > I believe not... but why are you trying to do this? > > It is not the right use for the template layer of

Re: connect to database from template

2010-08-18 Thread Sithembewena Lloyd Dube
One of Django's design principles is to separate database access and application logic from presentation. Rather stick to the tutorial and documentation to use Django, and forget the PHP way of doing things while you use Django. On Wed, Aug 18, 2010 at 3:53 PM, Imad Elharoussi

Re: connect to database from template

2010-08-18 Thread Renne Rocha
I believe not... but why are you trying to do this? It is not the right use for the template layer of Django... On Wed, Aug 18, 2010 at 10:53 AM, Imad Elharoussi wrote: > Hello > > Can we connect to a database from the template like in php? > > -- > You received

Re: filter users by group

2010-08-18 Thread Wim Feijen
So simple and so great! Thanks! On 11 aug, 21:50, Nick wrote: > You can subclass the User admin and then unregister the default admin > and register your new subclassy admin (subclassy is a word) > > in admin.py: > > from django.contrib.auth.admin import UserAdmin > from

Re: Model Custom Validator between more than one field

2010-08-18 Thread skyjur
No because validator validates a single value and should be universal for any use. You should put your logic in model`s validation not field`s. Or you could use a dirty hack which I do not recommend however I've used it by myself: def field1 = models.IntegerField(validators=[validator1])

connect to database from template

2010-08-18 Thread Imad Elharoussi
Hello Can we connect to a database from the template like in php? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Accessing model field validators from within form template

2010-08-18 Thread skyjur
Why do you use MaxLengthValidator instead of max_length property? What are you using those values for? Couldn't it be a possibility to use help_text attribute? On Aug 18, 3:41 pm, omat wrote: > Hi, > > In my generic form template, if a CharField has a max_length > attribute, I

Re: Bind variables in Oracle backend - how to use them?

2010-08-18 Thread buddhasystem
Thank you, however, I am at loss to the syntax of specifying the bind variables for the raw Django query! I've tried everything (like separating the select statement and the "exec" addition with ;) and still get a variety of error messages. Do you know how to write a query with binds that

Accessing model field validators from within form template

2010-08-18 Thread omat
Hi, In my generic form template, if a CharField has a max_length attribute, I display that beside the form field: {% if field.field.max_length %} Max. {{ field.field.max_length }} char. {% endif %} I want to do the same for TextFields, where max_length is not used, but the max limit is set

per-object permission

2010-08-18 Thread andu
Hello! I am developing some web-application. The application is expected to store data which is reported from different location. And the data needs to be accessible to different web administrators (in different location). In this case I want to display reported data to each administrator based

Re: Model Custom Validator between more than one field

2010-08-18 Thread Renne Rocha
Thank you! It helped me. I must define the Model.clean() method.   Renne Rocha   renne.ro...@gmail.com   http://rennerocha.webfactional.com/ On Wed, Aug 18, 2010 at 9:11 AM, Kenneth Gonsalves wrote: > On Wed, 2010-08-18 at 09:02 -0300, Renne Rocha wrote: >> Is it

Re: Can't build Django documentation

2010-08-18 Thread Kevin
Thanks for that info. I downgraded to Sphinx 0.6.6 and all is well. On Aug 14, 11:14 am, Ramiro Morales wrote: > On Sat, Aug 14, 2010 at 9:07 AM, DrBloodmoney wrote: > > > The docs [0] mention an incompatibility with the currently released > > Sphinx.

Re: Model Custom Validator between more than one field

2010-08-18 Thread Kenneth Gonsalves
On Wed, 2010-08-18 at 09:02 -0300, Renne Rocha wrote: > Is it possible to do this? Or the only way to validate the > relationship between two fields is with form validation? > > this may help: http://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddo#id1 -- regards Kenneth

Model Custom Validator between more than one field

2010-08-18 Thread Renne Rocha
Hello all, I have created custom validators to my models fields, but I don't know if it is possible to create a validator for a field that use the value of other field in its validator. What I am trying to do: I have this model: class MyModel(models.Model): field1 =

Re: csv files

2010-08-18 Thread Simon Brunning
On 13 August 2010 17:59:01 UTC+1, Tony wrote: > My script right now basically just reads from a csv file and puts it > into a dictionary for me.  However, when I make my own csv file (just > the same as any I have seen), it acts inconsistently.  For example, > sometimes it

Re: CSRF verification failures (admin)

2010-08-18 Thread Jirka Vejrazka
> I have run into a consistent CSRF error in admin. > It occurs when user tries to change his/her password. > Every single time it returns CSRF error. > My admin templates are not modified. Hi, I'm not sure what your specific problem might be, but I experienced CSRF problem in admin in 2

Re: CSRF verification failures (admin)

2010-08-18 Thread Russell Keith-Magee
On Wed, Aug 18, 2010 at 3:05 PM, Aspontus wrote: > Hi. > I have run into a consistent CSRF error in admin. > It occurs when user tries to change his/her password. > Every single time it returns CSRF error. > My admin templates are not modified. You're going to need to provide

Re: CSRF verification failures (admin)

2010-08-18 Thread Russell Keith-Magee
On Wed, Aug 18, 2010 at 2:32 PM, James Saxon wrote: > I've run into a similar situation where I'm getting CSRF errors > inconsistently.  I made sure I had the token and that I was using > RequestContext.  I haven't found out exactly what's wrong yet... > I have not run into the

Re: CSRF verification failures (admin)

2010-08-18 Thread Russell Keith-Magee
On Wed, Aug 18, 2010 at 2:20 PM, PieterB wrote: > No I did not. > I've only a modified (created) admin.py for each app in the project. > > Maybe this is also important: we use a proxy, maybe it's something > with the cache? > What can cause csrf verification to go crazy?

Re: CSRF verification failures (admin)

2010-08-18 Thread Russell Keith-Magee
On Wed, Aug 18, 2010 at 3:22 PM, PieterB wrote: > Can it be disabled globally? If you have a Django 1.1 project that you have upgraded to 1.2, then CSRF protection will *not* be enabled by default. In order to enable it, you need to follow the migration instructions in

Re: phonebook

2010-08-18 Thread Kenneth Gonsalves
On Tue, 2010-08-17 at 22:17 -0700, samir wrote: > i wanna write phonebook with django . > i wrote some thing but i have problem with views.py . please post the code that is giving you problems, also the full error message if any. -- regards Kenneth Gonsalves -- You received this message

Re: duplicate post_save signals

2010-08-18 Thread Kenneth Gonsalves
On Wed, 2010-08-18 at 12:00 +0100, David De La Harpe Golden wrote: > > I am using a two post_save signal handlers for two different models. > On > > certain conditions they have to send emails to me and others. At > times > > one signal is generated, at other times two or even in one instance > 4

Re: Best practice for maintaining the "Django stack"

2010-08-18 Thread Hanne Moa
If you put something in INSTALLED_APPS, it *is* imported, and when you test everything it is also tested. HM -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe

Re: duplicate post_save signals

2010-08-18 Thread David De La Harpe Golden
On 18/08/10 07:48, Kenneth Gonsalves wrote: > hi, > > I am using a two post_save signal handlers for two different models. On > certain conditions they have to send emails to me and others. At times > one signal is generated, at other times two or even in one instance 4 > signals were generated,

Re: CSRF verification failures (admin)

2010-08-18 Thread Aspontus
Hi. I have run into a consistent CSRF error in admin. It occurs when user tries to change his/her password. Every single time it returns CSRF error. My admin templates are not modified. Best regards On 18 Sie, 08:32, James Saxon wrote: > I've run into a similar situation where

phonebook

2010-08-18 Thread samir
hi i wanna write phonebook with django . i wrote some thing but i have problem with views.py . can you intreduce sample of phonebook project to me ? tanx -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: VersionConflict with pip but django updated

2010-08-18 Thread Alexandre González
I solved it with: sudo aptitude install python2.6-dev libxml2-dev libxslt-dev sudo pip install *--upgrade* django-easymode Thanks anyway! 2010/8/17 Alexandre González > Hi! > > I'm trying to install django-easymode, I get a version conflict, so I > remove my django from

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Emily Rodgers
Hi, I still don't really understand what you are trying to do, but it sounds like Mathieu does and has offered you some pretty useful advice. If his link below helps you fix what you are trying to do, please let us know what you did (this is really useful for others with the same problem), and

Re: updating the template with objects sent by a server

2010-08-18 Thread bruno desthuilliers
On 18 août, 10:59, Imad Elharoussi wrote: > Hello > > In my view.py I connect to a server and get an object and in my templates I > display this object in a treeview form > > But I have to get all the time the modifications on that object from the > server and show the

Re: Any job queue systems that integrates with Django & allow scheduling jobs by date?

2010-08-18 Thread tsmets
Andy, I think you need to look at http://code.google.com/p/django-command-extensions/ I have never used the create_jobs but I use extensievely the scripting possibility for my developpment & to prepare the json files for my unit testing... Rgds, \T, On Aug 18, 2:10 am, Andy

updating the template with objects sent by a server

2010-08-18 Thread Imad Elharoussi
Hello In my view.py I connect to a server and get an object and in my templates I display this object in a treeview form But I have to get all the time the modifications on that object from the server and show the modifications on the template Please do you have an idea how to do that? thank

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Mathieu Leduc-Hamel
Richard, it's not the good way to do this, in the settings.py cause as i said before, the code in the settings.py is executed every time somebody initiate a session for the first time. The point there is a way to have a part of code common to all currently connected user. Tang, I'm not an

Re: duplicate post_save signals

2010-08-18 Thread Kenneth Gonsalves
On Wed, 2010-08-18 at 17:16 +1000, Sam Lai wrote: > I was looking at this over the weekend as well; isn't a problem for me > but it seems that the post_save signal is triggered even when > commit=False. Therefore when the object is saved again with > commit=True, it is fired again. > > I didn't

Re: geodjango: windows installer for geos dependency?

2010-08-18 Thread Reinout van Rees
On 08/18/2010 08:16 AM, Sam Lai wrote: Quick Google tells me that PostGIS contains GEOS 3.2.0. I know you're not using PostgreSQL, but installing that might do the trick, or if you don't want to pollute your server, you can probably extract it from the setup somehow.

Re: CSRF verification failures (admin)

2010-08-18 Thread PieterB
Can it be disabled globally? I tried some middleware code I found on the web, but I get ImproperlyConfigured: CsrfMiddleware isn't a middleware module (but this is probably me doing something wrong?) http://johnmc.co/llum/disable-csrf-protection-for-django-1-2/

Re: duplicate post_save signals

2010-08-18 Thread Sam Lai
I was looking at this over the weekend as well; isn't a problem for me but it seems that the post_save signal is triggered even when commit=False. Therefore when the object is saved again with commit=True, it is fired again. I didn't really investigate this so I could be wrong, but might be

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Richard Colley
Why not call your "boot" code from settings.py? On Aug 18, 4:05 pm, Tang Daogang wrote: > hi, Emily, > > Let me introduce Scala/Lift as example. > > Every lift project has a file named 'Boot.scala', this file will only > be executed once when this project boots up. In this

duplicate post_save signals

2010-08-18 Thread Kenneth Gonsalves
hi, I am using a two post_save signal handlers for two different models. On certain conditions they have to send emails to me and others. At times one signal is generated, at other times two or even in one instance 4 signals were generated, which results in duplicate and triplicate emails. Has

Re: CSRF verification failures (admin)

2010-08-18 Thread James Saxon
I've run into a similar situation where I'm getting CSRF errors inconsistently. I made sure I had the token and that I was using RequestContext. I haven't found out exactly what's wrong yet... I have not run into the situation in the admin but I have not tried it much but I haven't changed any

Re: CSRF verification failures (admin)

2010-08-18 Thread PieterB
No I did not. I've only a modified (created) admin.py for each app in the project. Maybe this is also important: we use a proxy, maybe it's something with the cache? What can cause csrf verification to go crazy? On 17 aug, 15:58, Alex Robbins wrote: > Have you

Re: geodjango: windows installer for geos dependency?

2010-08-18 Thread Sam Lai
Quick Google tells me that PostGIS contains GEOS 3.2.0. I know you're not using PostgreSQL, but installing that might do the trick, or if you don't want to pollute your server, you can probably extract it from the setup somehow. http://postgis.refractions.net/download/windows/#windbinaries On 18

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Kenneth Gonsalves
On Tue, 2010-08-17 at 23:05 -0700, Tang Daogang wrote: > Emm, that's it. I want to find one file acting like Boot.scala of Lift > within Django, but failed. If there is one file like that, I will put > my plugins registering codes into it, thus, when I type "python > manage.py runserver", it can

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
hi, Emily, Let me introduce Scala/Lift as example. Every lift project has a file named 'Boot.scala', this file will only be executed once when this project boots up. In this file, we can write some initial codes to initial project and some userdefined structures. Emm, that's it. I want to find

Re: How to execute some user defined codes (functions) when Django boot?

2010-08-18 Thread Tang Daogang
Mathieu, What you said prompt me some idea: If I write my plugin registering codes into a middleware, and load it in django's settings.py, will it executed when app boot up? On 8月17日, 下午11时51分, Mathieu Leduc-Hamel wrote: > Paul, no it's not exactly the point. When you said

Re: Migration: AlreadyRegistered

2010-08-18 Thread Sam Lai
This error looks like an import error in disguise. ( http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/utils/importlib.py ) Fire up the python interpreter shell, and trying importing the django.contrib.admin module manually and see if you get any errors. Django seems to be