Issues switching to Debug = False

17 views
Skip to first unread message

David I

unread,
Oct 14, 2013, 10:53:40 AM10/14/13
to shareab...@googlegroups.com
Hi there.

Shareabouts seems like a great crowdsourcing application. We are quite the newbies with Django but thought we'd give setting up the application ourselves and using the Openplans API server a go.
We were wondering what steps need generally be taken when switching from debug mode with Shareabouts?

We've set "Stable Version for API v 1.0") up on a VPS/Cloud host ("City Network") with a standard Ubuntu 12.04 Server as per https://github.com/openplans/shareabouts/blob/master/doc/README.md (using a venv) and then
configured a flavor slightly with the help of https://github.com/openplans/shareabouts/blob/master/doc/CONFIG.md.

We then installed Apache2.2 and mod_wsgi and followed the instructions for Webfaction (minus step 1: using Django to create a folder with Django resources and a Django app skeleton). Additionally full the full path to activate_this.py was entered in shareabouts/src/project/wsgi.py and the
WSGIDaemonProcess line in Apache's config had the /env/ added to the path. Also, step# 8 is was not adhered to as the changes in urls.py suggested were already there.

With local_settings.py DEBUG = True, the application functions without incident via the development server as well as in Apache.

If DEBUG is set to False the development server shows the "Blast! Can't connect to the motherbrain" message, unstyled, although about the only thing the browser receives are a couple of .css files under /static before
Syntax error: http://socket/static/CACHE/js/d7dd5b7e8f31.js - first piece of code, which is

"<!DOCTYPE html>.."

and then "Shareabouts is not defined", line 513 of the main document:

"})(Shareabouts, jQuery);"

Mostly the same errors in Apache. And it's the same if we rename local_settings.py to something else and enter the dataset root&flavor name&API key in settings.py. It is the same with the default flavor.


Many thanks for any hints,

David I and colleagues.


David I

unread,
Oct 15, 2013, 3:30:50 PM10/15/13
to shareab...@googlegroups.com
Not exactly a highway this list, but anyways, to update it was ascertained that the main difference between debug off and on is the serving of static files. With debug= false and the --insecure flag for runserver the application loads alright.
Heroku's instructs for serving static works (with gunicorn, +nginx as a reverse proxy) too, although in one environment the default (sync) worker will go critical as soon as anything is requested, in an identically setup environment it will not. Why the tornado workers aren't meant for wsgi I don't know, because in the latter environment it works the best (won't go critical, won't sabotage bits of the base layer). Apache will serve static with some directives from https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/ but it remains to be seen whether Apache serving static and a django application not in debug mode can detect mobile platforms, because Apache not serving static content, just a django in debug, will not (it loads the desktop version on tiny cellphone screens). L's responsibility I guess.

Frank Hebbert

unread,
Oct 25, 2013, 2:35:08 PM10/25/13
to shareab...@googlegroups.com
Hi David -- glad to hear you got your issue sorted out. We run all our Shareabouts clients on dotcloud and advise others to use them or Heroku, so we're not able to provide deploy assistance for other platforms.

Do you have a link to your site to share? Interested to see what you ended up with!

Frank


--
-- --
Shareabouts Developers group.
Unsubscribe: https://groups.google.com/d/forum/shareabouts-dev?hl=en
---
You received this message because you are subscribed to the Google Groups "Shareabouts Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shareabouts-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Frank Hebbert
OpenPlans | http://openplans.org | 720 432-2378 | @fkh
Reply all
Reply to author
Forward
0 new messages