Re: Django url pass through

2014-09-23 Thread Collin Anderson
It depends on what is defined in your waitlist.urls.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6c007c6f-3d4c-43cd-bd74-bae8cdf114b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django url pass through

2014-09-23 Thread robert brook
Thank you your response answers the "what do I do" as a response by calling 
the 404 view.

I also need to understand how the url will be coded so that an  invalid url 
that does not match anything falls through the the last url in the urls.py 
file.

I have a project urls.py file and expect that anything that does not match 
waitlist will fall through to the 2nd url.

url(r'^waitlist/', include('waitlist.urls')),
 url(r'^.*$', views.404_view),


If the project matches the value waitlist, the router will pull in the urls 
from the app.
Same question as above   

The url   my_domain.com/waitlist/   

will pull in the index view as expected

Will  the url   my_domain.com/waitlist/abc4#jjj/
pull in the 404_view and be handled graceffully?   

 url(r'^$', views.index, name='index'),
 url(r'^.*$', views.404_view),

Thanks  again



On Monday, September 22, 2014 10:25:11 PM UTC-4, robert brook wrote:
>
> How is a url conf written so that if none of the useful urls are matched 
> it will pass through to some sort of wild card regular expressions so that 
> the view / redirection can be performed gracefully
>
> Thanks
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/acbd5b3d-0aa8-4510-890c-0f6277345264%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django url pass through

2014-09-23 Thread Daniel Rus Morales
Hi Robert,

In those cases a HTTP 404 is the right response, to help Search Engines realise 
that such a URL doesn’t exist and to show users a "Page Not Found" message. To 
create a nice looking 404 response for users just write a view to handle it and 
add the “handler404” entry to your root URLConf module (the one near the 
settings.py module).

Adding something like this to urls.py:

handler404 = ‘views.http404_handler’

And creating that view in the corresponding views.py module:

from django.http import HttpResponseNotFound
from django.template import loader, RequestContext

def http404_handler(request):
t = loader.get_template("404.html")
return HttpResponseNotFound(
t.render(RequestContext(request, {'request_path': request.path})))

Also create the template 404.html in your templates directory.

Read more on the topic here: 
https://docs.djangoproject.com/en/1.7/ref/views/#the-404-page-not-found-view

Good luck,
Daniel


On 23 Sep 2014, at 04:25, robert brook  wrote:

> How is a url conf written so that if none of the useful urls are matched it 
> will pass through to some sort of wild card regular expressions so that the 
> view / redirection can be performed gracefully
> 
> Thanks
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/f981954c-679a-4000-9e4c-11d3e6ee3e09%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Django url pass through

2014-09-22 Thread robert brook
How is a url conf written so that if none of the useful urls are matched it 
will pass through to some sort of wild card regular expressions so that the 
view / redirection can be performed gracefully

Thanks

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f981954c-679a-4000-9e4c-11d3e6ee3e09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.