Databrowse is a Django application that lets you browse your data.
As the Django admin dynamically creates an admin interface by introspecting your models, Databrowse dynamically creates a rich, browsable Web site by introspecting your models.
Installation
django-databrowse is available on pypi
http://pypi.python.org/pypi/django-databrowse
So easily install it by pip
$ pip install django-databrowse
Or by easy_install
$ easy_install django-databrowse
Another way is by cloning django-databrowse’s git repo
$ git clone git://github.com/Alir3z4/django-databrowse.git
Then install it by running:
$ python setup.py install
How to use Databrowse
Point Django at the default Databrowse templates. There are two ways to do this:
Add 'django_databrowse' to your INSTALLED_APPS setting. This will work if your TEMPLATE_LOADERS setting includes the app_directories template loader (which is the case by default). See the template loader docs for more.
Otherwise, determine the full filesystem path to the django_databrowse/templates directory, and add that directory to your TEMPLATE_DIRS setting.
Register a number of models with the Databrowse site:
import django_databrowse from myapp.models import SomeModel, SomeOtherModel, YetAnotherModel django_databrowse.site.register(SomeModel) django_databrowse.site.register(SomeOtherModel, YetAnotherModel)
Note that you should register the model classes, not instances.
it is possible to register several models in the same call to django_databrowse.site.register.
It doesn’t matter where you put this, as long as it gets executed at some point. A good place for it is in your URLconf file (urls.py).
Change your URLconf to import the ~django_databrowse module:
from django_databrowse
…and add the following line to your URLconf:
(r'^django_databrowse/(.*)', django_databrowse.site.root),
The prefix doesn’t matter – you can use databrowse/ or db/ or whatever you’d like.
Run the Django server and visit /databrowse/ in your browser.
Requiring user login
You can restrict access to logged-in users with only a few extra lines of code. Simply add the following import to your URLconf:
from django.contrib.auth.decorators import login_required
Then modify the URLconf so that the django_databrowse.site.root view is decorated with django.contrib.auth.decorators.login_required:
(r'^databrowse/(.*)', login_required(django_databrowse.site.root)),
If you haven’t already added support for user logins to your URLconf, as described in the user authentication docs, then you will need to do so now with the following mapping:
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
The final step is to create the login form required by django.contrib.auth.views.login. The user authentication docs provide full details and a sample template that can be used for this purpose.
Tests
django-databrowse has been tested Django 1.6 and later. To run the the tests:
$ python run_tests.py
It’s also available on travis-ci:
Translations
Currently English is only available language that is being packaged. If you would like to contribute in localization you can find django-databrowse project on Transifex as well: https://www.transifex.com/projects/p/django-databrowse/
Translation Status on Transifex
Metadata
Release files for django-databrowse 2016.3.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django-databrowse-2016.3.16.tar.gz | 16.6 kB | Without provenance | Details |
Release files / django-databrowse-2016.3.16.tar.gz
| Download URL | django-databrowse-2016.3.16.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4c76623068f81966c246171ac4474e2e0e5a37f02e4d6013b3f7b7335f557e0
|
|
BLAKE2b-256 checksum How to use checksums |
5fd78ce5730b81aaee838dcd9cb9cf5b7333895969514f89f7e678d5f9548963
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-databrowse 2016.3.16
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.