Forums

How to use Pythonanywhere for api subdomain only

Hi, I have a web app running for xyz.com and it works as intended. But since the app's only purpose is to be a light API, I want xyz.com to go to a WordPress site that I'll be hosting elsewhere (Bluehost) and requests to api.xyz.com to be sent to the web app I have running on PA right now. That's all I want to change for the moment. I also need an SSL certificate, as I have now, for the api subdomain.

Is this doable? Thanks in advance.

yup- if you had setup the app for say www.xyz.com, you can click the pencil (edit) icon on the webapps tab to change it to api.xyz.com. you will also have to change your cname stuff accordingly (instead of the www cname pointing to the pythonanywhere url, it would be the api cname). You would also need to generate a new cert for api.xyz.com instead of www.xyz.com.

Thanks for the reply. I'll try it out and follow up with you if I get stuck. :)

Hi jeykumar, how did it go? I'm thinking the same thing.

www.xyz.com is just a simple wordpress set of pages. api.xyz.com will be on pythonanywhere. Well actually api.xyz.com will probably be more than just APIs.