Comments (8)
What links point back to the 404? This should indeed not happen. Moreover, the missing Summary object should be handled more gracefully.
from publicdb.
In commits 0ff6d36 and 9ecc379 I have tried to improve on this, to make sure we don't provide links to pages that will fail because of missing Summary objects (or rather; because of existing Summary objects related to days without any data).
Mainly by adding this to filters; Q(num_events__isnull=False) | Q(num_weather__isnull=False)
And additionally to some I added; date__gte=datetime.date(2002, 1, 1), date__lte=datetime.date.today()
To prevent linking to future dates and to before we started this.
In case it does happen, it would be nice If we have a better 404 page redirecting people back to the homepage.
from publicdb.
In the view, something like this?
try:
Summary.objects.get(date)
except Summary.DoesNotExist:
return render_to_response('there_is_no_data_on_this_day.html')
else:
foo()
return render_to_response('data_pagina.html')
from publicdb.
Hmm, that might indeed be a good addition, even if we dont link to dates without data, people might edit links themselves.
A similar check could be done for the station id. And then we could also add one for the status page of in active stations.. etc..
But this might get to convoluted, it would be nice, but would a general (but specific to our site) 404 page not be sufficient?
from publicdb.
I was a bit short in my code. The Summary is linked to the station and a specific date. And you have to check for events; there might only be error messages on a particular day. The error page can be more general, but I'd like to have some separation between:
data.hisparc.nl/foo/bar/baz/ -> 404 (url not found)
data.hisparc.nl/show/station/501/2012/04/18 -> 404 (no data)
from publicdb.
Should we then also have;
data.hisparc.nl/django/show/station/555/[date] -> 404 (no station)
data.hisparc.nl/django/show/station/10001/status -> 404 (not active)
data.hisparc.nl/django/show/station/10001/config -> 404 (no config)
I do agree that there should be a difference between a 404 from a bad url pattern and from missing data and such.
from publicdb.
General 403, 404 and 500 pages made in commit aea6b73
from publicdb.
Almost all broken links are gone.
500 errors get reported and fixed quick enough.
404 errors might need to be monitored a bit more to fix remaining broken links.
But good enough for now, closing.
from publicdb.
Related Issues (20)
- Deprecation warning in ansible: yum with name: {{item}}
- Improve daily histograms HOT 2
- Admin VPN DNS does not resolve hosts outside of the HiSPARC VPN HOT 4
- NRPE protocol 3 not supported by stations with Admin<=7 HOT 1
- redirect website to HTTPS (esp /admin) HOT 2
- Update (change) monitor services fails HOT 1
- numpy 16 breaks pytables VLArray (daily update fails) HOT 1
- software-update/installer/latest is showing v7.12 HOT 1
- letsencrypt ansible role broken HOT 1
- data.hisparc.nl image download broken in Chrome HOT 2
- ext_timestamp -> ts, ns broken
- ca.key in ansible vault not identical to/not accepted as ca.key HOT 1
- Frequent SIGFPE (uncaught floating point exceptions) in daily update HOT 13
- Coincidences download always yield -999 for event zenith, azimuth HOT 5
- HDF5ExtError in daily update HOT 6
- Use a less restrictive data license HOT 7
- Agree to terms click broke tests HOT 2
- Add PATH to crontab HOT 1
- Downloading KNMI lightning data requires agreement to terms HOT 1
- Publicdb down? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from publicdb.