Re: What is an "application instance"
Thanks Tom. So I have now read about AdminSite.
It seems like they have encapsulated an application into a class. It
is the first time I see this. And to use the application, one must
instantiate the class. To have several instances, you just instantiate
several. That seems kind of straight forward.
But it leaves me with more questions.
1) Is there a recipe for encapsulating an application as a class? I
can see that the AdminSite has no super class. And I did not find much
with googling.
2) All the Django documentation, that I have read has only dealt with
building applications like folders with a few files: models.py,
views.py and urls.py. That is what happens, when one writes 'admin.py
startapp foo'. Is it possible to make several instances of such an
application?
Thomas
On Jul 8, 12:02 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Fri, Jul 8, 2011 at 10:45 AM, Thomas Larsen Wessel <mrve...@gmail.com> wrote:
>
> > I'm reading the URL Dispatcher documentation, at
> >https://docs.djangoproject.com/en/dev/topics/http/urls/.
>
> > It mentions "application instance" several times. I do not know / understand
> > what an application instance is.
>
> > Could somebody please explain this, preferably with an example which
> > demonstrates having several instances of an application.
>
> > Thanks
>
> Eg, having two instances of the admin app:
>
> https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#multiple-adm...
>
> Cheers
>
> Tom
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home