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 <[email protected]> > 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 Rodgers <[email protected]> > wrote: > > 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 if not, please come back and ask again. > > > > Em > > > > On Aug 18, 7:05 am, Tang Daogang <[email protected]> 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 initial project and some userdefined > > > structures. > > > > > 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 be executed automatically and only once. > > > By it, my plugins can be registered when app boot up. > > > > > Do you understand my meaning? Welcome suggestion. > > > > > On 8月17日, 下午8时45分, Emily Rodgers <[email protected]> wrote: > > > > > > On Aug 17, 2:26 am, Tang Daogang <[email protected]> wrote: > > > > > > > Dear all, > > > > > > > Recently, I have developed a plugin system for my app, and I want > to > > > > > register those plugins when my app boot up, this need to execute > some > > > > > user defined codes (functions) in app boot procedure, I don't know > > > > > where insert my registering codes to, anyone can help? > > > > > > > Thank you. > > > > > > Hi, > > > > > > I don't know how to help you, but I think it is because you haven't > > > > explained what you want to do thoroughly enough. > > > > > > What do you mean by a plugin system, and what do you mean by > > > > registering them with the app on boot up? Are you talking about > > > > including another python module in your code? Or perhaps including > > > > another django app in your code? > > > > > > Can you give us a bit more information (and maybe examples) of what > > > > you are trying to do. > > > > > > Cheers, > > > > Em > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<django-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

