wsgi does not work as intended even it works fine when python manage.py runserver 0.0.0.0:8000

36 views
Skip to first unread message

Jun Tanaka

unread,
Mar 22, 2014, 5:07:32 AM3/22/14
to django...@googlegroups.com
Hello,

wsgi does not work as usually even it works fine when python manage.py runserver 0.0.0.0:8000 
I use django version 1.3

I have two issues here.
1. how to add projectname inside of the url
2.static is not connected right


153.xx.x.x.x:8000/simple_project
this works.

But not when
153.xx.x.x.x/projectname/simple_project
The layout is not shown correctly because static file is not read. 


django.wsgi as follows
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
import os, sys
sys.path.append('/var/www/django')

os.environ['DJANGO_SETTINGS_MODULE'] = 'projectname.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

static in settings.py
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
STATICFILES_DIRS = (
    # Put strings here, like "/home/html/static" or "C:/www/django/static".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    "/var/www/django/projectname/static",
)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

urls.py
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
urlpatterns = patterns('',
    (r'^simple_project/add/(?P<status>\w*)$', 'simple_project.views.index'),
)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Anyone who know a solution please giver me an advise. 

Liam Thompson

unread,
Mar 27, 2014, 7:06:20 AM3/27/14
to django...@googlegroups.com
Are you seeing any error messages ?
Reply all
Reply to author
Forward
0 new messages