django-fabric-2.1.0
توضیحات
a generic fabric utility class for django projects
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | django-fabric-2.1.0 |
| نام | django-fabric |
| نسخه کتابخانه | 2.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Rolf Erik Lekang |
| ایمیل نویسنده | rolf@mocco.no |
| آدرس صفحه اصلی | https://github.com/mocco/django-fabric |
| آدرس اینترنتی | https://pypi.org/project/django-fabric/ |
| مجوز | UNKNOWN |
Quickstart
==========
django-fabric is written to make writing fabfiles for django projects easier and faster.
It contains the basic stuff one would expect from a django setup with git and virtualenv. The code
expects the project to have a certain structure as seen below. It is possible to customize the
activation of the virtualenvironment.
.. code-block::
project-dir/
venv/ # virtualenv
project-package/
manage.py
fabfile.py
Installation
------------
Run :code:`pip install django-fabric`
Usage
-----
There is two options to get get a basic setup, both will make you able to run :code:`fab deploy:prod` and :code:`fab test`.
Init script
~~~~~~~~~~~
There is a init script that will guide you through the generation of a basic fabfile
that utilises django-fabric. Run it with the command
.. code-block::
django-fabric-init
Basic manual setup
~~~~~~~~~~~~~~~~~~
Create a :code:`fabfile.py` in your project directory. You can see example of a fabfile below. If you
run into problems with settings where fabric cannot locate settings add
:code:`sys.path.append(os.path.dirname(__file__))` to your fabfile.
Here is an example of an fabfile
.. code-block::
from fabric.decorators import task
from fabric.state import env
from django_fabric import App
env.user = 'web'
env.hosts = ['server1.example.com']
site = App(
project_paths={
'prod': '/var/www/example_site',
},
urls={
'prod': 'http://example.com'
},
restart_command={
'prod': 'restart prod'
},
project_package='example',
test_settings='example.settings.test',
)
deploy = task(site.deploy)
test = task(site.test)
نحوه نصب
نصب پکیج whl django-fabric-2.1.0:
pip install django-fabric-2.1.0.whl
نصب پکیج tar.gz django-fabric-2.1.0:
pip install django-fabric-2.1.0.tar.gz