GAE: python code to check if i'm on dev_appserver or deployed to appspot

0 votes
My GAE app uses OAUTH 2. Currently, I manually switch the redirect_uri between http://localhost:8081/oauth2callback and myapp.appspot.com/oauth2callback depending on whether do local testing with dev_appserver or if I deploy to appspot.com.

Is there some code (e.g. using os.environ) that I can use to automate this?

Thanks!
Sep 7, 2018 in Python by ariaholic
• 7,340 points
39 views

1 answer to this question.

0 votes

I don't know if you still need it, but someone else might. According to

https://github.com/wuub/SublimeREPL/issues/96

You should go to Settings -> Package Settings -> SublimeREPL -> Settings - User

And add this option:

{
    "default_extend_env": {"PATH": "{PATH};C:\\Python27"}
}
answered Sep 10, 2018 by anonymous

Related Questions In Python

0 votes
1 answer

What is the python logic to check if a number is armstrong number or not?

number = int(input("enter a number")) s = 0 temp ...READ MORE

answered Jul 30 in Python by Mohammad
• 3,060 points
30 views
0 votes
0 answers

What is the logic to check if a number is prime or not in python?

I am looking for a function with ...READ MORE

Aug 2 in Python by Waseem
• 4,470 points
23 views
+1 vote
1 answer

How to check if a string is null in python

Try this: if cookie and not cookie.isspace(): # the ...READ MORE

answered Aug 20, 2018 in Python by Priyaj
• 56,900 points
4,113 views
0 votes
1 answer

How do I determine if my python shell is executing in 32bit or 64bit mode on OS X?

UPDATED: One way is to look at sys.maxsize as ...READ MORE

answered Dec 11, 2018 in Python by ariaholic
• 7,340 points
109 views
0 votes
1 answer

How do I check if input string is a valid regular expression or not in Python?

Hi. Good question! Well, just like what ...READ MORE

answered Feb 12 in Python by Nymeria
• 3,520 points
123 views
0 votes
1 answer

How to check if a string ends with a character in python?

You can use the endswith method. It checks ...READ MORE

answered Apr 4 in Python by Srisha
60 views
0 votes
1 answer

How to check if a substring is present in a string using Python?

To check if the substring exists in ...READ MORE

answered May 9 in Python by Sharan
58 views
0 votes
1 answer

How to check if a list is empty in python?

To check if a list is empty ...READ MORE

answered May 27 in Python by Nisa
• 1,090 points
47 views
0 votes
1 answer

How do I use urllib to see if a website is 404 or 200 in Python?

For Python 3, try doing this: import urllib.request, ...READ MORE

answered Nov 29, 2018 in Python by Nymeria
• 3,520 points

edited Dec 11, 2018 by Nymeria 1,055 views
0 votes
1 answer

How to handle AssertionError in Python and find out which line or statement it occurred on?

Use the traceback module: import sys import traceback try: ...READ MORE

answered Dec 17, 2018 in Python by charlie_brown
• 7,720 points
594 views