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.

from rework.core.devops.hosts import loads

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

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.6/bin/yapf) possible location

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

CONTRIBUTE

Developer Environment

pip install -r requirements_dev.txt

Run tests

python tests/runtests.py

Tag a new release

tag a version:

git tag -a v0.1.0

push tags to remote:

git push --tags

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.3.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

django_rework-0.3.0-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-rework-0.3.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.11

File hashes

Hashes for django-rework-0.3.0.tar.gz
Algorithm Hash digest
SHA256 63ab32cfe536d591eff87e1710b0c54e0eefd384ffc87ca4a138e4a95354fd68
MD5 dba42a067eb0a953875e232263825a7d
BLAKE2b-256 17ae876a6088c8d3a1c7397035ca1c0e7cb216cc428efb4f878704cc00dbe962

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_rework-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.11

File hashes

Hashes for django_rework-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f465a89c519008b36769ab001fb38172e833f009529aa90bec932e0c0558dbf3
MD5 1e1adc6699221b93e62315f59281bf46
BLAKE2b-256 bf0742e9eb018a90702008e383f0e39a92be6b665ce5bb8ed6b8ff57a91f10d2

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