Re: Problem with getting setting up apache server for django

2009-08-16 Thread Graham Dumpleton



On Aug 17, 4:33 pm, Graham Dumpleton 
wrote:
> On Aug 17, 2:43 pm, NiJoMi  wrote:
>
> > Done a reinstall and checked each step.
> > ---
> > Step 1: Installed WampServer2 and verified working
> >         Location: C:\imfree
> >         Components of WampServer 2.0i [11/07/09]
> >         Apache 2.2.11
> >         MySQL 5.1.36
> >         PHP 5.3.0
> > ---
> > Step 2: Set up test enviroment
> >         Created following folders
> >         E:\localhost
> >         E:\Django\djangotest
> >         E:\Django\testsite2
> >         placed unique index.html in each folder
> >         edited hosts:
> >         added
> >         127.0.0.1       djangotest.lc
> >         127.0.0.1       testsite2.lc
> > ---
> > Step 3: Set up Virtual Hosts
> >         Edits to files:
>
> >         httpd.conf:
> >         # Uncommented following
> >         # Virtual hosts
> >         Include conf/extra/httpd-vhosts.conf
> > 
> >         http-vhosts.conf:
> >         # Virtual Hosts
> >         #
> >         # Use name-based virtual hosting.
> >         #
> >         NameVirtualHost *:80
> >         #
> >         
> >                 ServerAdmin webmas...@djangotest.lc
> >                 DocumentRoot "E:/Django/djangotest"
> >                 ServerName djangotest.lc
> >                 ServerAliaswww.djangotest.lc
> >                 ErrorLog "logs/djangotest.lc-error.log"
> >                 CustomLog "logs/djangotest.lc-access.log" common
> >                 
> >                         Order allow,deny
> >                         Allow from all
> >                 
> >         
>
> >         
> >                 ServerAdmin webmas...@testsite2.lc
> >                 DocumentRoot "E:/Django/testsite2"
> >                 ServerName testsite2.lc
> >                 ServerAliaswww.testsite2.lc
> >                 ErrorLog "logs/testsite2.lc-error.log"
> >                 CustomLog "logs/testsite2.lc-access.log" common
> >                 
> >                         Order allow,deny
> >                         Allow from all
> >                 
> >         
>
> >         
> >                 ServerAdmin webmas...@dummy-host2.localhost
> >                 DocumentRoot "E:/localhost"
> >                 ServerName localhost
> >                 ErrorLog "logs/localhost-error.log"
> >                 CustomLog "logs/localhost-access.log" common
> >                 
> >                         Order allow,deny
> >                         Allow from all
> >                 
> >         
> >         Started server [ :) Working]
> >         Stopped server
> > ---
> > Step 4: Installed Python 2.6.2
> >         Location: C:\imfree\bin [keeping things tidy]
> >         tested and verified working by the following methods
> >         1. Start>All Programs>Python 2.6>python [ :) Working]
> >         2. Start>Run>CMD
> >            >cd C:\imfree\bin\Python26
> >            C:\imfree\bin\Python26>python [ :) Working]
> > ---
> > Step 5. Install Django SVN
> >         Location: C:\imfree\bin\Python26\Lib\site-packages\django
> >         copied django-admin.py to C:\imfree\bin\Python26\Tools\Scripts
> >         Tested by first deleting folder E:\Django\djangotest
> >         then:
> >         1.  Start>All Progams>Python 2.6>python
> >                 entered import django into Python command line Result no 
> > errors.
>
> >         2.  Start>Run>CMD
> >                 >E:
> >                 E:\>cd DJango
> >                 E:\Django>django-admin.py startproject djangotest
> >                 'django-admin.py' is not recocognised as an internal or 
> > external
> > command,
> >                 operable program or batch file. [ :( missing path?. use 
> > set_path.]
> >                 E:\Django>set 
> > path=%path%;C:\imfree\bin\Python26\Tools\Scripts [path
> > to django-admin.py]
> >                 E:\Django>django-admin startproject djangotest
> >                 E:\Django>cd djangotest
> >                 E:\Django\djangotest>python manage.py runserver
> >                 'python' is not recocognised as an internal or external 
> > command,
> >                 operable program or batch file. [ :( missing path?. use 
> > set_path.]
> >                 E:\Django\djangotest>set path=%path%;C:\imfree\bin\Python26 
> > [path to
> > python]
> >                 E:\Django\djangotest>python manage.py runserver
> >                 Validating models...
> >                 0 errors found
>
> >                 Django version 1.2 pre-alpha SVN-11464, using settings
> > 'djangotest.settings'
> >                 Development server is running athttp://127.0.0.1:800/
> >                 Quit the server with CTRL-BREAK. [ :) Working]
>
> You should not install Django site instance unde

Re: Problem with getting setting up apache server for django

2009-08-16 Thread Graham Dumpleton



On Aug 17, 2:43 pm, NiJoMi  wrote:
> Done a reinstall and checked each step.
> ---
> Step 1: Installed WampServer2 and verified working
>         Location: C:\imfree
>         Components of WampServer 2.0i [11/07/09]
>         Apache 2.2.11
>         MySQL 5.1.36
>         PHP 5.3.0
> ---
> Step 2: Set up test enviroment
>         Created following folders
>         E:\localhost
>         E:\Django\djangotest
>         E:\Django\testsite2
>         placed unique index.html in each folder
>         edited hosts:
>         added
>         127.0.0.1       djangotest.lc
>         127.0.0.1       testsite2.lc
> ---
> Step 3: Set up Virtual Hosts
>         Edits to files:
>
>         httpd.conf:
>         # Uncommented following
>         # Virtual hosts
>         Include conf/extra/httpd-vhosts.conf
> 
>         http-vhosts.conf:
>         # Virtual Hosts
>         #
>         # Use name-based virtual hosting.
>         #
>         NameVirtualHost *:80
>         #
>         
>                 ServerAdmin webmas...@djangotest.lc
>                 DocumentRoot "E:/Django/djangotest"
>                 ServerName djangotest.lc
>                 ServerAliaswww.djangotest.lc
>                 ErrorLog "logs/djangotest.lc-error.log"
>                 CustomLog "logs/djangotest.lc-access.log" common
>                 
>                         Order allow,deny
>                         Allow from all
>                 
>         
>
>         
>                 ServerAdmin webmas...@testsite2.lc
>                 DocumentRoot "E:/Django/testsite2"
>                 ServerName testsite2.lc
>                 ServerAliaswww.testsite2.lc
>                 ErrorLog "logs/testsite2.lc-error.log"
>                 CustomLog "logs/testsite2.lc-access.log" common
>                 
>                         Order allow,deny
>                         Allow from all
>                 
>         
>
>         
>                 ServerAdmin webmas...@dummy-host2.localhost
>                 DocumentRoot "E:/localhost"
>                 ServerName localhost
>                 ErrorLog "logs/localhost-error.log"
>                 CustomLog "logs/localhost-access.log" common
>                 
>                         Order allow,deny
>                         Allow from all
>                 
>         
>         Started server [ :) Working]
>         Stopped server
> ---
> Step 4: Installed Python 2.6.2
>         Location: C:\imfree\bin [keeping things tidy]
>         tested and verified working by the following methods
>         1. Start>All Programs>Python 2.6>python [ :) Working]
>         2. Start>Run>CMD
>            >cd C:\imfree\bin\Python26
>            C:\imfree\bin\Python26>python [ :) Working]
> ---
> Step 5. Install Django SVN
>         Location: C:\imfree\bin\Python26\Lib\site-packages\django
>         copied django-admin.py to C:\imfree\bin\Python26\Tools\Scripts
>         Tested by first deleting folder E:\Django\djangotest
>         then:
>         1.  Start>All Progams>Python 2.6>python
>                 entered import django into Python command line Result no 
> errors.
>
>         2.  Start>Run>CMD
>                 >E:
>                 E:\>cd DJango
>                 E:\Django>django-admin.py startproject djangotest
>                 'django-admin.py' is not recocognised as an internal or 
> external
> command,
>                 operable program or batch file. [ :( missing path?. use 
> set_path.]
>                 E:\Django>set 
> path=%path%;C:\imfree\bin\Python26\Tools\Scripts [path
> to django-admin.py]
>                 E:\Django>django-admin startproject djangotest
>                 E:\Django>cd djangotest
>                 E:\Django\djangotest>python manage.py runserver
>                 'python' is not recocognised as an internal or external 
> command,
>                 operable program or batch file. [ :( missing path?. use 
> set_path.]
>                 E:\Django\djangotest>set path=%path%;C:\imfree\bin\Python26 
> [path to
> python]
>                 E:\Django\djangotest>python manage.py runserver
>                 Validating models...
>                 0 errors found
>
>                 Django version 1.2 pre-alpha SVN-11464, using settings
> 'djangotest.settings'
>                 Development server is running athttp://127.0.0.1:800/
>                 Quit the server with CTRL-BREAK. [ :) Working]

You should not install Django site instance under DocumentRoot. If you
stuff up your Apache configuration at some point, your source code
would be downloadable, including any passwords in settings.py file.
So, keep them separate.

>         3.  Test with built in server
>                 edited httpd-vhosts.conf:
>                  

Re: Problem with getting setting up apache server for django

2009-08-16 Thread NiJoMi

Done a reinstall and checked each step.
---
Step 1: Installed WampServer2 and verified working
Location: C:\imfree
Components of WampServer 2.0i [11/07/09]
Apache 2.2.11
MySQL 5.1.36
PHP 5.3.0
---
Step 2: Set up test enviroment
Created following folders
E:\localhost
E:\Django\djangotest
E:\Django\testsite2
placed unique index.html in each folder
edited hosts:
added
127.0.0.1   djangotest.lc
127.0.0.1   testsite2.lc
---
Step 3: Set up Virtual Hosts
Edits to files:

httpd.conf:
# Uncommented following
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

http-vhosts.conf:
# Virtual Hosts
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#

ServerAdmin webmas...@djangotest.lc
DocumentRoot "E:/Django/djangotest"
ServerName djangotest.lc
ServerAlias www.djangotest.lc
ErrorLog "logs/djangotest.lc-error.log"
CustomLog "logs/djangotest.lc-access.log" common

Order allow,deny
Allow from all




ServerAdmin webmas...@testsite2.lc
DocumentRoot "E:/Django/testsite2"
ServerName testsite2.lc
ServerAlias www.testsite2.lc
ErrorLog "logs/testsite2.lc-error.log"
CustomLog "logs/testsite2.lc-access.log" common

Order allow,deny
Allow from all




ServerAdmin webmas...@dummy-host2.localhost
DocumentRoot "E:/localhost"
ServerName localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common

Order allow,deny
Allow from all


Started server [ :) Working]
Stopped server
---
Step 4: Installed Python 2.6.2
Location: C:\imfree\bin [keeping things tidy]
tested and verified working by the following methods
1. Start>All Programs>Python 2.6>python [ :) Working]
2. Start>Run>CMD
   >cd C:\imfree\bin\Python26
   C:\imfree\bin\Python26>python [ :) Working]
---
Step 5. Install Django SVN
Location: C:\imfree\bin\Python26\Lib\site-packages\django
copied django-admin.py to C:\imfree\bin\Python26\Tools\Scripts
Tested by first deleting folder E:\Django\djangotest
then:
1.  Start>All Progams>Python 2.6>python
entered import django into Python command line Result no errors.

2.  Start>Run>CMD
>E:
E:\>cd DJango
E:\Django>django-admin.py startproject djangotest
'django-admin.py' is not recocognised as an internal or external
command,
operable program or batch file. [ :( missing path?. use 
set_path.]
E:\Django>set path=%path%;C:\imfree\bin\Python26\Tools\Scripts 
[path
to django-admin.py]
E:\Django>django-admin startproject djangotest
E:\Django>cd djangotest
E:\Django\djangotest>python manage.py runserver
'python' is not recocognised as an internal or external command,
operable program or batch file. [ :( missing path?. use 
set_path.]
E:\Django\djangotest>set path=%path%;C:\imfree\bin\Python26 
[path to
python]
E:\Django\djangotest>python manage.py runserver
Validating models...
0 errors found

Django version 1.2 pre-alpha SVN-11464, using settings
'djangotest.settings'
Development server is running at http://127.0.0.1:800/
Quit the server with CTRL-BREAK. [ :) Working]

3.  Test with built in server
edited httpd-vhosts.conf:
 #changed to port 8000
ServerAdmin webmas...@djangotest.lc
DocumentRoot "E:/Django/djangotest"
ServerName djangotest.lc
ServerAlias www.djangotest.lc
ErrorLog "logs/djangotest.lc-error.log"
CustomLog "logs/djangotest.lc-access.log" common

Order allow,deny
Allow from all
  

Re: Problem with getting setting up apache server for django

2009-08-14 Thread Graham Dumpleton



On Aug 14, 10:53 pm, NiJoMi  wrote:
> Installed Python 2.6.2 for all users and apache server failed to
> configure mod_wsgi, so I installed
> mod_wsgi-win32-ap22py26-3.0c4.so and renamed it mod_wsgi.so and apache
> configured the mod.
>
> however I am still getting 500 Internal Server Error
>
> testproject.lc-error.log
>
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] mod_wsgi
> (pid=360): Exception occurred processing WSGI script 'E:/Django/
> testproject/apache/django.wsgi'.
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] Traceback (most
> recent call last):
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
> 230, in __call__
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]
> self.load_middleware()
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line
> 33, in load_middleware
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]     for
> middleware_path in settings.MIDDLEWARE_CLASSES:
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\utils\\functional.py", line
> 269, in __getattr__
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]     self._setup
> ()
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\conf\\__init__.py", line 40, in
> _setup
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]
> self._wrapped = Settings(settings_module)
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\conf\\__init__.py", line 75, in
> __init__
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]     raise
> ImportError, "Could not import settings '%s' (Is it on sys.path? Does
> it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
> [Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] ImportError:
> Could not import settings 'testproject.settings' (Is it on sys.path?
> Does it have syntax errors?): No module named testproject.settings

Apache service runs as a special user, are your directories/files
actually readable to others. If they aren't Apache/mod_wsgi may not be
able to access them.

> 
> I have added
> ;C:\Python26;C:\Python26\Tools\Scripts
> to the end of  path in system variables
> and created the system variable PYTHONHOME  value=C:\Python26\Lib\site-
> packages\django

And what official documentation told you to do that. You should not
fiddle either of those. Doing so it just likely to cause problems,
although in this case, because Apache runs as special user, not likely
to stuff things up if you only did this for your own user specific
settings. Put it all back to what it was originally.

> 
> django.wsgi
>
> import os
> import sys
>
> sys.path.append('/usr/local/django')
> sys.path.append('/usr/local/django/testproject')

Above is wrong because that isn't where you have it installed.

> os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
> import django.core.handlers.wsgi
> application = django.core.handlers.wsgi.WSGIHandler()
> 
> I have tried
> sys.path.append('/E:/Django')
> sys.path.append('/E:/Django/testproject')

This is not a valid Windows path, shouldn't have a slash before drives
specifier.

> and
> sys.path.append('E:/Django')
> sys.path.append('E:/Django/testproject')

This looks okay and should work.

Did you restart Apache after making changes to be sure it was picked
up. Although WSGI script file will be reloaded when using mod_wsgi and
it is changed, if you have made a number of accumulated changes the
internal state of the interpreter could have been messed up.

> but I still get the error, something tells me I hav'nt grasped paths.
> --- 
> 
> testproject location:
> E:/Django/testproject
> ---
> django location
> C:\Python26\Lib\site-packages\django
> ---
> when I have this working I will post a tutorial for Python/Django
> dummies like myself.

Please do not go posting a tutorial. Half the problem is that people
who don't really understand what they are doing post their tutorials
and the net gets polluted with them and people can't find the real
documentation in the noise. End result is that they use some ones
partially inaccurate instructions and just get confused, as seems to
be the case for you.

Graham

> I can't thank you enough for all your help.
>
> On 14 Aug, 08:58, Graham Dumpleton  wrote:
>
>
>
> > Reinstall Python with latest Python 2.6 version and this time select
> > option that says 'install for all users' and not the option 'install
> > only for

Re: Problem with getting setting up apache server for django

2009-08-14 Thread NiJoMi

Installed Python 2.6.2 for all users and apache server failed to
configure mod_wsgi, so I installed
mod_wsgi-win32-ap22py26-3.0c4.so and renamed it mod_wsgi.so and apache
configured the mod.

however I am still getting 500 Internal Server Error

testproject.lc-error.log

[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] mod_wsgi
(pid=360): Exception occurred processing WSGI script 'E:/Django/
testproject/apache/django.wsgi'.
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
230, in __call__
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]
self.load_middleware()
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\core\\handlers\\base.py", line
33, in load_middleware
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] for
middleware_path in settings.MIDDLEWARE_CLASSES:
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\utils\\functional.py", line
269, in __getattr__
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] self._setup
()
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\conf\\__init__.py", line 40, in
_setup
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]
self._wrapped = Settings(settings_module)
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\conf\\__init__.py", line 75, in
__init__
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] raise
ImportError, "Could not import settings '%s' (Is it on sys.path? Does
it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
[Fri Aug 14 13:07:42 2009] [error] [client 127.0.0.1] ImportError:
Could not import settings 'testproject.settings' (Is it on sys.path?
Does it have syntax errors?): No module named testproject.settings

I have added
;C:\Python26;C:\Python26\Tools\Scripts
to the end of  path in system variables
and created the system variable PYTHONHOME  value=C:\Python26\Lib\site-
packages\django

django.wsgi

import os
import sys

sys.path.append('/usr/local/django')
sys.path.append('/usr/local/django/testproject')

os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

I have tried
sys.path.append('/E:/Django')
sys.path.append('/E:/Django/testproject')

and
sys.path.append('E:/Django')
sys.path.append('E:/Django/testproject')

but I still get the error, something tells me I hav'nt grasped paths.
---
testproject location:
E:/Django/testproject
---
django location
C:\Python26\Lib\site-packages\django
---
when I have this working I will post a tutorial for Python/Django
dummies like myself.
I can't thank you enough for all your help.

On 14 Aug, 08:58, Graham Dumpleton  wrote:
> Reinstall Python with latest Python 2.6 version and this time select
> option that says 'install for all users' and not the option 'install
> only for current user'. That should fix the problem.
>
> Graham
>
> On Aug 14, 5:22 pm, NiJoMi  wrote:
>
> > Thank you Graham that has cured the access problem but I now get 500
> > Internal Server Error,
>
> > testproject.lc-error.log
>
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
> > (pid=2076): Target WSGI script 'E:/Django/testproject/apache/
> > django.wsgi' cannot be loaded as Python module.
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
> > (pid=2076): Exception occurred processing WSGI script 'E:/Django/
> > testproject/apache/django.wsgi'.
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] Traceback (most
> > recent call last):
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "E:/
> > Django/testproject/apache/django.wsgi", line 5, in 
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     import
> > django.core.handlers.wsgi
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> > \Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
> > 8, in 
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     from django
> > import http
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> > \Python26\\lib\\site-packages\\django\\http\\__init__.py", line 5, in
> > 
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     from urllib
> > import urlencode
> > [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> > \Python26\\lib\\urllib.py", line 26, in 
> >

Re: Problem with getting setting up apache server for django

2009-08-14 Thread Graham Dumpleton

Reinstall Python with latest Python 2.6 version and this time select
option that says 'install for all users' and not the option 'install
only for current user'. That should fix the problem.

Graham

On Aug 14, 5:22 pm, NiJoMi  wrote:
> Thank you Graham that has cured the access problem but I now get 500
> Internal Server Error,
>
> testproject.lc-error.log
>
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
> (pid=2076): Target WSGI script 'E:/Django/testproject/apache/
> django.wsgi' cannot be loaded as Python module.
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
> (pid=2076): Exception occurred processing WSGI script 'E:/Django/
> testproject/apache/django.wsgi'.
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] Traceback (most
> recent call last):
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "E:/
> Django/testproject/apache/django.wsgi", line 5, in 
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     import
> django.core.handlers.wsgi
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
> 8, in 
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     from django
> import http
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\site-packages\\django\\http\\__init__.py", line 5, in
> 
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     from urllib
> import urlencode
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\urllib.py", line 26, in 
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     import
> socket
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
> \Python26\\lib\\socket.py", line 46, in 
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]     import
> _socket
> [Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] ImportError: DLL
> load failed: The specified module could not be found.
>
> Django version is SVN
>
> sorry to be a pain.
>
> On 14 Aug, 06:49, Graham Dumpleton  wrote:
>
>
>
> > On Aug 14, 3:08 pm, NiJoMi  wrote:
>
> > > Hi
> > > I am a complete novice with Django, and have run into a problem
> > > getting it to run on a wamp server.
> > > I have managed to install Python v2.6.1, WampServer2, mod_wsgi,
> > > PostgreSql, psycopg2 and Django onto WindowsXP Professional SP3 in
> > > order to make a local development server.
>
> > > I am able to create a Django test project and use it's inbuilt server
> > > to access the project, so I assume that Python and Django are
> > > correctly installed.
>
> > > The problem is when trying to serve the project from WampServer2 I get
> > > the error 403 Forbidden.
>
> > > -
> > > WampServer2 Components:
>
> > > Apache 2.2.11
> > > PHP 5.3.0
> > > MySQL 5.1.36
> > > Phpmyadmin
> > > -
> > > Install locations:
>
> > > Python
> > > C:\Python26
>
> > > Django
> > > C:\Python26\Lib\site-packages\django
>
> > > WampServer2
> > > C:\imfree
> > > --
> > > Edits to files:
>
> > > httpd.conf
>
> > > added following to top of LoadModule section:
> > > LoadModule wsgi_module modules/mod_wsgi.so
>
> > > uncommented:
> > > Include conf/extra/httpd-vhosts.conf
> > > -
> > > httpd-vhosts.conf
>
> > > commented out examples and added following:
>
> > > 
> > >     ServerAdmin webmas...@localhost
> > >     DocumentRoot "C:/imfree/www"
> > >     ServerName localhost
> > >     #ServerAliaswww.dummy-host.localhost
> > >     ErrorLog "c:/imfree/logs/localhost.log"
> > >     CustomLog "c:/imfree/logs/localhost-access.log" common
> > > 
>
> > > 
> > >    ServerAdmin webmas...@testproject
> > >    DocumentRoot "E:/Django/testproject/apache"
> > >    ServerName testproject.lc
> > >    ErrorLog "c:/imfree/logs/testproject.lc-error.log"
> > >    CustomLog "c:/imfree/logs/testproject.lc-access.log" common
>
> > > WSGIScriptAlias / /usr/local/testproject/apache/django.wsgi
>
> > > 
> > > Order allow,deny
> > > Allow from all
> > > 
>
> > If your Django site is installed in:
>
> >   E:/Django/testproject
>
> > and the WSGI script file in:
>
> >   E:/Django/testproject/apache
>
> > The above should be:
>
> >   WSGIScriptAlias / E:/Django/testproject/apache/django.wsgi
>
> >   
> >   Order allow,deny
> >   Allow from all
> >   
>
> > Graham
>
> > > ---
> > > hosts file
>
> > > added:
>
> > > 127.0.0.1       testproject.lc # django test
> > > ---
> > >  ---
> > > created file E:/Django/testproject/apache/django.wsgi
>
> > > import os, sys
> > > sys.path.append('/usr/local/django')
> > > os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
>
> > > import django.core.handlers.wsgi
>
> 

Re: Problem with getting setting up apache server for django

2009-08-14 Thread NiJoMi

Thank you Graham that has cured the access problem but I now get 500
Internal Server Error,

testproject.lc-error.log

[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
(pid=2076): Target WSGI script 'E:/Django/testproject/apache/
django.wsgi' cannot be loaded as Python module.
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] mod_wsgi
(pid=2076): Exception occurred processing WSGI script 'E:/Django/
testproject/apache/django.wsgi'.
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] Traceback (most
recent call last):
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "E:/
Django/testproject/apache/django.wsgi", line 5, in 
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] import
django.core.handlers.wsgi
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\core\\handlers\\wsgi.py", line
8, in 
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] from django
import http
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\site-packages\\django\\http\\__init__.py", line 5, in

[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] from urllib
import urlencode
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\urllib.py", line 26, in 
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] import
socket
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1]   File "C:\
\Python26\\lib\\socket.py", line 46, in 
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] import
_socket
[Fri Aug 14 08:14:40 2009] [error] [client 127.0.0.1] ImportError: DLL
load failed: The specified module could not be found.

Django version is SVN

sorry to be a pain.


On 14 Aug, 06:49, Graham Dumpleton  wrote:
> On Aug 14, 3:08 pm, NiJoMi  wrote:
>
>
>
> > Hi
> > I am a complete novice with Django, and have run into a problem
> > getting it to run on a wamp server.
> > I have managed to install Python v2.6.1, WampServer2, mod_wsgi,
> > PostgreSql, psycopg2 and Django onto WindowsXP Professional SP3 in
> > order to make a local development server.
>
> > I am able to create a Django test project and use it's inbuilt server
> > to access the project, so I assume that Python and Django are
> > correctly installed.
>
> > The problem is when trying to serve the project from WampServer2 I get
> > the error 403 Forbidden.
>
> > -
> > WampServer2 Components:
>
> > Apache 2.2.11
> > PHP 5.3.0
> > MySQL 5.1.36
> > Phpmyadmin
> > -
> > Install locations:
>
> > Python
> > C:\Python26
>
> > Django
> > C:\Python26\Lib\site-packages\django
>
> > WampServer2
> > C:\imfree
> > --
> > Edits to files:
>
> > httpd.conf
>
> > added following to top of LoadModule section:
> > LoadModule wsgi_module modules/mod_wsgi.so
>
> > uncommented:
> > Include conf/extra/httpd-vhosts.conf
> > -
> > httpd-vhosts.conf
>
> > commented out examples and added following:
>
> > 
> >     ServerAdmin webmas...@localhost
> >     DocumentRoot "C:/imfree/www"
> >     ServerName localhost
> >     #ServerAliaswww.dummy-host.localhost
> >     ErrorLog "c:/imfree/logs/localhost.log"
> >     CustomLog "c:/imfree/logs/localhost-access.log" common
> > 
>
> > 
> >    ServerAdmin webmas...@testproject
> >    DocumentRoot "E:/Django/testproject/apache"
> >    ServerName testproject.lc
> >    ErrorLog "c:/imfree/logs/testproject.lc-error.log"
> >    CustomLog "c:/imfree/logs/testproject.lc-access.log" common
>
> > WSGIScriptAlias / /usr/local/testproject/apache/django.wsgi
>
> > 
> > Order allow,deny
> > Allow from all
> > 
>
> If your Django site is installed in:
>
>   E:/Django/testproject
>
> and the WSGI script file in:
>
>   E:/Django/testproject/apache
>
> The above should be:
>
>   WSGIScriptAlias / E:/Django/testproject/apache/django.wsgi
>
>   
>   Order allow,deny
>   Allow from all
>   
>
> Graham
>
> > ---
> > hosts file
>
> > added:
>
> > 127.0.0.1       testproject.lc # django test
> > --- 
> > ---
> > created file E:/Django/testproject/apache/django.wsgi
>
> > import os, sys
> > sys.path.append('/usr/local/django')
> > os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
>
> > import django.core.handlers.wsgi
>
> > application = django.core.handlers.wsgi.WSGIHandler()
> > --- 
> > --
>
> > the logs:
>
> > apache_error.log
>
> > [Fri Aug 14 05:48:35 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0
> > mod_wsgi/2.5 Python/2.6.1 configured -- resuming normal operations
> > [Fri Aug 14 05:48:35 2009] [notice] Server built: Dec 10 2008 00:10:06
> > [Fri Aug 14 05:48:35 2009] [notice] Parent: Created chil

Re: Problem with getting setting up apache server for django

2009-08-13 Thread Graham Dumpleton



On Aug 14, 3:08 pm, NiJoMi  wrote:
> Hi
> I am a complete novice with Django, and have run into a problem
> getting it to run on a wamp server.
> I have managed to install Python v2.6.1, WampServer2, mod_wsgi,
> PostgreSql, psycopg2 and Django onto WindowsXP Professional SP3 in
> order to make a local development server.
>
> I am able to create a Django test project and use it's inbuilt server
> to access the project, so I assume that Python and Django are
> correctly installed.
>
> The problem is when trying to serve the project from WampServer2 I get
> the error 403 Forbidden.
>
> -
> WampServer2 Components:
>
> Apache 2.2.11
> PHP 5.3.0
> MySQL 5.1.36
> Phpmyadmin
> -
> Install locations:
>
> Python
> C:\Python26
>
> Django
> C:\Python26\Lib\site-packages\django
>
> WampServer2
> C:\imfree
> --
> Edits to files:
>
> httpd.conf
>
> added following to top of LoadModule section:
> LoadModule wsgi_module modules/mod_wsgi.so
>
> uncommented:
> Include conf/extra/httpd-vhosts.conf
> -
> httpd-vhosts.conf
>
> commented out examples and added following:
>
> 
>     ServerAdmin webmas...@localhost
>     DocumentRoot "C:/imfree/www"
>     ServerName localhost
>     #ServerAliaswww.dummy-host.localhost
>     ErrorLog "c:/imfree/logs/localhost.log"
>     CustomLog "c:/imfree/logs/localhost-access.log" common
> 
>
> 
>    ServerAdmin webmas...@testproject
>    DocumentRoot "E:/Django/testproject/apache"
>    ServerName testproject.lc
>    ErrorLog "c:/imfree/logs/testproject.lc-error.log"
>    CustomLog "c:/imfree/logs/testproject.lc-access.log" common
>
> WSGIScriptAlias / /usr/local/testproject/apache/django.wsgi
>
> 
> Order allow,deny
> Allow from all
> 

If your Django site is installed in:

  E:/Django/testproject

and the WSGI script file in:

  E:/Django/testproject/apache

The above should be:

  WSGIScriptAlias / E:/Django/testproject/apache/django.wsgi

  
  Order allow,deny
  Allow from all
  

Graham

> ---
> hosts file
>
> added:
>
> 127.0.0.1       testproject.lc # django test
> --- 
> ---
> created file E:/Django/testproject/apache/django.wsgi
>
> import os, sys
> sys.path.append('/usr/local/django')
> os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
>
> import django.core.handlers.wsgi
>
> application = django.core.handlers.wsgi.WSGIHandler()
> --- 
> --
>
> the logs:
>
> apache_error.log
>
> [Fri Aug 14 05:48:35 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0
> mod_wsgi/2.5 Python/2.6.1 configured -- resuming normal operations
> [Fri Aug 14 05:48:35 2009] [notice] Server built: Dec 10 2008 00:10:06
> [Fri Aug 14 05:48:35 2009] [notice] Parent: Created child process 2924
> [Fri Aug 14 05:48:35 2009] [notice] Child 2924: Child process is
> running
> [Fri Aug 14 05:48:35 2009] [notice] Child 2924: Acquired the start
> mutex.
> [Fri Aug 14 05:48:35 2009] [notice] Child 2924: Starting 64 worker
> threads.
> [Fri Aug 14 05:48:35 2009] [notice] Child 2924: Starting thread to
> listen on port 80.
> [Fri Aug 14 05:48:46 2009] [notice] Parent: Received shutdown signal
> -- Shutting down the server.
> [Fri Aug 14 05:48:46 2009] [notice] Child 2924: Exit event signaled.
> Child process is ending.
> [Fri Aug 14 05:48:47 2009] [notice] Child 2924: Released the start
> mutex
> [Fri Aug 14 05:48:48 2009] [notice] Child 2924: All worker threads
> have exited.
> [Fri Aug 14 05:48:48 2009] [notice] Child 2924: Child process is
> exiting
> [Fri Aug 14 05:48:48 2009] [notice] Parent: Child process exited
> successfully.
> [Fri Aug 14 05:48:48 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0
> mod_wsgi/2.5 Python/2.6.1 configured -- resuming normal operations
> [Fri Aug 14 05:48:48 2009] [notice] Server built: Dec 10 2008 00:10:06
> [Fri Aug 14 05:48:48 2009] [notice] Parent: Created child process 1124
> [Fri Aug 14 05:48:49 2009] [notice] Child 1124: Child process is
> running
> [Fri Aug 14 05:48:49 2009] [notice] Child 1124: Acquired the start
> mutex.
> [Fri Aug 14 05:48:49 2009] [notice] Child 1124: Starting 64 worker
> threads.
> [Fri Aug 14 05:48:49 2009] [notice] Child 1124: Starting thread to
> listen on port 80.
>
> access.log is empty
>
> testproject.lc-error.log
>
> [Fri Aug 14 05:51:14 2009] [error] [client 127.0.0.1] client denied by
> server configuration: C:/usr
>
> testproject.lc-access.log
>
> 127.0.0.1 - - [14/Aug/2009:05:51:14 +0100] "GET / HTTP/1.1" 403 202
> --- 
> -
>
> I hope this is enough info for someone to spot what I am doing wrong
> as I have a project that I would like

Problem with getting setting up apache server for django

2009-08-13 Thread NiJoMi

Hi
I am a complete novice with Django, and have run into a problem
getting it to run on a wamp server.
I have managed to install Python v2.6.1, WampServer2, mod_wsgi,
PostgreSql, psycopg2 and Django onto WindowsXP Professional SP3 in
order to make a local development server.

I am able to create a Django test project and use it's inbuilt server
to access the project, so I assume that Python and Django are
correctly installed.

The problem is when trying to serve the project from WampServer2 I get
the error 403 Forbidden.

-
WampServer2 Components:

Apache 2.2.11
PHP 5.3.0
MySQL 5.1.36
Phpmyadmin
-
Install locations:

Python
C:\Python26

Django
C:\Python26\Lib\site-packages\django

WampServer2
C:\imfree
--
Edits to files:

httpd.conf

added following to top of LoadModule section:
LoadModule wsgi_module modules/mod_wsgi.so

uncommented:
Include conf/extra/httpd-vhosts.conf
-
httpd-vhosts.conf

commented out examples and added following:


ServerAdmin webmas...@localhost
DocumentRoot "C:/imfree/www"
ServerName localhost
#ServerAlias www.dummy-host.localhost
ErrorLog "c:/imfree/logs/localhost.log"
CustomLog "c:/imfree/logs/localhost-access.log" common



   ServerAdmin webmas...@testproject
   DocumentRoot "E:/Django/testproject/apache"
   ServerName testproject.lc
   ErrorLog "c:/imfree/logs/testproject.lc-error.log"
   CustomLog "c:/imfree/logs/testproject.lc-access.log" common

WSGIScriptAlias / /usr/local/testproject/apache/django.wsgi


Order allow,deny
Allow from all

---
hosts file

added:

127.0.0.1   testproject.lc # django test
--
created file E:/Django/testproject/apache/django.wsgi

import os, sys
sys.path.append('/usr/local/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()
-

the logs:

apache_error.log

[Fri Aug 14 05:48:35 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0
mod_wsgi/2.5 Python/2.6.1 configured -- resuming normal operations
[Fri Aug 14 05:48:35 2009] [notice] Server built: Dec 10 2008 00:10:06
[Fri Aug 14 05:48:35 2009] [notice] Parent: Created child process 2924
[Fri Aug 14 05:48:35 2009] [notice] Child 2924: Child process is
running
[Fri Aug 14 05:48:35 2009] [notice] Child 2924: Acquired the start
mutex.
[Fri Aug 14 05:48:35 2009] [notice] Child 2924: Starting 64 worker
threads.
[Fri Aug 14 05:48:35 2009] [notice] Child 2924: Starting thread to
listen on port 80.
[Fri Aug 14 05:48:46 2009] [notice] Parent: Received shutdown signal
-- Shutting down the server.
[Fri Aug 14 05:48:46 2009] [notice] Child 2924: Exit event signaled.
Child process is ending.
[Fri Aug 14 05:48:47 2009] [notice] Child 2924: Released the start
mutex
[Fri Aug 14 05:48:48 2009] [notice] Child 2924: All worker threads
have exited.
[Fri Aug 14 05:48:48 2009] [notice] Child 2924: Child process is
exiting
[Fri Aug 14 05:48:48 2009] [notice] Parent: Child process exited
successfully.
[Fri Aug 14 05:48:48 2009] [notice] Apache/2.2.11 (Win32) PHP/5.3.0
mod_wsgi/2.5 Python/2.6.1 configured -- resuming normal operations
[Fri Aug 14 05:48:48 2009] [notice] Server built: Dec 10 2008 00:10:06
[Fri Aug 14 05:48:48 2009] [notice] Parent: Created child process 1124
[Fri Aug 14 05:48:49 2009] [notice] Child 1124: Child process is
running
[Fri Aug 14 05:48:49 2009] [notice] Child 1124: Acquired the start
mutex.
[Fri Aug 14 05:48:49 2009] [notice] Child 1124: Starting 64 worker
threads.
[Fri Aug 14 05:48:49 2009] [notice] Child 1124: Starting thread to
listen on port 80.

access.log is empty

testproject.lc-error.log

[Fri Aug 14 05:51:14 2009] [error] [client 127.0.0.1] client denied by
server configuration: C:/usr

testproject.lc-access.log

127.0.0.1 - - [14/Aug/2009:05:51:14 +0100] "GET / HTTP/1.1" 403 202


I hope this is enough info for someone to spot what I am doing wrong
as I have a project that I would like to develop with django.

Thank you for your time.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---