Skip to main content

Django App Preloader

Project description

Django Spring

Installing

pip install django-spring --upgrade

Usage

# First start the server:
spring start

# Then run a manage.py command (eg. test)
spring test --keepdb

# Optionally, specify a settings module:
DJANGO_SETTINGS_MODULE="base.settings" spring test --keepdb

Comparison

For a large project I tested against, it reduced the test time from 27.8s to 14.5s! Most of the time savings are from app startup, so the largest difference will be felt for running small test suites for large projects.

manage.py

# time ./manage.py test --keepdb billing_service/tests/test_user.py
..........
----------------------------------------------------------------------
Ran 10 tests in 5.090s

OK
Preserving test database for alias 'default'...

real    0m27.773s
user    0m9.490s
sys     0m2.510s

spring

# time spring test --keepdb billing_service/tests/test_user.py
[APP] running command `test --keepdb billing_service/tests/test_user.py`
..........
----------------------------------------------------------------------
Ran 10 tests in 4.714s

OK
Preserving test database for alias 'default'...

real    0m14.457s
user    0m0.180s
sys     0m0.100s

Tweakable env vars

DJANGO_SETTINGS_MODULE: The path to your settings module (eg. base.settings)

CODE_RELOADER_POLL_PERIOD: The number of seconds to wait between polling. Setting this higher will improve performance when using the stat reloader.

LOG_LEVEL: (DEBUG, INFO, WARN, ERROR, CRITICAL)

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-spring-0.3.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

django_spring-0.3.0-py2.py3-none-any.whl (13.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-spring-0.3.0.tar.gz.

File metadata

  • Download URL: django-spring-0.3.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

File hashes

Hashes for django-spring-0.3.0.tar.gz
Algorithm Hash digest
SHA256 510209e8eff609cc14e5255d8fa752da3cbf4c37d7c7b33b2f3c57cb013b9dfc
MD5 cf40c9d573b54e826a04068a1e73cc45
BLAKE2b-256 ab382e22c810f0005ed11175a54ca6dd452ace0825ce1762b29e1858082a982d

See more details on using hashes here.

File details

Details for the file django_spring-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_spring-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

File hashes

Hashes for django_spring-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 482043997333b37d555e733fd2bc36a84a989ecaf2b1de289e3c6420c9ee25dc
MD5 695cf5eb983ba6ec6d535cda07325e94
BLAKE2b-256 86355d3c610392fcb89e1a723cbb04e30c042519ba2ee68a5c0e285bdc37ad9c

See more details on using hashes here.

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