The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
forename = 'Leeroy' | |
surname = 'Jenkins' | |
# Seems nicer to me: | |
name = f'{forename} {surname}' | |
# Minimal alternative | |
name = '{} {}'.format(forename, surname) | |
# Full alternative | |
name = '{forename} {surname}'.format(forename=forename, surname=surname) |
I hereby claim:
To claim this, I am signing this object:
from django.conf.urls import url | |
from . import utils, views | |
urlpatterns = [ | |
url(r'^things', utils.include_list_and_detail( | |
'thing', | |
views.ThingList, | |
views.ThingDetail, |
Update: I expanded on this a little on my homepage.
Wouldn't it be nice if you didn't need to type out that nasty sudo -u postgres pqsl
and then enter a password every time you wanted to use a local development database? Well, if you don't mind every Tom, Dick and Harry having a peek at your data, you can get all that "security" balderdash out from under your feet by granting superuser access to your normal login user. :D
Add the following to your /etc/postgresql/9.1/main/pg_hba.conf
, replacing meshy
with your login name. If you don't know it (really?) you can get it by running whoami
.
host all meshy 127.0.0.1/32 trust
local all meshy trust
ip_byte = r'(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])' | |
ip_address = '(' + ip_byte + '\.){3}' + ip_byte | |
web_domain = r'[a-z0-9]+([\-\.][a-z0-9]+)*\.[a-z]{2,6}' | |
network_port = r':([0-9]{1,5})' | |
network_regex = '^' + ip_address + '|' + web_domain + network_port + '$' | |
>>> print(network_regex) | |
^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|[a-z0-9]+([\-\.][a-z0-9]+)*\.[a-z]{2,6}:([0-9]{1,5})$ |
self.quantities = ( | |
(5, 0, 0, 0), | |
(0, 4, 0, 0), | |
(5, 0, 2, 1) | |
) |
holiday datepicker starts on wrong day | |
holidaycal on dashboard | |
project to track requirements( | |
add front-end views to django-password. George. | |
wireframes and UX for holidaycal | |
Expenses list. James. | |
irc bouncer | |
django--oauth--google--admin | |
holidaycal with google-cl | |
Sentry for error emails. Marc. |
Howdy | |
. | |
q |
# @meshy's suggestion: | |
def dispatch(self, request, *args, **kwargs): | |
# Try to dispatch to the right method; if a method doesn't exist, | |
# defer to the error handler. Also defer to the error handler if the | |
# request method isn't on the approved list. | |
if request.method.lower() in self.http_method_names: | |
handler = getattr(self, request.method.lower(), self.http_method_not_allowed) | |
else: | |
handler = self.http_method_not_allowed | |
self.prepare_view(request, handler, *args, **kwargs) |