Package: django-statify
django-statifyBuild out a static version of your django project and deploy it using ftp, ssh
or on your localhost.But at first … if you like this tool and the idea behind, feel free to fork
it, make pull requests and write issues.1. Installation1.1. RequirementsPython 2.7 or higherDjango 1.3 or higherdjango-medusa (https://github.com/christian-schweinhardt/django-medusa)requests 1.1.0 or higherparamiko 1.10.0 or higherscpclient 0.4 or higher1.1.1. On UbuntuIf you’re using Ubuntu this should work:sudo pip install django-statifyAdditionally, you need the python driver for your selected database:sudo aptitude python-psycopg2 or sudo aptitude install python-mysqlThis will your database’s driver globally.1.1.2. On Mac OS Xsudo pip install django-statify (see above at ubuntu)1.2. DatabaseI recommend using SQLite, MySQL or PostgreSQL.2. ConfigurationAdd the following app to your INSTALLED_APPS.'statify'Now addurl(r'^', include('statify.urls'))to your urls.py and runpython manage.py syncdb --allAt last you have to set the current host at your Sites in the Admin Interface.Default there is an exmaple host like:Domain name: example.com
Display name: Domainthis should be something like thisDomain name: Your current host, e.g. 127.0.0.1:8000
Display name: Localhost or something elseThe domain name is important because of the internal url validation.2.1. Required settingsSTATIFY_BUILD_SETTINGSThis is your settings file for the release.e.g.'--settings=build'It should looks like the following example:# -*- coding: utf-8 -*-
#

# Project imports
from conf.settings import *


DEBUG = False
STATIFY_ROOT_STATIC_URL = '/'Default:''STATIFY_USE_CMSIF you are using django-cms you have to set this True:STATIFY_USE_CMS = TrueNow your CMS sites will be automatically saved in internal urls.STATIFY_PROJECT_DIRThe project dir should be the absolute path to your django project, where your
manage.py is stored.Default:os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')`STATIFY_UPLOAD_PATHThe upload path is relative to the MEDIA_ROOT. There will be stored all release
archives. This should be always an absolute path.Default:os.path.join(u'statify/releases/')STATIFY_EXCLUDED_MEDIAThe listed folders will be ignored on release statics.
Optional I recommend to use django-pipeline for your assets like css,
javascript and images.Default:[u'admin', u'statify', u'tmp', u'root']STATIFY_ROOT_STATICIf you need some root files like robots.txt or crossdomain.xml you are able to
store these files in this path. On release these files will be moved to the root
of the final htdocs.Default:os.path.join(settings.MEDIA_ROOT, 'root')STATIFY_ROOT_STATIC_URLThis setting is important for development. It should be overwritten
in your build settings to‘/’.Default:settings.STATIC_URL + 'root/'3. Using3.1. URLs3.1.1. Register internal urlsYou can register internal url’s using the django admin backend.Alternative you can register urls automatically by adding one of the below
methods to your model classes.The following example is for an single URL:def statify_url(self):
    return u'/%s/' % self.url_fieldor you can register more then one URL for a Model with the following example:def statify_urls(self):
    url_list = list()
    url_list.append('/%s/' % self.locale)

    return url_listThe backend will validate the url on save. Only valid urls will be rendered.
This is important because only valid urls will be rendered on release.3.1.2. Register external urlsIf you need some external content rendered to your site, you are able to
register external urls. Use the target path to point the rendered file in
your final htdocs folder.3.2. Release3.2.1. Create new releaseUsing the django admin interface you can create new releases by clicking the
button “Create new release” at the release overview.
After clicking you will see a loader. After the release is done the current
page will reload automatically.3.3. Deployment3.3.1. Manage deployment hostsTODO3.3.2. Run deploymentThere are two ways to deploy an release. First you have to click at the release
overview on “Deploy this release”. Afterwards you have to select an
deployment host and click on “Run deployment”.Alternative you can navigate to the detail view of an release and do the same
like below by clicking on “Run deployment”.4. RoadmapVersion 1.0Execute releases and deployments using django management commandsIntegrate logging for releases and deploymentsExtend deployment hosts to some cloud services (S3, etc.)django CMS support5. ChangelogVersion 0.2.0Added django-cms support (in BETA)Some locale fixesSome bugfixesUpdated README.mdVersion 0.1.9Updated README.mdSome locale fixesSome bugfixesVersion 0.1.8Updated README.mdSome bugfixesVersion 0.1.7Updated README.mdVersion 0.1.6Added german localeUpdated README.mdSome bugfixesVersion 0.1.5Added API / Method to register urls from ModelsUpdated README.mdSome bugfixesVersion 0.1.4Updated README.mdSome bugfixes