Rapid develop framework base on Django
Project description
Django Rework
Rapid develop framework base on Django
Installation
python3 -m pip install django-rework
Generic CLI Commands
Start a new project
# recommend to append a dot(.), it will create project in current dir
# eg: initialize a new project named `pony`
rework init pony .
rework init pony
Add a app package
rework add users
Add deployment configurations
rework deploy --init
Deploy to test or production
rework deploy
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:
- environment name:
dev
,test
,prod
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
Release history Release notifications | RSS feed
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.2.0.tar.gz
(16.9 kB
view hashes)
Built Distribution
Close
Hashes for django_rework-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68133371c451ea5000deda63017074c8b78b0cc005fa48abe85919f87499a36c |
|
MD5 | 933763b94c1d0194ca942e9742d2cf84 |
|
BLAKE2b-256 | 91ecc7f3f81ac71077d87d76dfd560ebc424e9924aeb9d5bb6171d32736b0cd3 |