diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index cfa96d7..02a3c7b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -15,7 +15,7 @@ Types of Contributions Report Bugs ~~~~~~~~~~~ -Report bugs at https://github.com/thorgate/tg_utils/issues. +Report bugs at https://github.com/thorgate/tg-utils/issues. If you are reporting a bug, please include: @@ -45,7 +45,7 @@ articles, and such. Submit Feedback ~~~~~~~~~~~~~~~ -The best way to send feedback is to file an issue at https://github.com/thorgate/tg_utils/issues. +The best way to send feedback is to file an issue at https://github.com/thorgate/tg-utils/issues. If you are proposing a feature: @@ -57,17 +57,17 @@ If you are proposing a feature: Get Started! ------------ -Ready to contribute? Here's how to set up `tg_utils` for local development. +Ready to contribute? Here's how to set up `tg-utils` for local development. -1. Fork the `tg_utils` repo on GitHub. +1. Fork the `tg-utils` repo on GitHub. 2. Clone your fork locally:: - $ git clone git@github.com:your_name_here/tg_utils.git + $ git clone git@github.com:your_name_here/tg-utils.git 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: - $ mkvirtualenv tg_utils - $ cd tg_utils/ + $ mkvirtualenv tg-utils + $ cd tg-utils/ $ python setup.py develop 4. Create a branch for local development:: @@ -102,7 +102,7 @@ Before you submit a pull request, check that it meets these guidelines: your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check - https://travis-ci.org/thorgate/tg_utils/pull_requests + https://travis-ci.org/thorgate/tg-utils/pull_requests and make sure that the tests pass for all supported Python versions. Tips diff --git a/README.rst b/README.rst index 6c8b197..ca35c33 100644 --- a/README.rst +++ b/README.rst @@ -2,14 +2,14 @@ tg-utils =============================== -.. image:: https://img.shields.io/pypi/v/tg_utils.svg - :target: https://pypi.python.org/pypi/tg_utils +.. image:: https://img.shields.io/pypi/v/tg-utils.svg + :target: https://pypi.python.org/pypi/tg-utils -.. image:: https://img.shields.io/travis/thorgate/tg_utils.svg - :target: https://travis-ci.org/thorgate/tg_utils +.. image:: https://img.shields.io/travis/thorgate/tg-utils.svg + :target: https://travis-ci.org/thorgate/tg-utils -.. image:: https://readthedocs.org/projects/tg_utils/badge/?version=latest - :target: https://readthedocs.org/projects/tg_utils/?badge=latest +.. image:: https://readthedocs.org/projects/tg-utils/badge/?version=latest + :target: https://readthedocs.org/projects/tg-utils/?badge=latest :alt: Documentation Status @@ -18,12 +18,20 @@ Collection of various utils for Django-based projects. This is code that we're using in our projects at Thorgate and we're hoping you'll find some of it useful as well. * Free software: ISC license -* Documentation: https://tg_utils.readthedocs.org. +* Documentation: https://tg-utils.readthedocs.org. + Features -------- -* TODO +* Model utils, e.g. timestamped and closable models, QuerySets that send out a signal when objects are modified. +* Templated email sending. +* Profiling utilities. +* Unique filename generation for uploads. +* Using hashids for models (instead of exposing primary keys). +* System checks for email and Sentry configuration. +* yuglify compressors for django-compressor. + Credits --------- diff --git a/docs/conf.py b/docs/conf.py index e5a6b13..55ec7e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,6 +31,10 @@ # version is used. sys.path.insert(0, project_root) +# Make Django happier +os.environ["DJANGO_SETTINGS_MODULE"] = "tests.django_settings" + + import tg_utils # -- General configuration --------------------------------------------- diff --git a/docs/installation.rst b/docs/installation.rst index e48c2bb..ceaf52c 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -6,9 +6,9 @@ Installation At the command line:: - $ easy_install tg_utils + $ easy_install tg-utils Or, if you have virtualenvwrapper installed:: - $ mkvirtualenv tg_utils - $ pip install tg_utils + $ mkvirtualenv tg-utils + $ pip install tg-utils diff --git a/docs/modules.rst b/docs/modules.rst deleted file mode 100644 index 18a9a55..0000000 --- a/docs/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -tg_utils -======== - -.. toctree:: - :maxdepth: 4 - - tg_utils diff --git a/docs/tg_utils.rst b/docs/tg_utils.rst deleted file mode 100644 index 2a37e10..0000000 --- a/docs/tg_utils.rst +++ /dev/null @@ -1,22 +0,0 @@ -tg_utils package -================ - -Submodules ----------- - -tg_utils.tg_utils module ------------------------- - -.. automodule:: tg_utils.tg_utils - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: tg_utils - :members: - :undoc-members: - :show-inheritance: diff --git a/tg_utils/profiling.py b/tg_utils/profiling.py index 8ec2441..b6b2b76 100644 --- a/tg_utils/profiling.py +++ b/tg_utils/profiling.py @@ -45,6 +45,7 @@ class ProfiledViewMixin: To use it, make your view inherit from ProfiledViewMixin, then set profiling_mode attribute of your class to desired value. The choices are: + - PROFILING_LOGGING - Simply logs elapsed time with standard logging lib. - PROFILING_YAPPI - Uses yappi (https://code.google.com/p/yappi/) to dump detailed profiling data into file. The file can be read with KCachegrind. yappi must be installed separately - `pip install yappi`. KCachegrind or