Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » how should reusable apps handle url namespace? [RSS Feed]

#1 June 4, 2010 05:06:36

HARRY P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

how should reusable apps handle url namespace?


I'm writing a forum app that I want to be reusable. All of my urls I
have named. Some of them are named like "index" and "thread" which are
generic and will likely collide with existing project's urls. I don't
want to do something like name all my urls "forum_index" and
"forum_thread" either.

I think the best way is to use the new namespace feature, but I'm not
quite sure how to do it for reusuable apps. The docs make it seem like
the only purpose of namespace urls is when you have two or more
instances of an app.

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 June 4, 2010 09:10:48

Daniel R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

how should reusable apps handle url namespace?


On Jun 4, 5:06 am, HARRY POTTRER <cp368...@ohio.edu> wrote:
> I'm writing a forum app that I want to be reusable. All of my urls I
> have named. Some of them are named like "index" and "thread" which are
> generic and will likely collide with existing project's urls. I don't
> want to do something like name all my urls "forum_index" and
> "forum_thread" either.
>
> I think the best way is to use the new namespace feature, but I'm not
> quite sure how to do it for reusuable apps. The docs make it seem like
> the only purpose of namespace urls is when you have two or more
> instances of an app.

You don't need to do anything with it. You don't define the namespace
in the application's urlconf, the end developer does it when they
include your application's urlconf in their project-level one. See the
docs on defining namespaces:http://docs.djangoproject.com/en/1.2/topics/http/urls/#defining-url-namespaces--
DR.

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 June 12, 2010 08:52:10

HARRY P.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

how should reusable apps handle url namespace?


On Jun 4, 4:10 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Jun 4, 5:06 am, HARRY POTTRER <cp368...@ohio.edu> wrote:
>
> > I'm writing a forum app that I want to be reusable. All of my urls I
> > have named. Some of them are named like "index" and "thread" which are
> > generic and will likely collide with existing project's urls. I don't
> > want to do something like name all my urls "forum_index" and
> > "forum_thread" either.
>
> > I think the best way is to use the newnamespacefeature, but I'm not
> > quite sure how to do it for reusuable apps. The docs make it seem like
> > the only purpose ofnamespaceurls is when you have two or more
> > instances of an app.
>
> You don't need to do anything with it. You don't define thenamespace
> in the application's urlconf, the end developer does it when they
> include your application's urlconf in their project-level one. See the
> docs on defining
> namespaces:http://docs.djangoproject.com/en/1.2/topics/http/urls/#defining-url-n...
> --
> DR.

but how do I handle get_absolute_url? I don't see how I'm supposed to
resolve any urls if I don't supply it with a namespace...

--
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
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 June 12, 2010 09:13:35

Alexander J.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

how should reusable apps handle url namespace?


independed urls.py file

On Sat, Jun 12, 2010 at 10:45 AM, HARRY POTTRER <cp368...@ohio.edu> wrote:

> On Jun 4, 4:10 am, Daniel Roseman <dan...@roseman.org.uk> wrote:
> > On Jun 4, 5:06 am, HARRY POTTRER <cp368...@ohio.edu> wrote:
> >
> > > I'm writing a forum app that I want to be reusable. All of my urls I
> > > have named. Some of them are named like "index" and "thread" which are
> > > generic and will likely collide with existing project's urls. I don't
> > > want to do something like name all my urls "forum_index" and
> > > "forum_thread" either.
> >
> > > I think the best way is to use the newnamespacefeature, but I'm not
> > > quite sure how to do it for reusuable apps. The docs make it seem like
> > > the only purpose ofnamespaceurls is when you have two or more
> > > instances of an app.
> >
> > You don't need to do anything with it. You don't define thenamespace
> > in the application's urlconf, the end developer does it when they
> > include your application's urlconf in their project-level one. See the
> > docs on defining namespaces:
>http://docs.djangoproject.com/en/1.2/topics/http/urls/#defining-url-n...
> > --
> > DR.
>
> but how do I handle get_absolute_url? I don't see how I'm supposed to
> resolve any urls if I don't supply it with a namespace...
>
> --
> 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
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> 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 django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » how should reusable apps handle url namespace? [RSS Feed]

Board footer

Moderator control

Enjoy the 15th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support