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
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
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
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
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
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.
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
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
>
> 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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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.
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
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
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
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
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
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 %}
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
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
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
36 matches
Mail list logo