Title: Gitlab Projects based on templates · python-gitlab/python-gitlab · Discussion #2267 · GitHub
Open Graph Title: Gitlab Projects based on templates · python-gitlab/python-gitlab · Discussion #2267
X Title: Gitlab Projects based on templates · python-gitlab/python-gitlab · Discussion #2267
Description: Gitlab Projects based on templates
Open Graph Description: Hi, I am new to using this python wrapper and can't seem to figure out to create a project and have it use a custom template. I know the API supports using '--use-custom-template' but cant seem to ...
X Description: Hi, I am new to using this python wrapper and can't seem to figure out to create a project and have it use a custom template. I know the API supports using '--use-custom-template' but c...
Opengraph URL: https://github.com/python-gitlab/python-gitlab/discussions/2267
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"Gitlab Projects based on templates","text":"Hi, I am new to using this python wrapper and can't seem to figure out to create a project and have it use a custom template. I know the API supports using '--use-custom-template' but cant seem to figure out the correct call using this wrapper. If anyone has any suggestions that would be great.
\ngroup_id = XXXXXX template = \"my_custom_template\" project = gl.projects.create({'name': 'test_repo', 'namespace_id': group_id, 'use_custom_template\"': template})
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"I faced the same problem. The Gitlab API description says there is the option --use_custom_template as well as --group-with-project-templates-id and --template-project-id so I tried my luck with
\nproject = gitlab.projects.create({'name': 'name', 'namespace_id': subgroup.id, 'use_custom_template': True, 'group_with_project_templates_id': 42540,'template_project_id': 30982})\n
\nand this worked fine.
","upvoteCount":1,"url":"https://github.com/python-gitlab/python-gitlab/discussions/2267#discussioncomment-10779009"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:226937f1-c892-b85c-8f4d-f0ddfe770eea |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | B8CE:14FB0B:4B2028B:61A2F55:69750A11 |
| html-safe-nonce | b894bd4f370c64ad8d7404931d3958eb9fbdc35e6b0e6bfe5fd8dfe8943f6938 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOENFOjE0RkIwQjo0QjIwMjhCOjYxQTJGNTU6Njk3NTBBMTEiLCJ2aXNpdG9yX2lkIjoiNDA0NjY2MTM4NzExNzk4ODM2OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 27b882971e088bdc709fe4c6ec345e1291138883d3eaa3ff85a29026e5e31d19 |
| hovercard-subject-tag | discussion:4354825 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/python-gitlab/python-gitlab/2267/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/78bc638cd9ec4d50b4841fa481eb70ceb066293d8e6dad8ec250cda2f260b2fc/python-gitlab/python-gitlab/discussions/2267 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/78bc638cd9ec4d50b4841fa481eb70ceb066293d8e6dad8ec250cda2f260b2fc/python-gitlab/python-gitlab/discussions/2267 |
| og:image:alt | Hi, I am new to using this python wrapper and can't seem to figure out to create a project and have it use a custom template. I know the API supports using '--use-custom-template' but cant seem to ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/python-gitlab/python-gitlab git https://github.com/python-gitlab/python-gitlab.git |
| octolytics-dimension-user_id | 28886265 |
| octolytics-dimension-user_login | python-gitlab |
| octolytics-dimension-repository_id | 8077625 |
| octolytics-dimension-repository_nwo | python-gitlab/python-gitlab |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 8077625 |
| octolytics-dimension-repository_network_root_nwo | python-gitlab/python-gitlab |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width