Internal Error after chaning SITE domain name and modifying html file...?

41 views
Skip to first unread message

easypie

unread,
Dec 7, 2012, 8:03:27 AM12/7/12
to django...@googlegroups.com
I'm getting an 500 internal error. I did two things before this happened. (1) I modified a single html file then (2) logged into admin panel and changed the SITE's domain name. Afterward, I restarted the server but the website kept responding w/ 500 error. Here's the apache error log: http://dpaste.org/crfbg/

Paul Backhouse

unread,
Dec 7, 2012, 12:42:56 PM12/7/12
to django...@googlegroups.com
Is it a Site cache issue?

https://docs.djangoproject.com/en/1.4/ref/contrib/sites/#caching-the-current-site-object

Maybe try Site.objects.clear_cache()
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Ihm02fnLxbIJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsub...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.


Bill Freeman

unread,
Dec 7, 2012, 2:42:46 PM12/7/12
to django...@googlegroups.com
Or, is there still a Site object in the database whose Id matches the one specified in settings.py?
(It depends on how you changed the site object.)

To unsubscribe from this group, send email to django-users...@googlegroups.com.

Chris Cogdon

unread,
Dec 7, 2012, 6:40:44 PM12/7/12
to django...@googlegroups.com
Run ./manage.py shell ... since that imports settings, that should also fail, and will perhaps give you more information

Django isn't very good at showing you the "root cause" when a module fails to import, unfortunately, you might want to figure out a way of importing them manually and seeing what happened.

easypie

unread,
Dec 7, 2012, 9:06:30 PM12/7/12
to django...@googlegroups.com
I took the action suggested but it failed. So I decided to remove my whole project directory and recreate the database to start a fresh install of the project. But when I visit the site url it still returns the same error posted in the apache error log. Is this maybe something to do with my wsgi file or amazonaws storage that's messing everything up? or perhaps just my apache server...?

easypie

unread,
Dec 7, 2012, 9:16:04 PM12/7/12
to django...@googlegroups.com
Here's my apache log. I know this is outside of django but this might help find the cause: http://dpaste.org/V9ONE/  thanks for the helps.

easypie

unread,
Dec 7, 2012, 9:21:01 PM12/7/12
to django...@googlegroups.com
Here's my wsgi.py file located in my project: http://dpaste.org/dBRqQ/

Chris Cogdon

unread,
Dec 8, 2012, 12:01:12 AM12/8/12
to django...@googlegroups.com
Okay, I've never tried using virtualenv's with django before... but from what I've read, one of the most important things to do is ensure that the virtualenv site-packages directory is the first thing in sys.path.... the wsgi.py file there doesn't seem to be manipulating sys.path at all.

easypie

unread,
Dec 8, 2012, 12:49:19 AM12/8/12
to django...@googlegroups.com
I thought this line took care of that: site.addsitedir('/home/easyi/.virutalenvs/%s/lib/python2.7/site-packages' % settings.PROJECT_NAME)

easypie

unread,
Dec 8, 2012, 1:45:12 AM12/8/12
to django...@googlegroups.com
I also went through this suggestion and the response is a success. https://groups.google.com/forum/?fromgroups=#!topic/django-users/Rb9F7BS6td0%5B1-25%5D

easypie

unread,
Dec 8, 2012, 5:14:44 AM12/8/12
to django...@googlegroups.com
I'm not exactly sure what was the main cause of this but I had to remove all the project's files and its virtualenv and reinstall and git pull all the files back to start a fresh install. The two things I believe might be the culprit is either the wsgi.py file or the virtualenv itself. But after I did a fresh install of virtualenv and pull a copy of the project back to working server, everything booted back nicely. Thanks everyone (...for now? =)


On Friday, December 7, 2012 12:03:27 AM UTC-8, easypie wrote:

Ramiro Morales

unread,
Dec 7, 2012, 9:42:33 PM12/7/12
to django...@googlegroups.com
On Fri, Dec 7, 2012 at 6:21 PM, easypie <progr...@gmail.com> wrote:
> Here's my wsgi.py file located in my project: http://dpaste.org/dBRqQ/
>

Sorry I miesread the traceback. In,oine 4 of wsgi.py you import settings
and the one reporting the about about /etc/apache2/https is settings.py

Is it possible that you somehow are importing/including/referencing
/etc/apache2/https from settings.py?

--
Ramiro Morales

Ramiro Morales

unread,
Dec 7, 2012, 9:20:11 PM12/7/12
to django...@googlegroups.com
On Fri, Dec 7, 2012 at 6:16 PM, easypie <progr...@gmail.com> wrote:
> Here's my apache log. I know this is outside of django but this might help
> find the cause: http://dpaste.org/V9ONE/ thanks for the helps.

From the traceback you attached to the first message I'd say you need
to review or post the /home/easyi/.virtualenvs/tomw/project/tomw/wsgi.py
file.

According to the traceback it has in line 4 a reference to a
/etc/apache2/https or /etc/apache2/https: file that doesn't exist.

--
Ramiro Morales
Reply all
Reply to author
Forward
0 new messages