Skip to main content

Django app packaging the best snippets found on http://djangosnippets.org

Project description

Django Snippets Cream

Django app packaging the best snippets found on http://djangosnippets.org

Included Snippets

963. RequestFactory

Easily create mock request objects for use in testing.

Original Snippet - http://djangosnippets.org/snippets/963/

Example:

from snippetscream import RequestFactory
request = RequestFactory().get('/')

1378. Resolve URLs to View Name

Supplies a resolve_to_name function that takes in a path and resolves it to a view name or view function name (given that the path is actually defined in your urlconf).

Original Snippet - http://djangosnippets.org/snippets/1378/

Example:

=== urlconf ====
urlpatterns = patterns(''
    (r'/some/url', 'app.views.view'),
    (r'/some/other/url', 'app.views.other.view', {}, 'this_is_a_named_view'),
)

=== example usage in interpreter ===
>>> from snippetscream import resolve_to_name
>>> print resolve_to_name('/some/url')
'app.views.view'
>>> print resolve_to_name('/some/other/url')
'this_is_a_named_view'

Authors

963. RequestFactory

  1. simon

  2. akalhola

1378. Resolve URLs to View Name

  1. UloPe

Changelog

0.0.1

  1. Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-snippetscream-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distributions

django_snippetscream-0.0.1-py2.6.egg (5.8 kB view details)

Uploaded Source

django_snippetscream-0.0.1-py2.5.egg (5.8 kB view details)

Uploaded Source

File details

Details for the file django-snippetscream-0.0.1.tar.gz.

File metadata

File hashes

Hashes for django-snippetscream-0.0.1.tar.gz
Algorithm Hash digest
SHA256 fdc3b6671777e95264172eea46ee6ddff18ee4418352c22d8de56b625de44cee
MD5 f114640339d803616a79d779972bbac9
BLAKE2b-256 9df68fc36c1a15788285a4103ca617197e08d00a538cb8d189649228fbbbcb44

See more details on using hashes here.

Provenance

File details

Details for the file django_snippetscream-0.0.1-py2.6.egg.

File metadata

File hashes

Hashes for django_snippetscream-0.0.1-py2.6.egg
Algorithm Hash digest
SHA256 e586940d302418dc514c354ae7bcdfd5176c56a9e93602dc2574d2dcf5fe1280
MD5 7bef8daee79e51e6f0256a8e7ccd9633
BLAKE2b-256 74617dec633bb48994551dc21131ada7976a477a33c8fcaef3113b8fb30aaa1a

See more details on using hashes here.

Provenance

File details

Details for the file django_snippetscream-0.0.1-py2.5.egg.

File metadata

File hashes

Hashes for django_snippetscream-0.0.1-py2.5.egg
Algorithm Hash digest
SHA256 bb25abadfc8be9f3491878ef23b660f64418c6b93764ce25b5759bb59f5e3b86
MD5 80fa7bce5e007aaed34200048e5ac4cb
BLAKE2b-256 5599778d4d0adcadbcfa27df51e6de448d4f10e7a6345be33be33b5871b5e94a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page