Forums

Unconfigured Domain with web2py

I am trying to setup a new site in PA using web2py but I keep getting "Unconfigured Domain". I have read thru the forums in PA and web2py but I can't find what is wrong.

The domain's (courticeecoprojects.org) CNAME points to ceco.pythonanywhere.com The domain home directory or forward location pointer is set to URL ceco.pythonanywhere.com

The WSGI file looks like this:

import os
import sys

# add your project directory to the sys.path
project_home = u'/home/ceco/web2py/'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

sys.stdout = sys.stderr
os.chdir(project_home)

# serve web2py via WSGI handler
from gluon.main import wsgibase as application

I have re-created the parameters_80 and parameters_443 files but the problem continues. Any help is appreciated.

Thanks, Denes

It looks like you haven't actually set up a CNAME. I think you've set up a domain redirect, so you end up connecting to PythonAnywhere, but with the wrong information in the request so we don't know where to route it.

Thanks for your reply but as I mentioned in the opening post the CNAME is set. Host: courticeecoprojects.org Points to: ceco.pythonanywhere.com

If I don't set the forward location pointer also then it will not even get to PA.

Any suggestions?. Denes

Firstly, it looks like you have a free account - my understanding was that you can only host your own domain with a paid "Web Developer" account type. With a free account, you could configure external web hosting to send a 301 HTTP response, but that will of course change the domain shown in the address bar. The PA devs can correct me if I'm wrong in my assertion that only paid accounts support domains these days.

Additionally, I note that while courticeecoprojects.org is a CNAME for ceco.pythonanywhere.com, www.courticeecoprojects.org is still a standard A record which points to an IP address outside PA. This is probably not what you want. According to RFC 1912 ยง2.4 CNAME records cannot co-exist with any other record types at the same level, but presumably you'd want at least MX records for courticeecoprojects.org to support email to that domain (not to mention NS records). While not technically a violation of the RFC, a root domain CNAME record should generally never be used.

Once you have an appropriate account type, I suggest removing the CNAME record for courticeecoprojects.org and adding one for www.courticeecoprojects.org which points to your PA domain, and making sure your web app is configured to use the www domain. If you want the non-www version to work, you'll have to set up a 301 redirect to the www version from it.

Thank you for your reply.

The free account (we are a non-profit org) with the modified CNAME was suggested by PA so I guess it should work, this is the first time I have used PA so I don't really know.

We don't have any email accounts at the domain, just the domain registration.

The CNAME can not be www.courticeecoprojects.org , it can only be set as courticeecoprojects.org , I did try that.

We have an upcoming tree planting event that we would like to showcase so we need to resolve this issue ASAP.

Thanks, Denes.

Hey there,

I would definitely also recommend using www.courticeecoprojects.org as your CNAME. It's definitely possible on most registrars, so maybe just try fighting a little bit harder with the config pages at your domain provider?

If you really give up on that, then you'll need to set up your web app with the domain courticeecoprojects.org (no www). I've done that for you, and it works, so you can delete that app and re-create it with your own settings. But the problem is that you'll have to figure out your own way of dealing with the www. domain, somehow redirecting it to http://courticeecoprojects, and we can't do that for you...

It appears that you're using domain.com for hosting (at least that's where your authoritative DNS servers point) or possibly someone reselling their services. Assuming I'm right, this page seems to imply that your can use their online DNS management to create CNAME records.

Admittedly many providers make it quite painful to update DNS, it's something that's come up on these forums before. It's worth setting them up correctly, however, because otherwise you may create tricky problems for yourself later.

courticeecoprojects.org without the www is working.

domain.com makes it easy to update the CNAME or any of the other records but I can not enter the CNAME host portion with www, I will ask them about that.

Thank you all for your responses. Denes

Perhaps there is a link to add a new record instead of editing the existing ones? I would expect there to be a list of entries for CNAMEs that you can edit existing rows and add new ones. Each row should have a field for the subdomain (e.g. www) as well as a field for the host to alias. More advanced interfaces might also allow you to specify the TTL, but don't worry too much about this for now.