https://github.com/scop/django-instant-admin
Instant Django admin site for an existing database
https://github.com/scop/django-instant-admin
crud database django django-admin
Last synced: 10 months ago
JSON representation
Instant Django admin site for an existing database
- Host: GitHub
- URL: https://github.com/scop/django-instant-admin
- Owner: scop
- License: bsd-3-clause
- Created: 2019-04-14T07:03:53.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-10T06:20:53.000Z (about 6 years ago)
- Last Synced: 2025-06-09T21:04:58.927Z (about 1 year ago)
- Topics: crud, database, django, django-admin
- Language: Python
- Size: 7.81 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Django instant admin
This is a skeleton setup for creating a Django admin site for an
existing database. The existing database schema is not modified, and
data needed by Django's admin site directed to another (by default
SQLite) database.
## Setup
1. Install dependencies:
`pip install -r requirements.txt`
1. Install driver for your database:
https://docs.djangoproject.com/en/2.2/ref/databases/
1. Set environment variables:
`SECRET_KEY`: https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-SECRET_KEY
`DATABASE_URL`: URL to the inspected database, see https://github.com/kennethreitz/dj-database-url#url-schema
1. Prepare instant-admin database:
`./manage.py migrate`
1. Create a super user:
`./manage.py createsuperuser`
1. Generate models for inspected database:
`./manage.py inspectdb --database inspected > inspected/models.py`
1. Start the development server:
`./manage.py runserver`
At this point, depending on the underlying database structure and how
good a job Django's inspectdb does with it, you may have a working
Django admin site ready to be used against the inspected database. Log
in at the URL given in the console using the super user account
created above.
There may be some more or less cosmetic tweaks you may want to make to
the model, for example changing some `IntegerField`s to
`BooleanField`s, adding `ordering` to models' `Meta` classes etc.
It may also be that you'll receive error spewage on the console at
startup which you'll need to fix before the admin site will
work. Typically, these fixes need to be made in `inspected/models.py`
only.
## License
Copyright 2019 Ville Skyttä
SPDX-License-Identifier: BSD-3-Clause
Applies to Django instant admin itself as a whole; not e.g. to the
models you may generate and use with it.