Skip to main content

Flatpage-like SQL queries for Django.

Project description

# django-flatqueries

## Installing the app package from PyPI

If you already have a working Django 4+ project and you just want to install the app:

  1. Get the package:

    pip install django-flatqueries

  2. Add ‘flatqueries’ to your INSTALLED_APPS in settings.py.

  3. Add this to your urls.py:

    path(“flatqueries/”, include(“flatqueries.urls”))

  4. Create the database table required by this app:

    python manage.py migrate

  5. Make sure you have a template that can be resolved as base.html and contains a content block.

## Getting the sample project

This project runs out-of-the box on Django 4.2.17 (Python 3.8.10 and 3.12.3).

  1. Grab the code.

    git clone https://github.com/guitarmanvt/django-flatqueries demo

  2. cd demo/sample

  3. Create the database and a superuser.

    python manage.py migrate python manage.py createsuperuser

  4. Load the demo data. *(Optional, but see deployment note)

    python manage.py loaddata demo_data.json

  5. Start the local development server.

    python manage.py runserver

  6. Login at http://127.0.0.1:8000/admin to play with flatqueries.

## Usage

### TO RUN A FLATQUERY

  1. On its view page, click the “view on site” button.

  2. Click the “Run” button.

### DEPLOYMENT: VERY IMPORTANT

If you put this on another domain, you need to make sure your “site” values are correct. Otherwise, the “view on site” button will not work correctly!

### SECURITY

For editing, the standard Django Admin permissions apply. Any superuser will be able to edit, as well as any staff person with the appropriate permissions.

For running queries, an additional permission is needed for staff users. Assign flatqueries.can_run_query to grant this permission to users or groups.

Still, be careful not to let query URLs fall into the hands of users you don’t want running them. If you ignore this warning, then any trouble that results is YOUR OWN FAULT. :P

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_flatqueries-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file django_flatqueries-1.0.0.tar.gz.

File metadata

  • Download URL: django_flatqueries-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for django_flatqueries-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f441a3b003598f7d146d13fac8409fd0b428bfa61f581d5bbf0de0ca444a853d
MD5 0a8303ab9e9c450f2af30e86adb31679
BLAKE2b-256 7f879ab316e14950ee7653bbb95126402c007c94aa11c7f1f6a0958c8c6c6034

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page