Package: django-fagungis
Introductiondjango-fagungis allow you to easy setup and deploy your django project on
your linux server.
django-fagungis will install and configure for you:nginxgunicornsupervisorvirtualenvPatches are welcome! Feel free to fork and contribute to this project on:github:github.com/DNX/django-fagungisInstallationThere are a few different ways to install Fagungis:Using pipIf you have pip install available on your system, just type:pip install django-fagungisIf you’ve already got an old version of Fagungis, and want to upgrade, use:pip install -U django-fagungisInstalling from a directoryIf you’ve obtained a copy of Fagungis using either Mercurial or a downloadable
archive, you’ll need to install the copy you have system-wide. Try running:python setup.py developIf that fails, you don’t havesetuptoolsor an equivalent installed;
either install them, or run:python setup.py installHow to use fagungis?If you have already installed Fagungis, you must proceed with the
configuration of your project.ConfigurationFirst of all you must configure your project task settings. To do this we
have prepared for you an example file inpath/to/fagungis/example_fabfile.pyso you can create a copy of this file and modify it according to your
needs.You can find also an online version ofexample_fabfile.pyhere:https://bitbucket.org/DNX/django-fagungis/src/tip/fagungis/example_fabfile.pyPlease pay attention to not have any tasks in your fabfile.py called:setupdeploytest_configurationgit_pullorhg_pullbecause these names are reserved by Fagungis.Test your configuration first!Fagungis come with its own automatic configuration tests. Each time you runsetupordeploytask, configuration tests are called.
Anyway, you can manually run these tests for your project configuration:fab project_name test_configurationIf you runtest_configurationmanually, you’ll observe some output about all your project settings.Do you need an example?Ok, let’s assume you want to configure your django project called “projectus”.
So, what we know about it?
we know:the project is calledprojectusthe git repository isgit@github.com:DNX/projectus.gitthe ip of the server where you want to host it is:88.88.88.88you want to use the domainwww.projectus.orgwhich point to 88.88.88.88Ok, it’s enough to configure and deploy your project, let’s do it!
Clone example_fabfile.py:cp path/to/fagungis/example_fabfile.py path/to/projectus/fabfile.pyor:wget -O fabfile.py https://bitbucket.org/DNX/django-fagungis/raw/tip/fagungis/example_fabfile.pyNow apply some changes to earlier cloned fabfile.py file in your project root:change task name:# from:
@task
def example():
# to:
@task
def projectus():change project name:# from:
env.project = 'example_production'
# to:
env.project = 'projectus'change repository:# from:
env.repository = 'https://bitbucket.org/DNX/example'
# to:
env.repository = 'git@github.com:DNX/projectus.git'change server ip:# from:
env.hosts = ['root@192.168.1.1', ]
# to:
env.hosts = ['root@88.88.88.88', ]change nginx server name:# from:
env.nginx_server_name = 'example.com'
# to:
env.nginx_server_name = 'projectus.org'not, let’s test our configuration:fab projectus test_configurationyou must see a message:Configuration tests passed!Setup your projectAssuming you’ve configured your project now you are ready to launch the setup:fab projectus setupduring this process you can see all the output of the commands launched on
the server. At some point you may be asked for some information as django
user password(if django user did not exist before) or repository password to
clone your project.
At the end of this task you must view a message saying that the setup
successful ended.
Now you can go on with the deployment of the project.Pleasetest manualy the setup at least at the first time following
this guide::https://bitbucket.org/DNX/django-fagungis/wiki/Setup_testDeploy the projectAfter you’ve run the setup you’re ready to deploy your project. This is as
simple as typing:fab projectus deployAs for setup you may be asked for some info during the deployment.
At the end you must view a message saying that the deployment successful
ended.
Now navigate tohttp://projectus.orgin your browser and assure that
everything is O.K.How to test fagungis?Pleasetest all operations manualy, at least at the first time, following
this guide:https://bitbucket.org/DNX/django-fagungis/wiki/Setup_testThis will increase your confidence in usingfagungis.