WebFaction
Community site: login faq

I'm using Django and Python 3.4, and am struggling to put a basic website onto the WebFaction servers.

I'm probably missing something really simple but I've spent hours upon hours trying to put this online and still no luck.

I was getting a 502 - Bad Gateway error. From these forums I figured out that httpd.conf wasn't listening to the correct port. I fixed that, but am still getting a "502 - Bad Gateway" error, except now the page displays "Bad Request (400)".

Any help would be greatly appreciated.

In my settings file I have debug set to false, and
ALLOWED_HOSTS = ['myusername.webfactional.com'] (Except I have my real username filled in here and everywhere below where I use "myusername")

The error log doesn't seem to contain anything useful, it's these three lines repeated
[Tue Aug 25 20:29:50.090248 2015] [mpm_worker:notice] [pid 23407:tid 140390991722304] AH00298: SIGHUP received. Attempting to restart
[Tue Aug 25 20:29:50.142336 2015] [mpm_worker:notice] [pid 23407:tid 140390991722304] AH00292: Apache/2.4.16 (Unix) mod_wsgi/4.4.13 Python/3.4.1 configured -- resuming normal operations
[Tue Aug 25 20:29:50.142354 2015] [core:notice] [pid 23407:tid 140390991722304] AH00094: Command line: '/home/myusername/webapps/tickets/apache2/bin/httpd.worker -f /home/myusername/webapps/tickets/apache2/conf/httpd.conf'

And here's the entire httpd.conf file:
ServerRoot "/home/myusername/webapps/tickets/apache2"

LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule unixd_module modules/mod_unixd.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/myusername/logs/user/access_tickets.log combined
ErrorLog /home/myusername/logs/user/error_tickets.log

Listen 18382
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5

WSGIPythonPath /home/myusername/webapps/tickets:/home/myusername/webapps/tickets/src:/home/myusername/webapps/tickets/lib/python3.4
WSGIDaemonProcess tickets processes=2 threads=12 python-path=/home/myusername/webapps/tickets:/home/myusername/webapps/tickets/src:/home/myusername/webapps/tickets/lib/python3.4
WSGIProcessGroup tickets
WSGIRestrictEmbedded On
WSGILazyInitialization On

WSGIScriptAlias / /home/myusername/webapps/tickets/src/tickets/wsgi.py

asked 25 Aug '15, 21:11

thomas_j
1112
accept rate: 0%


I've never seen the 400 Bad Request response code except as a result of an incorrect ALLOWED_HOSTS.

How are you setting DJANGO_SETTINGS_MODULE and os.path? Maybe you're picking up the settings from a different project, which contains the wrong value of ALLOWED_HOSTS?

This is somewhat speculation. If you open a support ticket, we can take a look at your application directly.

permanent link

answered 26 Aug '15, 00:30

ryans ♦♦
5.0k103760
accept rate: 43%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×21
×1

question asked: 25 Aug '15, 21:11

question was seen: 2,526 times

last updated: 26 Aug '15, 00:30

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM