Skip to main content

DJANGO + FAbric + GUnicorn + NGInx + Supervisor deployment

Project description

Introduction

django-fagungis allow you to easy setup and deploy your django project on your linux server. django-fagungis will install and configure for you:

  • nginx

  • gunicorn

  • supervisor

  • virtualenv

Patches are welcome! Feel free to fork and contribute to this project on:

github: github.com/DNX/django-fagungis

Installation

There are a few different ways to install Fagungis:

Using pip

If you have pip install available on your system, just type:

pip install django-fagungis

If you’ve already got an old version of Fagungis, and want to upgrade, use:

pip install -U django-fagungis

Installing from a directory

If 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 develop

If that fails, you don’t have setuptools or an equivalent installed; either install them, or run:

python setup.py install

How to use fagungis?

If you have already installed Fagungis, you must proceed with the configuration of your project.

Configuration

First of all you must configure your project task settings. To do this we have prepared for you an example file in path/to/fagungis/example_fabfile.py so you can create a copy of this file and modify it according to your needs.

You can find also an online version of example_fabfile.py here: https://bitbucket.org/DNX/django-fagungis/src/tip/fagungis/example_fabfile.py

Please pay attention to not have any tasks in your fabfile.py called:

  • setup

  • deploy

  • test_configuration

  • git_pull

or

  • hg_pull

because these names are reserved by Fagungis.

Test your configuration first!

Fagungis come with its own automatic configuration tests. Each time you run setup or deploy task, configuration tests are called. Anyway, you can manually run these tests for your project configuration:

fab project_name test_configuration

If you run test_configuration manually, 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 called projectus

  • the git repository is git@github.com:DNX/projectus.git

  • the ip of the server where you want to host it is: 88.88.88.88

  • you want to use the domain www.projectus.org which point to 88.88.88.88

Ok, 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.py

or:

wget -O fabfile.py https://bitbucket.org/DNX/django-fagungis/raw/tip/fagungis/example_fabfile.py

Now 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_configuration

you must see a message:

Configuration tests passed!

Setup your project

Assuming you’ve configured your project now you are ready to launch the setup:

fab projectus setup

during 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. Please test manualy the setup at least at the first time following this guide:: https://bitbucket.org/DNX/django-fagungis/wiki/Setup_test

Deploy the project

After you’ve run the setup you’re ready to deploy your project. This is as simple as typing:

fab projectus deploy

As 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 to http://projectus.org in your browser and assure that everything is O.K.

How to test fagungis?

Please test all operations manualy, at least at the first time, following this guide:

https://bitbucket.org/DNX/django-fagungis/wiki/Setup_test

This will increase your confidence in using fagungis.

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-fagungis-0.1.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distributions

django_fagungis-0.1.1-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

django_fagungis-0.1.1-py2-none-any.whl (12.8 kB view details)

Uploaded Python 2

File details

Details for the file django-fagungis-0.1.1.tar.gz.

File metadata

  • Download URL: django-fagungis-0.1.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for django-fagungis-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cc9c28369da290aed74bfc1c489b87b98186a354fd049ec123844b845d6eda84
MD5 080b4878276b98f1640064054230e736
BLAKE2b-256 1b11ca3b9df5d16215293fd5dbc9bcc0edee630a4c57cc0186b1ee608a73ee14

See more details on using hashes here.

File details

Details for the file django_fagungis-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: django_fagungis-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for django_fagungis-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1fe52212e07fc12f2a11df9ca2f12255fef85c05254cfcb8d86d3ed5bfddcb3
MD5 463eaf0d8646fd94eb287b2678e5abca
BLAKE2b-256 77f29d5a98bf1531ea2b0bc11b31e862e406f715d11ac39844034b5c33a6a9cd

See more details on using hashes here.

File details

Details for the file django_fagungis-0.1.1-py2-none-any.whl.

File metadata

  • Download URL: django_fagungis-0.1.1-py2-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.9

File hashes

Hashes for django_fagungis-0.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 5e4e2f31e2d1cffc018d1a23c8af7fd36398e0dc6a907dcf593d67a46cd9079f
MD5 41d86412620cc033e84b4ffba29d10b8
BLAKE2b-256 a0704cd23712c2ff0fb85bfa845f638493f804a0b4eef7afd36457fa4caa0917

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