Skip to main content

Rapid develop framework base on Django

Project description

Django Rework

Downloads PyPI Python Django License

Rapid develop framework base on Django

Installation

python3 -m pip install django-rework

Generic CLI Commands

Start a new project

# It will create project in current dir
# eg: initialize a new project named `pony`
rework init pony

Add App

rework add users

Add deployment configurations

rework deploy --init

Deploy to test or production

rework deploy

App docs

App Description docs in English 简体中文文档
users Users system users.md users_cn.md

DevOps Fabric scripts

Setup hosts

django-rework deal with DevOps using Fabric. You should add hosts configurations in fabfile.py.

import os
from rework.core.devops.hosts import loads

# The first argument `default` is host alias
# `user` is optional, default value is `root`
# `envs` is the server support deploy environments
# `exclude_components` is optional, it's been used in `fab setup_server`
loads(
    'default', {
        'host': 'your-server-ip',
        'port': 22,
        'user': 'root',
        'connect_kwargs': {
            'password': 'server-password',
        },
        'envs': ['test', 'prod'],
        'exclude_components': ['redis'],
    }
)

# Using SSH key
loads(
    'web1', {
        'host': 'your-server-ip',
        'connect_kwargs': {
            'key_filename': os.path.join(os.path.abspath('.'), '.deploy/private.pem'),
        },
    }
)

You can change host alias as you like: web1 etc.

fab -H web1 deploy

if not -H provided, the default alias will use according the order below:

  1. environment name: dev, test, prod
  2. default

Deploy environments

By default, environments is dev, test, prod, every environment name is a generic fabric tasks.

# deploy to `test` environment
fab test deploy

If you want to update requirements, you should add arguments -r or --requirements_update

fab test deploy -r

Code Format

Code format using Google 的 yapf,recommend to install yapf globally:

# install yapf using pip in python3
$ python3 -m pip install yapf

# find and create soft link to `/usr/local/bin/yapf`
# find yapf execute file 

$ which yapf
# (/usr/local/python3.7/bin/yapf) possible location

$ ln -s /usr/local/python3.7/bin/yapf /usr/local/bin/yapf

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-rework-0.4.4.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

django_rework-0.4.4-py3-none-any.whl (39.3 kB view details)

Uploaded Python 3

File details

Details for the file django-rework-0.4.4.tar.gz.

File metadata

  • Download URL: django-rework-0.4.4.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.14

File hashes

Hashes for django-rework-0.4.4.tar.gz
Algorithm Hash digest
SHA256 7c5ffc7028ddffd0573ee1b97c41b36cbbe2008971cfbba3ee87150762f1ade8
MD5 bd5217127656e7222da319b2e9a5b41b
BLAKE2b-256 eb151892ce08e6a48d2481fe7b401d2bf66ad9f95c054264249afd0a80295ae4

See more details on using hashes here.

File details

Details for the file django_rework-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_rework-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25bb5af8a1c8b60f2ca5d64f1185bfe7d529bf6e34f458bb7390d68a8fab2421
MD5 a661f5f3db8e2c3b180b3d9ef1b20908
BLAKE2b-256 2c8f06b0c5834085c220c64e6a55654e4466e19c00802e2cc006d958656e2e5a

See more details on using hashes here.

Supported by

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