Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dd74c39

Browse files
Create_And_Manage_Heroku_App added
1 parent e81765a commit dd74c39

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import heroku3
2+
3+
def create_heroku_app(app_name):
4+
heroku_conn = heroku3.from_key('YOUR_HEROKU_API_KEY') # Replace with your Heroku API key or use heroku3.from_key(heroku_api_key)
5+
app = heroku_conn.create_app(name=app_name)
6+
return app
7+
8+
def list_heroku_apps():
9+
heroku_conn = heroku3.from_key('YOUR_HEROKU_API_KEY') # Replace with your Heroku API key or use heroku3.from_key(heroku_api_key)
10+
apps = heroku_conn.apps()
11+
return apps
12+
13+
def delete_heroku_app(app_name):
14+
heroku_conn = heroku3.from_key('YOUR_HEROKU_API_KEY') # Replace with your Heroku API key or use heroku3.from_key(heroku_api_key)
15+
app = heroku_conn.apps().get(app_name)
16+
if app:
17+
app.delete()
18+
print(f"App '{app_name}' deleted successfully.")
19+
else:
20+
print(f"App '{app_name}' not found.")
21+
22+
def main():
23+
app_name = input("Enter the name of the Heroku app: ")
24+
25+
# Create a new Heroku app
26+
new_app = create_heroku_app(app_name)
27+
print(f"Heroku app '{new_app.name}' created successfully.")
28+
29+
# List all Heroku apps
30+
print("\nList of all Heroku apps:")
31+
apps = list_heroku_apps()
32+
for app in apps:
33+
print(app.name)
34+
35+
# Delete a Heroku app
36+
delete_app = input("Enter the name of the app to delete: ")
37+
delete_heroku_app(delete_app)
38+
39+
if __name__ == "__main__":
40+
main()s
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Create_And_Manage_Heroku_Apps
2+
3+
Short description of package/script
4+
5+
- This Script Was simple to setup
6+
- Need import heroku3
7+
8+
## Setup instructions
9+
10+
Just Need to run this command " pip install heroku3 "
11+
then run the Create_And_Manage_Heroku_Apps.py file and for running python3 is must be installed!
12+
13+
## Detailed explanation of script, if needed
14+
15+
This Script Is Only for Create and manage Heroku apps use only!

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /