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
# 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:
- 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.7/bin/yapf) possible location
$ ln -s /usr/local/python3.7/bin/yapf /usr/local/bin/yapf
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
Built Distribution
File details
Details for the file django-rework-0.4.0.tar.gz
.
File metadata
- Download URL: django-rework-0.4.0.tar.gz
- Upload date:
- Size: 21.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba09be1c6f2d3b16c7db733b68d97c75af80850ba503ab89731787399ee20734 |
|
MD5 | 8c8d45db1800a5bd949c01969997b21d |
|
BLAKE2b-256 | 5b049a3ec93968b67db63efaf1e3d81bc252c9b48a7e46b9dad5dd14ad69ddb5 |
File details
Details for the file django_rework-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: django_rework-0.4.0-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45cf8554ca09d929177233446635fcb5c308d5f53313bdee89289fa1ee2b7ade |
|
MD5 | cbae007c91e8284ec0e7fbeba98ea6fa |
|
BLAKE2b-256 | 48301c16659f5e7b7dc9abb96fd3003abab68348035186621ab506010d5a12eb |