def write_project_urls(app_names):
    """Writes a basic urls.py for a django-project
    given the app names"""
    urls_imports = ['from django.conf.urls import include, url\n',
        """from django.contrib import admin
"""]
    url_pattern_lines = ['urlpatterns= [\n',
        "  url(r'^admin/', admin.site.urls),\n"]
    for app_name in app_names:
        url_pattern = "  url(r'^%s/',include('%s.urls')),\n" % (app_name,
            app_name)
        url_pattern_lines.append(url_pattern)
    url_pattern_lines.append('  ]')
    out_file = open('urls.py', 'w')
    for line in urls_imports:
        out_file.write(line)
    for line in url_pattern_lines:
        out_file.write(line)
    out_file.close()
