GithubHelp home page GithubHelp logo

lxmmxl56 / django-jack-skeleton Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 529 KB

A skeleton project based on Django and Bootstrap with some basic features such as password management, 2FA with email support, authenticated media file access, language switching, testing, etc.

Python 65.66% HTML 25.90% CSS 3.85% JavaScript 4.58%
django bootstrap skeleton

django-jack-skeleton's Introduction

๐Ÿ’€ Jack

A Django 4 and Bootstrap 5 based skeleton project

๐Ÿ”‘ Passwords & Keys

Passwords and secrets are not stored in the repo. Copy jack/config.ini.example to jack/config.ini and update as needed. A secret key can be generated with:

python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'

๐Ÿ—‚๏ธ Import Initial Data

Run the following to set up some sample help text:

python manage.py loaddata help.json

๐Ÿงช Testing

Run test with the following command:

coverage run --source='.' manage.py test --parallel

To see the coverage run coverage html and then open htmlcov/index.html to see the report.

๐Ÿ“ฐ Formatting

Run isort first to optimize imports and then Black so that import formatting will be consistent.

๐Ÿ“ฆ isort

isort .

โšซ Black

black . -S

๐Ÿค– Cron jobs

๐Ÿ†‘ Clear sessions

0 1 * * * (/path/to/.env/jack/bin/python /var/www/website.com/manage.py clearsessions >> /var/www/website.com/logs/clear_sessions.log 2>&1)

๐Ÿ“ง Mailer

* * * * * (/path/to/.env/jack/bin/python /var/www/website.com/manage.py send_mail >> /var/www/website.com/logs/cron_mail.log 2>&1)
0,20,40 * * * * (/path/to/.env/jack/bin/python /var/www/website.com/manage.py retry_deferred >> /var/www/website.com/logs/cron_mail_deferred.log 2>&1)
0 0 * * * (/path/to/.env/jack/bin/python /var/www/website.com/manage.py purge_mail_log 7 >> /var/www/website.com/logs/cron_mail_purge.log 2>&1)

๐Ÿ“ฆ Upgrade pip Packages

pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

django-jack-skeleton's People

Contributors

lxmmxl56 avatar

Stargazers

Aris Winandi 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.