Forums

example.com and adminpanel question

Hello. I want to rename site "example.com" to "kernie_xvid.pythonanywhere.com", for correct email sending in django-registration. I do next things: inside adminpanel delete site "example.com" and create "kernie_xvid.pythonanywhere.com". After that, everithing DoesNotExist e tc. If rename "example.com" in mysql table django_site: no effect on sent emails.

How to replace "example.com" correctly?

Hello,

I would just change the entry from example.com to kernie_xvid.pythonanywhere.com and hit save. You would also then need to reload the web app. The site is cached: https://docs.djangoproject.com/en/dev/ref/contrib/sites/?from=olddocs#caching-the-current-site-object. So perhaps that is why it didn't update when you just changed the name.

after renaming my site from "example.com" to "kerniexvid.pythonanywhere.com" through adminpanel (both sitename and displayname), I get 404 error on main page;

I do reload webapp, and syncdb...

cant understand why is that and how to rename sitename correctly...

I'm seeing an "Unhandled exception" on kerniexvid.pythonanywhere.com -- you'll be able to see the error that's causing this in your site's error logs. You can find those by going to the "Web" tab, selecting the domain kerniexvid.pythonanywhere.com from the list on the left-hand side, and then clicking on the error log link on the right.

Whenever you get any unexpected error from web pages, it's always worth checking the log files first - sometimes HTTP error codes can be a little misleading (somtimes to avoid revealing potentially sensitive information on a public page), so it's worth checking if your webserver is giving you a more helpful error message in the privacy of the log files.

Unhandled exception for now solved.

Problem is when you try to register, confirming user and email, the email is sent with site "example.com": its wrong.

When I rename "example.com" to "kernie ... .com" everything falls with 404 et cetera.

Im about that.

OK, so this sounds like a Django setup issue. Let's just make sure I understand correctly:

  • In your Django app you're setting the Site details to point to the correct domain (instead of the default example.com),
  • You're doing that because you want the registration emails to have the correct site name.
  • After you make the change, every page on the site starts failing.

Is that correct?

If so, is there a stack trace anywhere (on the error page you see, or in the logs) that you could share with us? When I visited the site just now, it worked: I got a page with "Register" and "Login as registered user" links.