Quijost

Por favor ingresa o regístrate.

Ingresar con nombre de usuario, contraseña y duración de la sesión
Búsqueda Avanzada  

Noticias:

Deja tu post en el foro para hacer algun tipo de consulta

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.

Mensajes - Lwoo

Páginas: [1]
1
I applied the hint from one of the links from your previous post and now I get all the tracebacks into my mailbox. I keep on getting the same error (the following lines are the most interesting):

Código: [Seleccionar]
File "/home/monfloo/public_html/monfloo-landing/monfloo_lp/urls.py", line 6, in <module>
   admin.autodiscover()

 File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/contrib/admin/__init__.py", line 22, in autodiscover
   mod = import_module(app)

 File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/utils/importlib.py", line 35, in import_module
   __import__(name)

ImportError: No module named mailing

"mailing" is the name of app which I use in my project. I tried editing paths in settings.py but it didn't solve the problem. Also, error_log states:

Código: [Seleccionar]
[Wed Mar 14 22:42:23 2012] [error] [client x.x.x.x]   File "/home/monfloo/public_html/monfloo-landing/monfloo_lp/urls.py", line 6, in <module>
[Wed Mar 14 22:42:23 2012] [error] [client x.x.x.x] mod_wsgi (pid=21285): Exception occurred processing WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi'

line 6 in urls.py is admin.autodiscover(). Still no idea. :/

2
I had CHMODed error_log.txt to 666, after your reply I changed it even to 777, but it's still empty.  :-\ Switched back to 666.

Also, I modified my .htaccess as follows:

Código: [Seleccionar]
Options ExecCGI
Options +FollowSymLinks
Options +Includes
SetHandler wsgi-script

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(django.wsgi)
RewriteRule ^(.*)$ django.wsgi/$1 [L]

Moved the project from /home/monfloo/monfloo_lp to /home/monfloo/public_html/monfloo_lp and edited django.wsgi accordingly:

Código: [Seleccionar]
#!/usr/local/bin python
# -*- coding: utf-8 -*-

import os, sys, traceback
import django.core.handlers.wsgi
import psycopg2

filename = 'error_log.txt'
f = open(filename, 'w')

try:
    sys.path.append('/home/monfloo/public_html/monfloo-lp')
    os.environ['DJANGO_SETTINGS_MODULE'] = 'monfloo_lp.settings'
    os.environ['PYTHON_EGG_CACHE'] = '/home/monfloo/tmp/trac-eggs'

    application = django.core.handlers.wsgi.WSGIHandler()
    f.write('Ok')
except:
    traceback.print_exc(file=f)

However, still no success - it keeps on complaining that "Target WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi' cannot be loaded as Python module.", just as if nothing has been modified. :(

3
OK, as I mentioned previously the syncdb problem is gone and the database seems to work fine.

However, I can't get the project running. This is what I get in error log:

Código: [Seleccionar]
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x]   File "/home/monfloo/public_html/monfloo-landing/django.wsgi", line 9, in <module>
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x] mod_wsgi (pid=32211): Exception occurred processing WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi'.
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x] mod_wsgi (pid=32211): Target WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi' cannot be loaded as Python module.
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x]   File "/home/monfloo/public_html/monfloo-landing/django.wsgi", line 9, in <module>
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x] mod_wsgi (pid=32211): Exception occurred processing WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi'.
[Wed Mar 14 00:42:24 2012] [error] [client x.x.x.x] mod_wsgi (pid=32211): Target WSGI script '/home/monfloo/public_html/monfloo-landing/django.wsgi' cannot be loaded as Python module.

My django.wsgi:

Código: [Seleccionar]
#!/usr/local/bin python
# -*- coding: utf-8 -*-

import os, sys, traceback
import django.core.handlers.wsgi
import psycopg2

filename = 'error_log.txt'
f = open(filename, 'w')

try:
    sys.path.append('/home/monfloo/monfloo-lp/monfloo_lp')
    os.environ['DJANGO_SETTINGS_MODULE'] = 'monfloo_lp.settings'
    os.environ['PYTHON_EGG_CACHE'] = '/home/monfloo/tmp/trac-eggs'

    application = django.core.handlers.wsgi.WSGIHandler()
    f.write('Ok')
except:
    traceback.print_exc(file=f)

.htaccess:

Código: [Seleccionar]
Options ExecCGI
Options +FollowSymLinks
SetHandler wsgi-script

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !(django.wsgi)
RewriteRule ^(.*)$ django.wsgi/$1 [L]

I checked whether wsgi is working by testing the solution found on http://groups.google.com/group/django-users/browse_thread/thread/45bf45ec14bab5dd/b7bfcc750ff9de14 as well as yours, from http://quijost.com/foro/desarrollo-web/ejemplo-de-prueba-index-py-para-django-y-mysql-con-mod_wgsi/ - both work as expected.

Any idea what I have done wrong or what is missing?

4
OK, I sticked to MySQL for the time being and managed to initiate syncdb, but another error appeared: https://gist.github.com/9d1de002073de9b974ae

5
Modified my settings.py to use psycopg2 and now got the following error message:

Código: [Seleccionar]
monfloo@monfloo.quijost.com [~/monfloo-lp/monfloo_lp]# python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/__init__.py", line 438, in execute_manager
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/__init__.py", line 67, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/uti
ls/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/commands/syncdb.py", line 7, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_
signal
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/cor
e/management/sql.py", line 6, in <module>
    from django.db import models
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/
__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/
utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/
utils.py", line 33, in load_backend
    return import_module('.base', backend_name)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/uti
ls/importlib.py", line 35, in import_module
    __import__(name)
  File "/usr/local/lib/python2.7/site-packages/Django-1.3.1-py2.7.egg/django/db/
backends/postgresql_psycopg2/base.py", line 24, in <module>
    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: /usr
/local/lib/python2.7/site-packages/psycopg2-2.4.4-py2.7-linux-x86_64.egg/psycopg
2/_psycopg.so: undefined symbol: lo_truncate
monfloo@monfloo.quijost.com [~/monfloo-lp/monfloo_lp]#

6
Hi,

I've been trying to deploy my django project at monfloo.com, but got error 500. Actually I'm not sure what to do about that. :/

Also, I use PostgreSQL as my database. Trying to syncdb, I get "Error loading psycopg module: No module named psycopg". Not sure if I'm able to install the module myself (can't see virtualenv/virtualenvwrapper installed on the server, and easy_install needs root privileges) or just I have something configured improperly?

In general, the project is set up according to the guidelines from http://quijost.com/foro/desarrollo-web/ejemplo-de-prueba-index-py-para-django-y-mysql-con-mod_wgsi/ and https://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/ (without the http.conf part of course ;)). However, I've run out of ideas what might be missing or done wrong. :/

Páginas: [1]

Página generada en 0.421 segundos con 18 consultas.