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,320 points
19 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

+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,160 points
1,548 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,320 points
66 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,500 points
39 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
38 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
31 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
28 views
0 votes
1 answer

python code to find if an array is monotonic

Hey Harsha, try out this code: def monotonic(a): ...READ MORE

answered Jun 17 in Python by Yesha
15 views
0 votes
1 answer

Python function to check if a given string is a keyword

You can get the list of keywords ...READ MORE

answered Jun 17 in Python by Drishya
16 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,500 points

edited Dec 11, 2018 by Nymeria 286 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,710 points
321 views