1

Estoy trabajando con Python 3.5, Django 1.15, Apache2, quiero ponerlo en producción pero cuando sigo los pasos, de este ejemplo, pero me sale este error:

Call to 'site.addsitedir()' failed for '/var/www/env/lib/python3.5/site-packeges:/var/www/env/lib/python3.5'. [Wed Feb 27 15:48:11.615700 2019] [wsgi:error] [pid 244:tid 139942963824384] mod_wsgi (pid=244): Call to 'site.addsitedir()' failed for '(null)', stopping. [Wed Feb 27 15:48:11.615731 2019] [wsgi:error] [pid 244:tid 139942963824384] mod_wsgi (pid=244): Call to 'site.addsitedir()' failed for '/var/www/env/lib/python3.5/site-packeges:/var/www/env/lib/python3.5'. [Wed Feb 27 15:48:11.627686 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] mod_wsgi (pid=244): Target WSGI script '/var/www/Sistema/Sistema/wsgi.py' cannot be loaded as Python module. [Wed Feb 27 15:48:11.627722 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] mod_wsgi (pid=244): Exception occurred processing WSGI script '/var/www/Sistema/Sistema/wsgi.py'. [Wed Feb 27 15:48:11.627888 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] Traceback (most recent call last): [Wed Feb 27 15:48:11.627906 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] File "/var/www/Sistema/Sistema/wsgi.py", line 12, in [Wed Feb 27 15:48:11.627917 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] from django.core.wsgi import get_wsgi_application [Wed Feb 27 15:48:11.627930 2019] [wsgi:error] [pid 244:tid 139942963824384] [remote 192.168.0.3:56840] ImportError: No module named 'django'

Tengo esto en el archivo de configuración de Apache:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www
ServerName servicios.x.x.x.x
ErrorLog /var/www/logs/error.log
CustomLog /var/www/logs/acces.log combined
WSGIDaemonProcess SystemProyect processes=5 python-path=/var/www/Sistema:/var/www/env/lib/python3.5/site-packeges:/var/www/env/lib/python3.5 threads=1
WSGIProcessGroup SystemProyect
WSGIScriptAlias / /var/www/Sistema/Sistema/wsgi.py
</VirtualHost>
WSGISocketPrefix /var/run/wsgi
5

1 respuesta 1

0

Si te falta los archivos js o css, tienes que agregar el sgte código. a tus

settings.py

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
REPOSITORY_ROOT = os.path.dirname(BASE_DIR)

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(REPOSITORY_ROOT, 'static/')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(REPOSITORY_ROOT, 'media/')

Luego en la url.py del proyecto:

urlpatterns = patterns('',
....urls......
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.