Serving null files

1
2
3
4
nullFile = lambda r: HttpResponse()

# As you might've figured out, you use it in urls.py with:
# (r'myRegex', 'some.module.nullFile'),

More like this

  1. Debug-only static serving by ludvig.ericson 5 years, 4 months ago
  2. Search DjangoSnippets with Firefox by Natim 3 years, 8 months ago
  3. Improved Accept header middleware by ludvig.ericson 4 years, 8 months ago
  4. Django & cache headers by ludvig.ericson 5 years, 10 months ago
  5. Inline truncate by character number by esanchez 4 years, 10 months ago

Comments

(Forgotten your password?)