Forums

How to run server with --insecure so that static files loading?

Hi,

My app cannot get static files loaded, searched on web for solutions, looks like I need to either turn Debug=False or use --insecure. After I turned Debug=False, I got 'Bad Request 404' error. I have to try --insecure, but not sure how to run server with the parameter?

Thanks

In settings.py,

    DEBUG = False
    ALLOWED_HOSTS = ['*']

Then in your terminal run,

    python manage.py runserver --insecure

Note that this method is highly inefficient, insecure and should NOT be used for actual production. Refer Django Doc for more info.

Thanks for your answers.

Hi both, you can't use runserver on PythonAnywhere. Our web servers aren't the same machines as the console servers. So --insecure isn't an option. DEBUG = False is a good idea though, or at least it's good to start with. You can use "proper" static files mappings from the Web tab later, when you're ready.

What static files aren't working? I can see at least one that does work:

http://energybean.pythonanywhere.com/static/feedback2013/style.css