{ "info": { "author": "Keryn Knight", "author_email": "django-microscope@kerynknight.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "django-microscope\n================================\n\n:author: Keryn Knight\n:version: 0.1.1\n\nConvert a `Django`_ app into a standalone `Django`_ project so you can run it\nindependently as a microservice or what-have-you.\n\nConfiguration options given to ``run()`` are defaults, and may be replaced by\nenvironment variables thanks to `django-environ`_\n\nIf your app crosses boundaries into another application via imports, you should\nhopefully get warnings. Figuring out how to do that was mostly why I did this. I'd\nnever encountered `sys.meta_path`_ before.\n\nAlternatives\n------------\n\nIf you're starting a **new** app and want the proper micro experience, you\nmaybe want `django-micro`_ instead. It has magic involved too, but different magic!\n\nUsage\n-----\n\nCreate yourself a ``manage.py`` file in your app's folder (eg: where your\n``views.py``, ``models.py`` are) and do something like this...\n\n.. code:: python\n\n from microscope import run\n from django.conf.urls import url # or path etc.\n\n def urls():\n from myapp.views import MyView\n return [url('^$', MyView.as_view())]\n\n application = run(\n DEBUG=True,\n ROOT_URLCONF=urls\n )\n\nRunning it\n----------\n\nIt'll probably work, right? ``python manage.py [command]`` should all be OK.\nYou could probably go even more minimal with `dj-cmd`_ so you can do ``dj r``\n\nGunicorn\n^^^^^^^^\n\n``gunicorn manage`` and ``gunicorn manage:application`` should both work fine,\nas should ``DEBUG=0 gunicorn manage`` to change the setting by env-var.\n\nUWSGI\n^^^^^\n\nWhatever madness of command-line arguments or ini configuration invokes uwsgi for\nyou probably works; eg: ``uwsgi --http :8080 --wsgi-file `pwd`/manage.py --virtualenv $VIRTUAL_ENV``\n\nEnvironment variables should be fine?\n\nmod_wsgi\n^^^^^^^^\n\nIt'd probably work, but environment variable substitution for settings won't work\nat all, I don't think.\n\nURL configuration\n-----------------\n\nthe ``ROOT_URLCONF`` has to be a callable (function or object implementing ``__call__``)\nto defer execution of imports related to userland code, which almost certainly\ndepends on settings having already been configured. It's also because\nyour existing ``urls.py`` for the app may not be where you want the mountpoints\nwhen running it standalone vs as part of a monolith project.\n\nYou'll eagerly get an ``ImproperlyConfigured`` exception when starting the app, if your\n``ROOT_URLCONF`` is missing or not-callable.\n\nDon't worry, it's only called at startup, not on every request!\n\nIf you **do** want to use another file, ``microscope.urlconf('dotted.path.to.urls')``\nmay help\n\n.. code:: python\n\n from microscope import run, urlconf\n application = run(ROOT_URLCONF=urlconf('path.to.urls'))\n\nTests\n-----\n\nLiterally none. If you have `honcho`_ you can do ``honcho -f demo_project.procfile start``\nto start the ``demo_project.py`` (equivalent of ``manage.py``) using ``runserver``,\n``gunicorn`` and ``uwsgi`` on ports **8000**, **8001** and **8002** respectively.\n\nThe license\n-----------\n\nIt's the `FreeBSD`_. There's should be a ``LICENSE`` file in the root of the repository, and in any archives.\n\n.. _FreeBSD: http://en.wikipedia.org/wiki/BSD_licenses#2-clause_license_.28.22Simplified_BSD_License.22_or_.22FreeBSD_License.22.29\n.. _Django: https://docs.djangoproject.com/en/stable/\n.. _django-environ: https://github.com/joke2k/django-environ\n.. _honcho: https://honcho.readthedocs.io/\n.. _sys.meta_path: https://docs.python.org/3/library/sys.html#sys.meta_path\n.. _django-micro: https://github.com/zenwalker/django-micro\n.. _dj-cmd: https://github.com/nigma/dj-cmd\n\n\n----\n\nCopyright (c) 2018, Keryn Knight\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n----\n\nChange history for django-microscope\n-------------------------------------------------------------\n0.1.1\n^^^^^^\n* Initial release\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kezabelle/django-microscope/", "keywords": "django django-microscope manage.py microservice microscope", "license": "BSD License", "maintainer": "Keryn Knight", "maintainer_email": "django-microscope@kerynknight.com", "name": "django-microscope", "package_url": "https://pypi.org/project/django-microscope/", "platform": "", "project_url": "https://pypi.org/project/django-microscope/", "project_urls": { "Homepage": "https://github.com/kezabelle/django-microscope/" }, "release_url": "https://pypi.org/project/django-microscope/0.1.1/", "requires_dist": [ "Django (>=1.9)", "django-environ (>=0.4.4)" ], "requires_python": "", "summary": "Turn a Django app into a Django project so it can run as a microservice or whatever", "version": "0.1.1" }, "last_serial": 5007510, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "8120d0bf61adfbd0a2e6d5a367690f8e", "sha256": "db9684dd3540fdaed94c1cf9de189393912287c0ccd6dd8f8ef45e26bf2194da" }, "downloads": -1, "filename": "django_microscope-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8120d0bf61adfbd0a2e6d5a367690f8e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11345, "upload_time": "2018-08-22T19:58:50", "url": "https://files.pythonhosted.org/packages/ee/63/2494d16f24d98c31abeeff84ba4e45820d89701d38ae50576f6bcd769c7e/django_microscope-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a0f1bfde0299416b204a7a4ce86818a9", "sha256": "1658f786cabe92553c63a1eaa2534defc5618f2adbd934719a62c48e6b95d059" }, "downloads": -1, "filename": "django-microscope-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a0f1bfde0299416b204a7a4ce86818a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9594, "upload_time": "2018-08-22T19:58:52", "url": "https://files.pythonhosted.org/packages/d9/2b/15a5b72edffeb7dd92ee91842a9da6511d52d0aee444e68beaea620af23e/django-microscope-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "06d2613e4ffae920e7f17af031a1b05b", "sha256": "2574947f49297f522b2a99959b52f68ac4837f850f824d2038787d5fe02e21dd" }, "downloads": -1, "filename": "django_microscope-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06d2613e4ffae920e7f17af031a1b05b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9017, "upload_time": "2019-03-30T16:25:58", "url": "https://files.pythonhosted.org/packages/a5/ff/1ea702275800aaeef7886d19a026af0b8015ce627ba1ce7aae954523957f/django_microscope-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81d58d32dc8be591307ae27669e78601", "sha256": "8ed8debf1d49c255dc4e64959223b2dd6fe1da4ab0848abdcf6f9bb36b8f05c8" }, "downloads": -1, "filename": "django-microscope-0.1.1.tar.gz", "has_sig": false, "md5_digest": "81d58d32dc8be591307ae27669e78601", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9678, "upload_time": "2019-03-30T16:25:59", "url": "https://files.pythonhosted.org/packages/0b/f9/193a442e7e9f62c64f45b321ff3e365d17ff6c4a09e73321a3dab49bb6ee/django-microscope-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "06d2613e4ffae920e7f17af031a1b05b", "sha256": "2574947f49297f522b2a99959b52f68ac4837f850f824d2038787d5fe02e21dd" }, "downloads": -1, "filename": "django_microscope-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "06d2613e4ffae920e7f17af031a1b05b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9017, "upload_time": "2019-03-30T16:25:58", "url": "https://files.pythonhosted.org/packages/a5/ff/1ea702275800aaeef7886d19a026af0b8015ce627ba1ce7aae954523957f/django_microscope-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "81d58d32dc8be591307ae27669e78601", "sha256": "8ed8debf1d49c255dc4e64959223b2dd6fe1da4ab0848abdcf6f9bb36b8f05c8" }, "downloads": -1, "filename": "django-microscope-0.1.1.tar.gz", "has_sig": false, "md5_digest": "81d58d32dc8be591307ae27669e78601", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9678, "upload_time": "2019-03-30T16:25:59", "url": "https://files.pythonhosted.org/packages/0b/f9/193a442e7e9f62c64f45b321ff3e365d17ff6c4a09e73321a3dab49bb6ee/django-microscope-0.1.1.tar.gz" } ] }