mod_wsgi not compatible with Wamp 2.4 and python 3.4.3

2016-04-05 Thread asimkon .
I am using Apache to develop Python Web applications via Django. As i am
new to python web development, i am having problem to find the right
version for mod_wsgi.so (compiled version for Apache 2.4.4 - WampServer 2.4
- and python 3.4.3 latest version from ActivePython on Windows x86) and i
get a 500 internal server error "The server encountered an internal error
or misconfiguration and was unable to complete your request".

when i try to run the following script:

def application(environment, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/html')]
start_response(status, response_headers)
page = """


Hello world!
This is being served using mod_wsgi


"""
return page

I just found the following link
http://grapevine.dyndns-ip.com/download/folder.asp?eid=33&folder=%2Fdownload%2Fapache%2Fmod_wsgi-windows-4.4.6%2Fmod_wsgi-windows-4.4.6%2Fapache24-win32-vc10%2Fmodules%2F
but unfortunately i have got incompatibility problems with the compiled
files mentioned. Any kind of help would be convenient to me.

I am looking for the compiled (.so file) version, as it will save me from a
lot of trouble.

Regards
Kostas  Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: mod_wsgi not compatible with Wamp 2.4 and python 3.4.3

2016-04-06 Thread asimkon .
I managed to connect Apache 2.2 with django framework successfully using
Python 2.7 and mod_wsgi.so (Apache module) thanks to the instructions from
https://pusonchen.wordpress.com/2013/06/03/build-django-website-with-apache-mod_wsgi-on-windows/.
The problem is that i see the Django project Web page using localhost or
127.0.0.1 in my browser.
 I want to change it to localhost/mysite as i have built other projects in
php with Apache (WampServer) using Cakephp and other php scripts. Is there
any way or i will have to sacrifice my entire Apache Web server for just
only Django project?
Afterwards i just download https://dev.mysql.com/downloads/connector/python/
 (MySQL driver) install it and play with syncdb to create tables in my
MySQL database. I create the db using phpmyadmin and import the info in my
settings.py django project folder.

Regards
Kostas Asimakopoulos

On Wed, Apr 6, 2016 at 8:13 AM, asimkon .  wrote:

> Thanks for your reply! Unfortunately i am working on Windows and i think
> gunicorn is not compatible with that OS, Any other known WSGI server for
> Windows otherwise i will have to work with python 2.7.
>
> Regards
>
>
> On Tue, Apr 5, 2016 at 11:20 PM, justin walters <
> walters.justi...@gmail.com> wrote:
>
>>
>> On Apr 5, 2016 12:51 PM, "asimkon ."  wrote:
>> >
>> > I am using Apache to develop Python Web applications via Django. As i am
>> > new to python web development, i am having problem to find the right
>> > version for mod_wsgi.so (compiled version for Apache 2.4.4 - WampServer
>> 2.4
>> > - and python 3.4.3 latest version from ActivePython on Windows x86) and
>> i
>> > get a 500 internal server error "The server encountered an internal
>> error
>> > or misconfiguration and was unable to complete your request".
>> >
>> > when i try to run the following script:
>> >
>> > def application(environment, start_response):
>> > status = '200 OK'
>> > response_headers = [('Content-type', 'text/html')]
>> > start_response(status, response_headers)
>> > page = """
>> > 
>> > 
>> > Hello world!
>> > This is being served using mod_wsgi
>> > 
>> > 
>> > """
>> > return page
>> >
>> > I just found the following link
>> >
>> http://grapevine.dyndns-ip.com/download/folder.asp?eid=33&folder=%2Fdownload%2Fapache%2Fmod_wsgi-windows-4.4.6%2Fmod_wsgi-windows-4.4.6%2Fapache24-win32-vc10%2Fmodules%2F
>> > but unfortunately i have got incompatibility problems with the compiled
>> > files mentioned. Any kind of help would be convenient to me.
>> >
>> > I am looking for the compiled (.so file) version, as it will save me
>> from a
>> > lot of trouble.
>> >
>> > Regards
>> > Kostas  Asimakopoulos
>> > --
>> > https://mail.python.org/mailman/listinfo/python-list
>>
>> Have you tried using apache as a proxy server to forward requests to a
>> dedicated wsgi server such as gunicorn instead of using mod_wsgi? I find
>> it's a lot easier to set up.
>>
>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


MySQL - Django can not display international characters

2016-04-08 Thread asimkon .
I have connected successfully MySQL with Django after installing MySQL
module via easy_install command. But unfortunately I have a problem setting
mysql db to properly recognise greek characters in django. In my setting.py
file I have included the following options:

'OPTIONS': { 'charset': 'utf8', 'use_unicode': True, }, } instead of utf8
in the charset I tried using windows-1253 and iso-8859-1 but with no
results.

I have stored database records successfully in greek via CMD, but when i
try to do the opposite in CMD again via ORM i get strange characters. Any
kind of help?


Regards
Kostas Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list


Static files load problem Django 1.9

2016-04-15 Thread asimkon .
I have got a problem with static files regarding Django 1.9. These files
are (js,css)  in the standard folder static, inside project folder
directory. I got an error Http 404 that can not be loaded.

Project folder / static / css / several files *.css
/static / js / several files   *.js
 several_apps

i have executed the python manage.py collectstatic

settings.py

STATIC_URL = '/static/'

STATIC_ROOT = os.path.join(BASE_DIR, "static")

STATICFILES_DIRS = (

os.path.join(BASE_DIR, 'static'),
)

and of course  as INSTALLED_APPS

'django.contrib.staticfiles',

Sorry for my template (at the beginning of my work):

{% load  staticfiles %}





 
 
 











but i am afraid the problem lies in urls.py (i do not know what to do)

http://127.0.0.1:8000/static/css/file_name  (in the firebug  network) but i
can not open it directly via server.

urls.py

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^hello/','category.views.hello'),
]


Any kind of help would be convenient to me?

Kind Regards
Kostas Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list


Django - tastypie - jqgrid Wrapper (installation - manual)

2016-04-19 Thread asimkon .
I would like to use the following wrapper
 in one of my Django
models, but unfortunately i do not know how to do it due to the lack of
sufficient information. I run on my machine Djnago 1.9, tastypi via
easy_install, Apache via mod_wsgi and MySQL.
After installing all these i do not know how to proceed step 1, step 2 etc
in order to use the demo code mentioned in the above page and finally work
successfully. Further details about the type of fields and how could be
used in grids.py (additional information) would help me a lot. I found the
author's github page  but unfortunately there
is contact information to get in touch with him.

If anyone knows so much about it, i would be delighted!

Regards
Kostas Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list


djqgrid 0.2.4 error import json_helpers

2016-04-20 Thread asimkon .
Hello!

I want to use this wrapper <https://pypi.python.org/pypi/djqgrid/0.2.4> for
a module in my Django 1.9.4 version. I have configured all the steps
mentioned successfully but in the end i get the following error message in
my browser:

Invalid template library specified. ImportError raised when trying to
load 'djqgrid.templatetags.djqgrid': cannot import name json_helpers


Inside my templatetags folder  (djqgrid.py),  i have the following commands:

from django import template
from djqgrid import json_helpers

Any idea to get a solution ?

I sent a few emails to the author of this wrapper but i have not got a
reply yet!

Regards
Kostas Asimakopoulos
Twitter @asimkon
-- 
https://mail.python.org/mailman/listinfo/python-list


mod_python compilation error in VS 2008 for py2.7.1

2016-06-14 Thread asimkon
I would like to ask you a technical question regarding python module
compilation for python 2.7.1.

I want to compile mod_python
library
for Apache 2.2 and py2.7  on Win32 in
order to use it for  psp - py scripts that i have written. I tried to
compile it using VS 2008 (VC++) and unfortunately i get an error on
pyconfig.h (Py2.7/include) error C2632: int followed by int  is illegal.

This problem occurs when i try to run the bat file that exists on
mod_python/dist folder. Any idea or suggestion what should i do in order to
run it on Win 7 Pro (win 32) environment and produce the final apache
executable module (.so).

 I have posted the same question here
,
but unfortunately i had had no luck!


Additionally i give you the compilation instructions that i follow (used
also MinGW-w64 and get the same error) in order to produce the final output!

Compiling

Open a command prompt with VS2008 support. The easiest way to do this is to
use "Start | All Programs | Microsoft Visual Studio 2008 | Visual Studio
Tools | Visual Studio 2008 Command Prompt". (This puts the VS2008 binaries
in the path and sets up the lib/include environmental variables for the
Platform SDK.)

1.cd to the mod_python\dist folder.

2.Tell mod_python where Apache is: set APACHESRC=C:\Apache

3. Run build_installer.bat.

If it succeeds, an installer.exe will be created in a subfolder. Run that
install the module.


Kind  Regards

Kostas Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list


mod_python compilation error

2016-06-16 Thread asimkon
Regarding my blog post
, i would like to
inform you that someone helped me to overcome this error but i got another
one that i do not know it's meaning:

error: [Errno 22] invalid mode ('wb') or filename: "dist\\mod_python-'{'
\x9b\x9
c\xa4 \x98\xa4\x98\x9a\xa4\xe0\xa8\xe5\x9d\x9c\xab\x98\xa0 \xe0\xaa
\x9c\xa9\xe0
\xab\x9c\xa8\xa0\xa1\xe3 \xe3 \x9c\xa5\xe0\xab\x9c\xa8\xa0\xa1\xe3
\x9c\xa4\xab\
xa6\xa2\xe3,\n\x9c\xa1\xab\x9c\xa2\xe2\xa9\xa0\xa3\xa6
\xa7\xa8\xe6\x9a\xa8\x98\
xa3\xa3\x98 \xe3 \x98\xa8\xae\x9c\xe5\xa6 \x9b\xe2\xa9\xa3\x9e\xaa
\x9c\xa4\x9c\
xa8\x9a\x9c\xa0\xe9\xa4..win32-py2.7.exe"


Any idea would help me a lot?

Regards
Kostas Asimakopoulos
-- 
https://mail.python.org/mailman/listinfo/python-list