X-Git-Url: https://git.auf.org/?p=auf_recipe_django.git;a=blobdiff_plain;f=auf%2Frecipe%2Fdjango%2Fboilerplate.py;h=3aa64a48629a0ea52b51ee02c033c2367d8fb019;hp=661aa160771bca600a15bc92db4d72864eba9c5b;hb=19d7fb26dd8492abd284d393f56439c83390543b;hpb=d5b00fc33d124dac4f066e5ee6935f9e2721ba44 diff --git a/auf/recipe/django/boilerplate.py b/auf/recipe/django/boilerplate.py index 661aa16..3aa64a4 100644 --- a/auf/recipe/django/boilerplate.py +++ b/auf/recipe/django/boilerplate.py @@ -1,4 +1,39 @@ # -*- encoding: utf-8 -*- +import zc.buildout.easy_install + + +env = ''' +%(relative_paths_setup)s +import sys +import pkg_resources + +eggs_path = [ + %(path)s, + ] + +sys.path[0:0] = eggs_path + +# correction des namespaces virtuels +for egg_path in eggs_path: + pkg_resources.fixup_namespace_packages(egg_path) +%(initialization)s +import %(module_name)s +''' + +auf_buildout_file = zc.buildout.easy_install.script_header + env + '''\ +if __name__ == '__main__': + %(module_name)s.%(attrs)s(%(arguments)s) +''' + +auf_script_template = { + 'wsgi': env + """ +application = %(module_name)s.%(attrs)s(%(arguments)s) +""", + 'fcgi': env + """ +%(module_name)s.%(attrs)s(%(arguments)s) +""", +} + ################################################################################ # SETTINGS