Skip to main content

django-copy-tables

This utility allows for copying tables from a production/staging server to a development copy. This allows developing against full datasets.

Installation

It's on pypi, so install via pip (or add to your requirements.txt)

pip3 install django-copy-tables

in your settings.py

  • add to your INSTALLED_APPS "django_copy_tables"
  • add a line:
TABLE_COPY_PASSWORD="a password"

at the end of your urls.py add:

from django_copy_tables import get_table
urlpatterns.append(path('copyTables', get_table))

Usage

Once your source distribution has been updated and the view/password is live, then on your local install you can use the standard manage.py with the command copyTables

The general syntax is:

./manage.py copyTables <module name> <table name> <src url> <copy pass> [--clear] [--step X] [--ignore colname]

For example if you have a table named Author in module named Blog at http://my.blog with copy password zz11 you can copy that table to your local machine with:

./manage.py copyTables Blog Author http://my.blog zz11

By default it does not delete records locally, but will overwrite local records with the same primary key as the remote. To delete the local records before syncing use --clear.

By default it will copy 100 records at a time. If your records are large you may want to set --step to something lower.

If you are syncing a table with complex data structures (looping generally) sometimes you need to ignore a foreign key column to get the initial record loaded, load some other data, then load it again without ignoring. that is what the --ignore flag is for. it will ignore the column completly (the model will be set to the default generally.) Run it again without the clear or ignore flags after the other data is in place.

Metadata

Release files for django-copy-tables 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-copy-tables 0.1.9
File Size Uploaded Provenance
django_copy_tables-0.1.9.tar.gz 16.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-copy-tables 0.1.9
File Interpreter ABI Platform
django_copy_tables-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / django_copy_tables-0.1.9.tar.gz

Download URL django_copy_tables-0.1.9.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6878b1afe2a4c03aab73612136e05279a5d1b2bca926bf9446a47efcc1b7687d
BLAKE2b-256 checksum
How to use checksums
a3fa347f03c45ee643b94f4d2167af73f2e12c9a2db9eaee1994e9cbbbb4dc1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

Release files / django_copy_tables-0.1.9-py3-none-any.whl

Download URL django_copy_tables-0.1.9-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc66307ecd3b7025f8b5dc9aa39b09c1c1732f90ba187a9ff77792bcfe107e33
BLAKE2b-256 checksum
How to use checksums
9101591c5388be59af34a539ac877b6634f648f111ea375ba2e94bc4511eea07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10

Security for django-copy-tables 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page