python - Problems with SSL(django-sslserver) on Django project -
i using django 1.6.2 in virtualenv, ubuntu 12.04 lts. wanted shift project https, installed django-sslserver.
project needs self signing, , works fine home page. however, apps in django project encounter problems. not pages redirected https, , hence causes 404 error (works if explicitly prefixed https). also, overall template (appearance i.e. static files?) lost. happening here? how make sure pages redirected https , works same way in http?
edited: pull request has been merged. static resources served now.
the problem runsslserver command not implemented serve static resources. way fix override get_handler in path_to_python_site_package/sslserver/management/commands/runsslserver.py so:
# ... django.contrib.staticfiles.handlers import staticfileshandler django import get_version # ... class command(runserver.command): # ... = "run django development server on https" def get_handler(self, *args, **options): """ returns static files serving handler wrapping default handler, if static files should served. otherwise returns default handler. """ handler = super(command, self).get_handler(*args, **options) use_static_handler = options.get('use_static_handler', true) insecure_serving = options.get('insecure_serving', false) if use_static_handler: return staticfileshandler(handler) return handler # ... you might want site package path with
python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())" i've submitted pull request in case want branch, merge, , reinstall package on own.
cheers
Comments
Post a Comment