Get url configuration in django 404 pages when Mezzanine is installed - django

I'm working with mezzanine for a django project, and I can't figure out how to turn back on the DEBUG=True url configuration output that django usually produces on 404 pages.
With mezzanine installed, even with DEBUG=True, all I ever get is a blank 404 page.
Steps tried without success:
Googling around for "mezzanine 404 url" and various implementations
Skimming Mezzanine documentation
Disabling the custom mezzanine 404 handler
Any ideas on how to get the standard django url report back?
Thanks

Mezzanine contains a "catch all" urlpattern for pages. That is, the pattern for Mezzanine pages could be anything - example.com/foo, example.com/foo/bar, etc. So what you get is a standard 404 error.
What you're looking for is the error that occurs when no urlpattern matches the url requested. This can't actually occur with Mezzanine, since its patterns can match any url.

Related

How do I make a 404 error route to a Wagtail page?

When a 404 error is thrown in a project that uses Wagtail, I'd like to have the site redirect to a page in the CMS. How do I do this?
I know Wagtail has a redirects feature, but that doesn't seem to do what I want; if I were to use that I'd need to have some kind of wildcard selector that would be superseded by more specific redirects.
I searched around the issues but this was as close as I found. But that seems to be more related to admin 404s if I'm reading it right.

Django Custom Error Handlers in Apache and mod_wsgi

I have custom 404 and 500 error handlers setup in django and they work in development, but with Apache they just show the default apache Internal Server Error page, even for 404 errors.
Here is my urls.py:
handler400 = 'views.error400'
handler403 = 'views.error403'
handler404 = 'views.error404'
handler500 = 'views.error500'
I've read of many ways to set up custom error pages in apache, but all of the approaches I tried with django did not work. What is the correct way to set this up for Apache/mod_wsgi and Django?
Do I remove those lines from my urls.py and add some lines to my apache.conf?
What lines should be added to apache.conf as I'm not sure how to access views from the apache configuration file and the normal urls.py routing for Django is not working for the custom error pages since as I suspect Apache is intercepting the requests and providing it's own pages.
I just want to use my templates for my custom error pages (which include inheriting from a base template).
How can I achieve this, I can't find a decent answer anywhere?
Thanks
EDIT:
I tried editting the Apache config to add ErrorDocument 500 /templates/500.html and such but it did not work.
I currently have the error page in my templates directory, they each inherit from a base template. Also, they each have their own view to handle the responses.
But no matter what I do, removing those lines from urls.py, adding stuff to apache config, etc. I can't get anything but the typical Internal Server Error apache page to display on any error, even one's that aren't 500 errors.
What can I do to get this working? Worked fine on the django development server, but as soon as apache was thrown into the mix I can't get it to work using either apache or django, I must be missing something but what?
You can remove those lines from urls.py. Django will look up to your templates to get those.
Just put 404.html and 500.html files into your_app/templates/ directory.

Django-planet shows empty page, while the admin show data that supposed to be displayed

I'm playing with django-planet with Django 1.6, and after some (minor) adaptions. I uploaded some feeds (and I can see them in Django-admin) and mounted them in url.py like this:
url(r'^feeds/', include('planet.urls'))
but when I navigate to feeds/ or any other url specified in django-planet urls.py :
some examples:
url(r'^blogs/$', "blogs_list", name="planet_blog_list"),
url(r'^feeds/$', "feeds_list", name="planet_feed_list"),
I get a blank and empty page. not an error page. but a blank page. when I look at the request I see the django server returning a 200 status. where are django-planet default pages? When I look at django-planet code the views seem to exists..and else I would get an error page
urls.py doesn't look broken to me, since when I navigate to non existent urls in feeds/ or otherwise I do get the expected error page.
I have 2 suspicions:
django-planet not finding the templates. when I look at the lib structure it seems that views.py is naming views that sit in planet subfolder, but actually planet subfolder is under templates folder.
some missing django-planet and undocumented config in my settings.py
how can I solve this?
What am I missing? I'll be glad for help with this
I even downgraded to Django 1.5 but it didn't solve the problem

django cms static media files cannot be found (404)

I'm new to django cms and I'm really lucky that I was able to install it. If I go to the backend of my site (http://localhost:8000/admin), then the django cms admin panel shows up.
If I want to edit some cms pages then I can see that the browser tries to get some files like "/static_media/cms/jquery.dialog.css", "/static_media/cms/pages.css", "/static_media/cms/ui.core.js" and so on...
Unfortunately the browser only gets a HTTP 404 response and I do not know what I have to configure in "settings.py" or "url.py" to get things working. Can anybody help me?
Found the solution at http://djangosnippets.org/snippets/2401/

Django, from php to Django

I have a website done with Django, that was previously done with PHP and CodeIgniter. I've moved the website to Webfaction, changed the DNS and all other configurations, but now my email is full of errors like this:
Error (EXTERNAL IP): /index.php/main/leer/7497
I don't know why the Django app is looking for pages from the PHP app, specially since the PHP app was in another host.
Are those URLs from your old site? That's probably a case of people having stale bookmarks, trying to navigate to them, and getting 404s. You might want to consider catching those, and redirecting to the new URL with response code 302.
I can't imagine those errors are caused by Django (except in the sense that the reports are from Django reporting 404s, which it does for free).
I agree with above. Just want to add you should use django.contrib.redirects to move the redirects.
You can read more about it here