That is weird.  I don't know why 2 shouldn't satisfy a need for 2.

As far as a work around goes, one doesn't need to use url() to make a url
pattern.
Just a tuple with those two members will do it.  I think of url() as a way
to
specify a pattern name without specifying the extra dict.

Unless things have changed.

But I think that your call to patterns() is wrong.  The patterns are
additional
arguments, not a list of patterns, at least as normally used.  So:

    urlpatterns = patterns("", *url_list)

On Fri, Mar 8, 2013 at 2:03 PM, Serge G. Spaolonzi <se...@cobalys.com>wrote:

> I am looking the way to create urls on the fly.
> This is a simplified version of the code I am using:
>
> def get_urls():
>     url_list = []
>     for code in external_code_list:
>         url_list.append(
>             url(r'^%s/$' % code,
>             view
>             )
>         )
>     urlpatterns = patterns('', url_list)
>     return urlpatterns
>
>
> urlpatterns = get_urls()
>
> It throws "url() takes at least 2 arguments (2 given)"
>
> Any idea?
>
> Thanks
>
> --
> Serge G. Spaolonzi
> Cobalys Systems
> http://www.cobalys.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to