Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/defgsus/django-clear-tables
django manage.py task that clears the content of the django Permission and ContentTypes tables
https://github.com/defgsus/django-clear-tables
Last synced: 28 days ago
JSON representation
django manage.py task that clears the content of the django Permission and ContentTypes tables
- Host: GitHub
- URL: https://github.com/defgsus/django-clear-tables
- Owner: defgsus
- Created: 2018-07-30T23:35:49.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-23T12:27:09.000Z (about 6 years ago)
- Last Synced: 2024-10-10T15:16:08.422Z (about 1 month ago)
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## django-clear-tables v0.1.2
This is a simple django-app, registering a task called `django_clear_tables`.
It will delete the contents of django's **Permission** and **ContentTypes** models
so you can load data from a fixture without problems. Normally, an initial `migrate` will
create permission and content-type data. If you want to clone data from another instance,
to a fresh database, this data will clash with the `loaddata` command.**Be careful** because it can also easily mess up your existing database.
Install it with:
```bash
pip install django-clear-tables
```Usage is as follows:
Add `django_clear_tables` to `INSTALLED_APPS` in your django `settings.py`, then:
```bash
# initially setup the database
rm db.sqlite3 # or using mysql, pg, ...
./manage.py migrate
# wipe the initially created data
./manage.py django_clear_tables
# load a fixture from somewhere else
./manage.py loaddata dumpdata-from-another-instance.json
```