4

I have an application which is centered around rooms. These rooms have members who can post content in them. The way I thought of having the url patterns would be something like this

# global urls.py
    (r'^g/', include('elearning.apps.rooms.urls', namespace='rooms')),

# rooms urls.py
    url(r'^(?P<room_slug>[-\w]+)/postari/',
        include('elearning.apps.posts.urls', namespace='posts')),

# posts urls.py
    url(r'^adauga/$', 'add', name='add'),

My issue is that I don't know how I can reverse the URL of a view from the 'posts' app. Doing

reverse('rooms:posts:add', kwargs={'room_slug': room.slug})

raises a NoReverseMatch error, probably because 'room_slug' is matched agains the 'add' view's URL pattern.

How can I do this?

Thanks

1 Answer 1

1

Looks like this has been fixed recently. https://code.djangoproject.com/changeset/16608

Sign up to request clarification or add additional context in comments.

3 Comments

If I may ask, what does the fix do? I myself am interested the answer to your original question, and I can't figure it out (not for lack of trying)...
Sorry, I don't understand your question. The fix I mentioned allows the functionality I asked about in my original question.
I was just curious how the Django developers defined the problem you were having, is all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.