Search code examples
pythonwsgiweblate

WSGI: Unformatted python site


I'm trying to setup python-based app Weblate. When I launch Weblate with manage.py, everything is OK, but if I want to use some WSGI server like gunicorn or uWSGI, the Weblate's home page looks like plain text with hyperlinks without formatting and pictures.

Server configuration:

Weblate weblate-2.5-7-gb1c4d0b
Python 2.7.5
Django 1.9.4
six 1.10.0
python-social-auth 0.2.14
Translate Toolkit 1.11.0
Whoosh 2.5.7
Git 1.8.3.1
Pillow (PIL) 1.1.7
dateutil 1.5
lxml 3.2.1
django-crispy-forms 1.6.0
compressor 2.0
pyuca N/A
pyLibravatar N/A
Database backends: django.db.backends.mysql

uWSGI ini file:

[uwsgi]
plugins       = python
master        = true
protocol      = uwsgi
socket        = 127.0.0.1:8080
wsgi-file     = /usr/local/weblate/weblate/wsgi.py
python-path   = /usr/local/weblate

wsgi.py:

import os
from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "weblate.settings")

application = get_wsgi_application()

DJANGO_SETTINGS_MODULE=weblate.settings


Solution

  • See Serving static files in Weblate documentation, it even has examples for Apache, nginx and lighttpd.