Re: template url reverse and namespacing is driving me crazy

2014-12-01 Thread Ionel Cristian Mărieș
Tim, this is not about documentation. It's a question of whose responsibility this (setting the current_app) is. The reusable app code (where one would set the current_app) is out of pjotr's control, unless he forks it and makes a fix. Making a fix is not that bad but the problem is that very

Re: template url reverse and namespacing is driving me crazy

2014-12-01 Thread Tim Graham
I don't disagree this is a common source of confusion and the documented solution seems cumbersome. In fact, I found a ticket about it: https://code.djangoproject.com/ticket/22203 We should move any discussion about solving the problem to django-developers instead of django-users though. Than

Re: template url reverse and namespacing is driving me crazy

2014-12-01 Thread Ionel Cristian Mărieș
This, this is not about improving the documentation. It's pretty clear how to solve the problem. The issue here is whom should have the responsibility of setting the correct current_app in the template context. One can always fix 3rd party apps but it gets old after a while. I for one can't nam

Re: template url reverse and namespacing is driving me crazy

2014-12-01 Thread Tim Graham
Did you read about passing 'current_app' to your template rendering calls? https://docs.djangoproject.com/en/1.7/topics/http/urls/#id4 The contrib.admin class has app_name='admin' and namespace='admin' by default, but you can create a custom AdminSite(name='foo') to customize the instance names

Re: template url reverse and namespacing is driving me crazy

2014-12-01 Thread pjotr
That is not the point. I know I can do that, but that doesn't solve the issue of an reusable app. I could fork the 'greeter' project, add my namespace in the templates, and it would be all working. But still that is not the point. The point is: how can I write a reusable app so that someone els

Re: template url reverse and namespacing is driving me crazy

2014-11-30 Thread Kelvin Wong
Change all instances of this in your templates {% url 'greet' greeter.pk %} To this {% url 'greeter:greet' greeter.pk %}. Since you are now using the 'greeter' namespace. Also, the other one is {% url 'greeter:list' %} and not {% url 'list' %} because you are using the 'greeter' namespace.

template url reverse and namespacing is driving me crazy

2014-11-30 Thread pjotr
Alright, I'm already crazy, so the subject is a bit of a lie. But nevermind. I think I like namespacing, it is really nice. But there is something not that clear in the documentation of Django, and how to make usage of namespace, in a consistent way. Lets take it by example. I'm using this pret

Re: Virtualenv changes url reverse behaviour

2012-09-08 Thread Javier Guerra Giraldez
On Sat, Sep 8, 2012 at 5:06 AM, William Hart wrote: > Hey Ramiro, thanks for the reply... yes you are correct I haven't mentioned > the version of Django I have installed. I've experienced this on both 1.4.1 > and 1.5dev. I think I mentioned in the comments on SO that I've installed > and uninst

Re: Virtualenv changes url reverse behaviour

2012-09-08 Thread William Hart
> > You've posted five time on StackOverflow and four times on this thread > and haven't provided that rather basic piece of information. > Hey Ramiro, thanks for the reply... yes you are correct I haven't mentioned the version of Django I have installed. I've experienced this on both 1.4.1

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Aaron C. de Bruyn
On Fri, Sep 7, 2012 at 12:36 PM, William Hart wrote: > And used in templates like so: > {% url 'dashboard' %} If you want to use quotes, put: {% load url from future %} at the top of your template. Newer versions of Djagno WILL eventually require quotes, and using the 'load url from future' line

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Ramiro Morales
On Fri, Sep 7, 2012 at 9:21 PM, William Hart wrote: > Hi, > Yes as per my first and second replies and the SO link I have done it with > and without quotes. > > To be clear - this is not a 'fix my code' question as I had already found > the workaround before posting, the question is more whether i

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread William Hart
Hi, Yes as per my first and second replies and the SO link I have done it with and without quotes. To be clear - this is not a 'fix my code' question as I had already found the workaround before posting, the question is more whether it is expected behaviour for the {% url %} tag to act differ

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Bill Freeman
Have you tried it without the quotes? None of the examples in the docs (https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#url) use quotes. (Which, in turn, probably means that you can't use a variable there.) On Fri, Sep 7, 2012 at 7:46 PM, William Hart wrote: > Hi, > Thanks for the

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread William Hart
Hi, Thanks for the reply. Yes I'm fairly certain their are no absolute paths - the settings paths are all built up using os.path, and there are no paths elsewhere in the document. Basically as far as I can tell what is happening is that the url name for {% url 'dashboard' %} is interprete

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Bill Freeman
Are you certain that you don't have an absolute path lurking somewhere in your code? On Fri, Sep 7, 2012 at 3:36 PM, William Hart wrote: > Hi all, > I've made a post on stack overflow, but I'm not sure if this is some kind of > weird bug or just something silly I'm doing. (see > http://stackover

Virtualenv changes url reverse behaviour

2012-09-07 Thread William Hart
Hi all, I've made a post on stack overflow, but I'm not sure if this is some kind of weird bug or just something silly I'm doing. (see http://stackoverflow.com/questions/12310608/running-virtualenv-on-django-app-kills-my-urls). Basically I have an existing app with working urls set up like

Re: URL reverse on username failing when username has a '.' literal in it

2010-07-23 Thread Alex Robbins
That probably means that the regex url pattern you defined for feed_user in your urls.py file doesn't allow '.' Hope that helps, Alex On Jul 22, 11:11 am, Roboto wrote: > I didn't expect this to occur, but when I attempt > {% url feed_user entry.username %} > > I will get a 500 error when the us

URL reverse on username failing when username has a '.' literal in it

2010-07-22 Thread Roboto
I didn't expect this to occur, but when I attempt {% url feed_user entry.username %} I will get a 500 error when the username contains a '.' In this case rob.e as a username will fail. Any ideas how to deal with this? -- You received this message because you are subscribed to the Google Groups

multisite url reverse using subdomains

2010-04-06 Thread Matías Iturburu
I have a similar question than [django cross-site reverse][1]. But i think I can't apply the same solution. I'm creating an app that lets the users create their own site. After completing the signup form the user should be redirected to his site's new post form. Something along this lines:

Re: URL reverse failed for urlencoded string

2010-02-03 Thread akaariai
On Feb 2, 7:56 pm, timc3 wrote: > Well the space was still an issue it seems. > > I have the following urlconf: > > url(r'^group_view/(?P[-\w\s]+)/$', 'mysite.views.vs_group_view', > name="group_view"), > > Which matches the whitespace but

Re: URL reverse failed for urlencoded string

2010-02-03 Thread Daniel Roseman
On Feb 2, 5:56 pm, timc3 wrote: > Well the space was still an issue it seems. > > I have the following urlconf: > > url(r'^group_view/(?P[-\w\s]+)/$', 'mysite.views.vs_group_view', > name="group_view"), > > Which matches the whitespace but

Re: URL reverse failed for urlencoded string

2010-02-03 Thread timc3
Then it doesn't match the plus sign. I guess I need to put something in my regex to match that as well? -- 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

Re: URL reverse failed for urlencoded string

2010-02-02 Thread Karen Tracey
On Tue, Feb 2, 2010 at 12:13 PM, timc3 wrote: > I am working with an external REST Provider whose GUIDs might have > spaces, plus signs and a few other characters in (I can't change > this). > > In my template I use the following, which normally works except when > their are encoded characters in

Re: URL reverse failed for urlencoded string

2010-02-02 Thread timc3
Well the space was still an issue it seems. I have the following urlconf: url(r'^group_view/(?P[-\w\s]+)/$', 'mysite.views.vs_group_view', name="group_view"), Which matches the whitespace but my URL reverse match still breaks. Any ideas? -- You receive

Re: URL reverse failed for urlencoded string

2010-02-02 Thread timc3
To answer my own question I think this has more to do with matching a URL that has a string in it to my urls.py. So this should really be about creating the correct entry in my urls to match spaces.. -- You received this message because you are subscribed to the Google Groups "Django users" gro

URL reverse failed for urlencoded string

2010-02-02 Thread timc3
ncode %} Which raises a TemplateSyntaxError: NoReverseMatch: Reverse for 'group_view' with arguments '(u'My %20ParentGroup',)' and keyword arguments '{}' not found. The url reverse works properly when I don't have the spaces and I can't use slug

django.views.generic.list_detail.object_list and coltrane url reverse lookups

2009-07-30 Thread andreas schmid
hi to all, im going through the practical django projects and i arrived at the part where im setting up generic views for the object listing of the categories. my problem now is that i have the navigation in the base.html which creates (or should) the url with Categories my urls.categories.

Re: Tricky URL / Reverse Regex

2009-06-06 Thread bimsland
That's most likely what I'm going to do, but from a purely academic perspective (and because I love using regex to shorten things) I was hoping someone might have an idea on how to accomplish what I'm going for without splitting things up. ;) On Jun 6, 6:42 pm, Alex Gaynor wrote: > On Sat, Jun 6

Re: Tricky URL / Reverse Regex

2009-06-06 Thread Alex Gaynor
On Sat, Jun 6, 2009 at 9:39 PM, bimsland wrote: > > Working on making some URLs on a project of mine ReSTful, and decided > to go with the filename extensions route for specifying content-type. > > I've got a view named concerts, and to keep backwards compatibility, I > need to make sure the old

Tricky URL / Reverse Regex

2009-06-06 Thread bimsland
Working on making some URLs on a project of mine ReSTful, and decided to go with the filename extensions route for specifying content-type. I've got a view named concerts, and to keep backwards compatibility, I need to make sure the old URLs still work. I need the urlpattern to match... ^/conce

Django internal tests and url reverse lookup

2009-01-07 Thread aeby
Hi all, If I run manage.py test form my project, Django internal test are executed as well. If such a internal test uses a RequestContext, all template context processors defined in settings.TEMPLATE_CONTEXT_PROCESSORS are loaded by django.template.context.get_standard_processors(). If one of th

Re: url (reverse) as a filter

2008-07-15 Thread Julien Phalip
I guess you would have to preprocess the text with the template system, reversing all the URLs, and then pass it to markdown processing. So, you'd have: ({% url mylink %} "Check this link") On Jul 16, 3:11 am, gzy <[EMAIL PROTECTED]> wrote: > Hi, > > I like the idea of seperating the.. "address

url (reverse) as a filter

2008-07-15 Thread gzy
Hi, I like the idea of seperating the.. "address space" of a website from the templates. On the other hand I'm keeping most of the content in the db and displaying through the markup filter. So I'm looking for a way to feed the url_bit in markdown's [link] (url_bit "Title") to Django's {% url %}

Re: URL reverse

2007-07-23 Thread Chris Hoeppner
John Shaffer escribió: > Why not use the URL's name? > > {% url anuncios-entry-detail category=entry.category.slug,entry=entry.id %} > > --~--~-~--~~~---~--~~ > You received this message because you are subscribed to the Google Groups > "Django users" group. > To

Re: URL reverse

2007-07-23 Thread John Shaffer
Why not use the URL's name? {% url anuncios-entry-detail category=entry.category.slug,entry=entry.id %} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

URL reverse

2007-07-23 Thread Chris Hoeppner
Hi there! I just don't get the url template tag to work. After reading the docs 5 times and trying every possible name-param combination, I'm about to start hardcoding all my urls. A line of my url.py looks like this: url(r'^categoria/(?P[-\w]+)/(?P[0-9]+)/$', 'view_entry', name="anuncios-entry-d