{ "info": { "author": "Konrad Wojas", "author_email": "konrad@wojas.nl", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Database" ], "description": "Django-pgrunner creates a local PostgreSQL_ database for your project and\nautomatically starts the database server when needed. It allows you to develop\nagainst a PostgreSQL server, while matching the convenience of a SQLite3\ndatabase file.\n\nThe local database is a self-contained database created using the PostgreSQL\n`initdb` tool. A separate PostgreSQL server will be started on a custom port.\n\nAdditionally, it support creating and activating database snapshots. This\nallows you to experiment with your data and be confident that you can restore\nyour old data within seconds.\n\nWhy?\n====\n\nWhile sqlite3 is great for development, being able to develop against a\nfull-featured database like PostgreSQL has a few huge benefits:\n\n * Your development database will match the database you run in production,\n eliminating a whole category of bugs, like:\n\n * South migrations failing in production, while working in dev\n * Errors in code due to database specific behaviour, like stricter\n checks on foreign key references.\n * Proper checks on `unique_together` (sqlite3 does not support these\n constraints)\n\n * You can use all the great features offered by PostgreSQL, instead of\n restricting yourself to a low common denominator. Examples:\n\n * Database-side constraint and cascading rules\n * Extra data types, like arrays\n * Full-text search\n * Views\n * Stored procedures\n * Triggers\n * PostGIS geo extensions\n * HStore\n * JSON features\n\nAnd with the ease of use this packae offers, there is no good reason not\nto use it!\n\nRequirements and installation\n=============================\n\nMake sure you have PostgreSQL_ installed. You can either compile from source,\nor install a binary for your operating system. Check the download_ page for\ndetails. For MacOS X users, I recommend downloading PostgresApp_.\n\nThe snapshot functionality requires rsync_ to be installed.\n\nThis package depends on the psycopg2_ package.\npsycopg2_ provides the Python database adapter needed to communicate\nwith PostgreSQL. This adapter is partly written in C, and requires a working\nC compiler, PostgreSQL development headers and the `pg_config` binary in your\nPATH. Alternatively, you can install a binary_ distribution.\n\n.. sourcecode:: sh\n\n pip install psycopg2\n\nThe easiest way to install `django-pgrunner` is using pip:\n\n.. sourcecode:: sh\n\n pip install django-pgrunner\n\nMicrosoft Windows is currently not supported.\n\n**This package is not intended for use on production servers.**\n\nUsage\n=====\n\nFirst, add **pgrunner** to your INSTALLED_APPS.\n\nNext, add the following lines to your `settings.py` or local settings file.\nMake sure that these come after any DATABASES setting:\n\n.. sourcecode:: python\n\n # If your PostgreSQL binaries are not in your path, add this setting\n #PGRUNNER_BIN = '/usr/lib/postgresql/9.3/bin'\n #PGRUNNER_BIN = '/Applications/Postgres.app/Contents/Versions/9.3/bin'\n\n # This will overwrite DATABASES and auto-start PostgreSQL if needed\n import pgrunner\n pgrunner.settings(locals())\n\nNote that most Linux distibutions do not include these binaries in the PATH,\nand only expose a few wrappers in `/usr/bin`. If this is the case for you, you\nneed to set the `PGRUNNER_BIN` setting.\n\nRun the following command to create your local database:\n\n.. sourcecode:: sh\n\n ./manage.py pg_init\n\nTo start the database in the background:\n\n.. sourcecode:: sh\n\n ./manage.py pg_ctl start\n\nNote that if you use pgrunner.setting(), it will automatically start the server\nfor you.\n\nTo stop the database:\n\n.. sourcecode:: sh\n\n ./manage.py pg_ctl stop\n\nThis will not be done automatically.\n\nTo start the `psql` command line interface with the right parameters, use one of\nthese commands:\n\n.. sourcecode:: sh\n\n ./manage.py dbshell\n ./manage.py pg_psql\n\nThe only difference is that the first one uses your `DATABASES` settings, and the\nsecond one ignores it.\n\nSnapshots\n=========\n\nSnapshots are nothing more than named copies of the full database.\nIt's the equivalent of a `cp dev.sqlite my-backup.sqlite` for SQLite users.\n\nTo create a snapshot and activate it:\n\n.. sourcecode:: sh\n\n ./manage.py pg_snapshot my-snapshot\n ./manage.py pg_activate my-snapshot\n\nThe name of the default snapshot you are running is `default`, so to switch\nback:\n\n.. sourcecode:: sh\n\n ./manage.py pg_activate default\n\nSnapshots can be deleted by removing their folder under `pgrunnerdb/`.\n\nCommand summary\n===============\n\n.. sourcecode:: sh\n\n ./manage.py pg_init - Initialize a local database environment\n ./manage.py pg_ctl start - Start server in background\n ./manage.py pg_ctl stop - Stop server in background\n ./manage.py pg_ctl status - Check if the server is running\n ./manage.py pg_run - Run PostgreSQL server in foreground\n ./manage.py pg_psql - Start psql with right parameters\n ./manage.py pg_snapshot foo - Create a copy of all current database data\n ./manage.py pg_activate - List all snapshots\n ./manage.py pg_activate foo - Activate snapshot 'foo'\n ./manage.py pg_dump - Run pg_dump\n ./manage.py pg_restore - Run pg_restore\n\n\nBehind the scenes\n=================\n\nDjango-pgrunner creates a `pgrunnerdb/` subfolder under your Django project.\nThis folder contains one folder for every snapshot that was created.\nThe name of the default instance is `default`. A `current` symbolic link\nkeeps track of which snapshot is active.\n\nA separate PostgreSQL daemon is started for every project. When the `pg_init`\nmanagement command is run, it will pick a random port between 15000 and 16000\nto run the server on and write it to the local `postgres.conf`. This way\nthe chances of a conflict between projects are small.\n\n.. _PostgreSQL: http://www.postgresql.org/\n.. _download: http://www.postgresql.org/download/\n.. _rsync: http://rsync.samba.org/\n.. _PostgresApp: http://postgresapp.com/\n.. _psycopg2: https://pypi.python.org/pypi/psycopg2\n.. _binary: http://initd.org/psycopg/install/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wojas/django-pgrunner/", "keywords": "django postgres postgresql runner pgrunner", "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "django-pgrunner", "package_url": "https://pypi.org/project/django-pgrunner/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-pgrunner/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/wojas/django-pgrunner/" }, "release_url": "https://pypi.org/project/django-pgrunner/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Create and autorun a PostgreSQL development database for your Django project", "version": "0.2.2" }, "last_serial": 1154326, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "f9071c8f238b9dfa079a2d6b23950669", "sha256": "85d449c8bfab79fb0f1508b987836404e608044c00fb61f73a2f47457b7df601" }, "downloads": -1, "filename": "django-pgrunner-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f9071c8f238b9dfa079a2d6b23950669", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9033, "upload_time": "2014-03-03T19:57:07", "url": "https://files.pythonhosted.org/packages/0e/89/2422fba98a17df8cff8bb923fd224f341a356d569527e831876f04172de4/django-pgrunner-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "1162215f55d7f17c557b91c08b61eb1f", "sha256": "5b0423fa5a49528ce072507b855a8fc1de8b8b7b7fbbc09918471981161f9658" }, "downloads": -1, "filename": "django-pgrunner-0.2.1.tar.gz", "has_sig": false, "md5_digest": "1162215f55d7f17c557b91c08b61eb1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9505, "upload_time": "2014-03-03T20:56:39", "url": "https://files.pythonhosted.org/packages/35/7b/6c59f04798fbcf227beebf2156e6b2228b9ad7c95b391675b5274403e275/django-pgrunner-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "90408fbd775698a14c3b686b35e81516", "sha256": "5d2aa05c99cf639502e898e1c285c44905d0c07afd3db5c4ef5757d12beaadd8" }, "downloads": -1, "filename": "django-pgrunner-0.2.2.tar.gz", "has_sig": false, "md5_digest": "90408fbd775698a14c3b686b35e81516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11473, "upload_time": "2014-07-11T05:56:27", "url": "https://files.pythonhosted.org/packages/95/88/e0227ee4cf772015897016d6874fc61f085aceaa9c489f982308e8bdbcd0/django-pgrunner-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "90408fbd775698a14c3b686b35e81516", "sha256": "5d2aa05c99cf639502e898e1c285c44905d0c07afd3db5c4ef5757d12beaadd8" }, "downloads": -1, "filename": "django-pgrunner-0.2.2.tar.gz", "has_sig": false, "md5_digest": "90408fbd775698a14c3b686b35e81516", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11473, "upload_time": "2014-07-11T05:56:27", "url": "https://files.pythonhosted.org/packages/95/88/e0227ee4cf772015897016d6874fc61f085aceaa9c489f982308e8bdbcd0/django-pgrunner-0.2.2.tar.gz" } ] }