Example #1
0
def create_views():
    project_json =  get_project_json()
    views_file_path = get_path_inside_app('views.py')
    f = open(views_file_path, 'w')
    f.write(views_template)
    for url in project_json['urls']:
        f.write(build_standard_view(url))
    f.close()
Example #2
0
def create_urls():
    project_json =  get_project_json()
    urls_file_path = get_path_inside_app('urls.py')
    f = open(urls_file_path, 'w')
    f.write(urls_template)
    for url in project_json['urls']:
        import pdb;pdb.set_trace()
        url_view = '%s.views.%s' % (project_json['name'], url['name'])
        f.write("    (r'%s', '%s', name='%s')," % (url['path'], url_view, url['name']))
    f.write('\n)\n')
    f.close()