Git Product home page Git Product logo

dre2004 / django-datatables-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 16 KB

A Django boilerplate project that will showcase using the Datatables javascript library as well as some other modern front end tools.

License: MIT License

Python 61.39% CSS 2.01% JavaScript 21.16% HTML 15.44%
django django-framework datatables-plugin datatables-ajax python3 bootstrap4 requirejs django-templates datatables-server-side-scripting

django-datatables-boilerplate's Introduction

Django datatables boilerplate

This project is an example of using Django and the django-datatables-view plugin, it can be used as a boiler plate or just to get a better understanding of how to use this great plugin.

In this sample project I will demonstrate how to get up and running django-datatables-view as well as moving past that with some additional technologies which are popular at the moment and how to combine them all to make a working Django site.

In this example I have used two separate databases, the first for the Django admin and authentication and the other is a read only database which could be a real life scenario when you first want to start working with Django.

The sample database used is the the French Towns and Communes from pgfoundry.org.

I have only tested this project with Python 3.x (specifically 3.7.0b3), running on Linux Mint 19 Tara and Postgres SQL 10.5. In theory you should be able to use whatever database you have access to (SQLlite should also work).

Getting Started

  1. Clone this repository
git clone [email protected]:dre2004/django-datatables-boilerplate.git
  1. Install Django and other requirements
pip install -r requirements.txt
  1. Download sample database (French towns) from pgfoundry.org. If you're using Postgres the following instructions should get you up and running.
$ tar zxvf french-towns-communes-francaises-1.0.tar.gz
$ psql -U <INSERT YOUR DB USERNAME> -W postgres

postgres=# create database towns;
CREATE DATABASE
postgres=# create user readonly with password 'securepass123!';
postgres=# \c towns
You are now connected to database "towns" as user "postgres"
towns=# grant select on all tables in schema public to readonly;
GRANT
postgres=#\q

The commands above will need to be run as the postgres root user (typically postgres as seen in the example) or a user with the relevant privileges.

Prerequisites

What things you need to install the software and how to install them

  1. Python 3.x+ - See Python site for platform specific instructions.
  2. A working database server, my personal preference is Postgresql.
  3. Time and patients - This is a prerequisite for most things in life :).

Deployment

This code isn't production ready, so deploy at your own risk. As a guide the minimum you will need to do to get this production ready will be to add authentication / authorization to the admin app and review and harden the settings.py.

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

django-datatables-boilerplate's People

Contributors

dre2004 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.