Friday, October 7, 2011

Re: How to make Django pick new urls immediately

On Friday, 7 October 2011 09:20:03 UTC+1, Kayode Odeyemi wrote:
2011/10/6 Yaşar Arabacı <yasar...@gmail.com>
maybe you should restart the server? And, do you include new urls in your root url config?

OK! I just found out that if you have urls.py in different packages and these urls.py files are all included in the root package urls.py file of the app, if I have a url (say /post) defined within a python module in the package app.api, I will have to access the url like this http://example.com/api/post and not http://example/post. I was attempting the later which is the reason for the 404.

Regards
--
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde


No, that's not true. The name of the app has nothing to do with it. Rather, it's the name you give when you include the app's URLs:

    (r'^randomname/', include('api.urls'))

That will include the 'api' app's URLs with the prefix 'randomname', so you would do example.com/randomname/post/.
--
DR.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/KLN1lwfX_eIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment