Tagged Questions
0
votes
1answer
28 views
Django 404 error-page not found
My project is named homefood, and when I runserver I get this error.Anybody have any clue how to fix this error.
Page not found (404)
Request Method: GET
Request URL: http://127.0.0.1:8000/
...
1
vote
1answer
27 views
Django page not found - general
What is the difference between Django's two options:
return HttpRequestNotFound()
raise Http404
?
0
votes
2answers
96 views
Error with new file, 404 Not Found, App Engine for Python
I have a website running on Google App Engine for Python. I've inherited the code-base and am trying to piece things together myself. I'm trying to accomplish the "simple" task of creating a new page ...
0
votes
1answer
119 views
urllib2 error 'Not found on Accelerator'
I have a python program that periodically checks the weather from weather.yahooapis.com, but it always throws the error: urllib.HTTPError: HTTP Error 404: Not Found on Accelerator. I have tried on two ...
1
vote
1answer
59 views
Django urls.py gives a 404 error while trying to access a URL
I'm trying to create a Django app that uses these two urls, browse and account but I am getting an error when I try to access either of these two.
Using the URLconf defined in mediasite.urls, Django ...
0
votes
1answer
89 views
Pop-ups in django-tinymce editor showing 404 error
What is wrong:
I have installed django-tinymce to work with text fields in the admin section of my site. The editor works good, though not as expected, because whenever I try to insert an image, ...
0
votes
2answers
230 views
Integrating CSS and CherryPy: How to fix the 404 “/” Not Found Error?
I've been working on testing Twitter Bootstrap with CherryPy 3.2.2, and have reviewed several of the SO posts, but have been unable to successfully get Cherry to run with my configuration files. I'm ...
0
votes
3answers
794 views
Django 1.5 GET 404 on static files
I need a little help with this, I've been searching for a solution with no results.
This are my settings:
settings.py:
STATIC_ROOT = ''
# URL prefix for static files.
# Example: ...
2
votes
1answer
290 views
Django renders the template `500.html` instead of `404.html`
In one of my views I have the code:
raise Http404
When DEBUG=False Django renders the template 500.html instead of the correct 404.html! I can't understand why!
EDIT: When DEBUG=True I get the ...
4
votes
1answer
324 views
Django Test Client post() returns 302 despite error on view's post()
I'm currently writing up some basic tests to ensure pages in a medium sized Django application are GETting and POSTing correctly. However, using django.test.client.Client isn't reliably failing when ...
0
votes
2answers
52 views
Python 404 from valid url URLLIB2
I am getting a 404 from urllib2. Despite the fact that the link works fine in my browser...
import urllib2
import numpy
import scipy.stats
import csv
import httplib
f1 = ...
2
votes
2answers
84 views
Django No Mini matches the given query
I wrote a link-shortener app that takes a regular long url, and creates a 10 character alphanumeric string that it uses for the redirection with Django-1.5.1.
The redirection link from the generated ...
1
vote
2answers
169 views
Scrapy:In a request fails (eg 404,500), how to ask for another alternative request?
I have a problem with scrapy.
In a request fails (eg 404,500), how to ask for another alternative request? Such as two links can obtain price info, the one failed, request another automatically.
1
vote
3answers
134 views
Django 1.4 serving media files works, but not static
I am using Django 1.4 and for some reason i am able to serve media files, but not the static ones...
Here is my code:
settings:
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
MEDIA_URL = '/media/'
...
0
votes
1answer
319 views
I'm getting a 404 in google cloud endpoints on app engine
In my app, the app.yaml (the relevant part) looks like this:
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /logs
script: logviewer.main.app
- url: ...
0
votes
1answer
108 views
Django — send 404 emails without referrer
From the Django 1.5 documentation:
Django can also be configured to email errors about broken links (404 “page not found” errors). Django sends emails about 404 errors when:
DEBUG is ...
0
votes
2answers
261 views
Checking a url for a 404 error scrapy
I'm going through a set of pages and I'm not certain how many there are, but the current page is represented by a simple number present in the url (e.g. "http://www.website.com/page/1")
I would like ...
0
votes
1answer
116 views
How to include links in HTTPNotFound errors in Pyramid?
One part of my site is a wiki engine. When a page does not exist I want to provide a custom 404 error page containing a link to create a new page. This custom 404 should only be seen in the context of ...
1
vote
1answer
284 views
Django: GET css returns 404?
I am developing a Django site and after a series of edits I ran my server again when suddenly - no css! The server still displays the html site, of course, but the css all across the site is throwing ...
0
votes
1answer
93 views
POST response varies between 200, 500, and 404 unpredictably
Trying to do some scraping of a site that returns a large number of search result. The problem is that the only way to navigate pages is via a __doPostBack method attached to the href argument of each ...
3
votes
1answer
182 views
pythonanywhere 404 error
I'm building an app in pythonanywhere using the Flask Mega Tutorial and it works fine when I run in on my pc. When I upload it to PA it gets a 404 error.
my structure
/microblog
/flask ...
0
votes
1answer
89 views
gae & python - setting different urls in yaml: 404 not found
I'm trying to map different urls to different python scripts.
This is my yaml
application: myApp
version: 99
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
...
1
vote
1answer
329 views
How to specify a custom 404 view for Django using Class Based Views?
Using Django, you can override the default 404 page by doing this in the root urls.py:
handler404 = 'path.to.views.custom404'
How to do this when using Class based views? I can't figure it out and ...
0
votes
2answers
177 views
which one is better to test a valid url in python
I want to check whether a particular url exists or not.
I came across two methods.
url = "http://www.google.com"
1.
import urllib2
response = urllib2.urlopen(url)
response.code # check what is ...
0
votes
2answers
996 views
Run python cgi script in browser w/o errors
I'm trying to run it on localhost.
A short introduction. Some links I've read before post:
How to run Python CGI script
...
1
vote
1answer
499 views
Python Flask getting 404 Not Found Error
I am designing this simple website using Flask. But I am getting a 404 error for my hello method. Whenever I click on the button "rate artists," it's giving me the error, but templates for home.html, ...
1
vote
1answer
495 views
Python Twitter Tools - Adding multiple users to a list fails (lists.members.create_all)
I am using Python Twitter Tools API to try to add multiple members to a list using lists.members.create_all of Twitter API v1.1 but I am getting this error:
Twitter sent status 404 for URL: ...
0
votes
1answer
232 views
Django local static files path puzzle
I'm trying to render static files locally in development. I have followed the rules and placed stylesheets in /static/ in my Django project folder, setting STATIC_URL = '/static/'. Using the {{ ...
0
votes
3answers
225 views
404 error for css file in media folder in django app
In my django app ,I have put these settings
settings.py
------------
MEDIA_ROOT = '/home/me/dev/python/django/myproject/myapp/media/'
MEDIA_URL = '/site_media/'
urls.py
--------
...
url(r'^myapp/', ...
0
votes
1answer
141 views
Python 3.2: Battle.net scraper gives 404 on certain URLs
I'm writing a battle.net screen scraper in python, and I want to scrape this page.
Problem is, I get a 404 when I try to download it using my script.
However, viewing it in a web browser works just ...
0
votes
2answers
238 views
404 error in django when visiting / Runserver returns no errors though
When I syncdb and runserver everything works correctly in Django, but when I try to visit the webpage that it is on http://127.0.0.1:8000/ it returns a 404 error.
Page not found (404)
Request ...
2
votes
2answers
199 views
python api - shopify.Variant 404 Error
Trying to create a new Variant using the python lib.
After creating a shopify session I simply try to create a Variant instance as per the docs
session = shopify.Session('<My Url>')
...
2
votes
1answer
1k views
Why am I getting 404 error in Flask?
I'm a Django developer learning Flask. I'm pretty new to how things work in Flask. I'm getting a 404 with the following code when I visit localhost:5000. Could someone explain why I'm getting this:
...
2
votes
2answers
191 views
Django Http404 and DEBUG mode catch 22
I'm using the staticfiles app during development, which doesn't work unless DEBUG is turned on.
From the docs:
Warning This will only work if DEBUG is True.
That's because this view is ...
2
votes
2answers
845 views
How do I return 404 when tastypie is interfacing non-ORM sources?
I am using the facade-like pattern described here: http://django-tastypie.readthedocs.org/en/latest/non_orm_data_sources.html
def obj_get(self, request=None, **kwargs):
rv = ...
1
vote
1answer
170 views
Test written for django URL Dispatcher not working
I'm working on a simple webservice in django. This is my first web app in django/python so I wouldn't be surprised if I'm missing something obvious here, but...
I'm currently trying to test my logic ...
2
votes
1answer
3k views
Django get url path without using “request.path”
I am creating a 404.html page in django which will be called when i raise "Http404"
I dont know if 404.html will be passed a "RequestContext" object but can I generate the requested url path without ...
0
votes
1answer
297 views
Can web.py be set to use the server's 404 page?
I have a server (nginx) which is routing some urls to static directories, and others to a web.py wsgi app. The server's config also defines a 404 page, which is displayed when somebody tries to visit ...
0
votes
1answer
127 views
Accessing static file for window.open no longer works in appengine 1.6.3
This was working until I downloaded the new version. Now I get a 404 error.
app.yamp is:
application: gamekicks
version: 1
runtime: python27
api_version: 1
threadsafe: true
libraries:
- name: PIL
...
0
votes
1answer
1k views
Cherrypy mapping URL to function
I'm tying to use Cherrypy for a website, but I have some problem with mapping the url of the page I want to display with function in the python code.
Now I have this code
#!/usr/bin/env python
...
0
votes
2answers
701 views
My custom 404 page doesn't work (Pyramid framework)
I want to show my fancy 404 page in pyramid app, but can get it working. After reading various magic texts about the subject, I put something like this in my code:
cfg.add_view( ...
3
votes
1answer
867 views
Am I not setting up my Flask 404 handler correctly?
In my Flask app, I set up a 404 handler like this:
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
However, when a user goes to an unrecognized url, the ...
1
vote
2answers
287 views
How should apache/nginx and django play nicely together in respect of 404 errors?
Here is a simplified version of our setup:
Nginx reverse proxy front end serving static files
Apache + mod_wsgi serving a django app in /store and wordpress for all other URLs
404 errors outside ...
2
votes
1answer
583 views
Redirect to a Page on 404 Error
Is it possible to redirect to a page on 404 and 500 instead of constructing a custom response? I tried-
class NotFoundPageHandler(webapp.RequestHandler):
def get(self):
#if 400
...
0
votes
2answers
181 views
Root html (/index.html) can't be fetched. Returns 404
The dir structure is-
MyApplication (Project Dir)
-static
--inside static, I got different dirs containing images, css, htmls, etc
-some other dirs
-app.yaml
-index.py
-index.html
The content ...
0
votes
3answers
3k views
Trouble with Twitter API using Python
I'm having some trouble in this python code:
import twitter
twitter_search = twitter.Twitter(domain="search.twitter.com")
trends = twitter_search.trends()
The error (404 page not found) is right ...
6
votes
1answer
2k views
Google App Engine Static Files GET 404
The following app.yaml works great on my local dev server.. but when I deploy it to production all static files throw 404. Server isn't able to locate any static files. Have been searching for hours ...
30
votes
5answers
18k views
Django staticfiles app help
I've having a little issue with Django's staticfiles app.
I have added
'django.contrib.staticfiles',
to my INSTALLED_APPS and have added
STATIC_URL = '/static/'
STATIC_ROOT = ...
2
votes
1answer
447 views
Pylons: How to write a custom 404 page?
So this question has been asked before, but not answered in great detail.
I want to override the default Pylons error page to make a nicer, custom one. I've got as far as overwriting the controller ...
0
votes
2answers
276 views
Django is returning RuntimeError instead of 404
In my Django project I am having RUntimeError when I'm supposed to get a 404. The description says:
Exception Value: maximum recursion depth exceeded
The error only occurs when I try to access a ...