v2.0 : plus de squelette projet
[auf_recipe_django.git] / auf / recipe / django / boilerplate.py
1 # -*- encoding: utf-8 -*-
2
3 import zc.buildout.easy_install
4
5 env = '''
6 %(relative_paths_setup)s
7 import sys
8
9 eggs_path = [
10 %(path)s,
11 ]
12
13 sys.path[0:0] = eggs_path
14
15 import pkg_resources
16
17 # correction des namespaces virtuels
18 for egg_path in eggs_path:
19 pkg_resources.fixup_namespace_packages(egg_path)
20 %(initialization)s
21 import %(module_name)s
22 '''
23
24 auf_buildout_file = zc.buildout.easy_install.script_header + env + '''\
25 if __name__ == '__main__':
26 %(module_name)s.%(attrs)s(%(arguments)s)
27 '''
28
29 auf_script_template = {
30 'wsgi': env + """
31 application = %(module_name)s.%(attrs)s(%(arguments)s)
32 """,
33 'fcgi': env + """
34 %(module_name)s.%(attrs)s(%(arguments)s)
35 """,
36 }