running Apache + Bottle + Python

后端 未结 4 1767
夕颜
夕颜 2020-12-16 01:20

I\'m trying to run Bottle.py with Apache and mod_wsgi.

I\'m running it on windows, using a xampp. python v2.7

My Apache config in httpd:

<         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 02:15

    i'm adding my conclusion for people who will have the same problem as i did: like Kneel-Before-ZOD and ron.rothman, i had to write my code in the WSGI file since python is running the code from there, BUT if you want to get your own py files you have to IMPORT them from the WSGI files like that:

    from hello import application
    

    the "hello" is the python FILE NAME and the "application" is the like you should write in you py file and NOT in wsgi:

    application = bottle.default_app()
    

    also had to restart apache every time i made a change(and i didn't know that - that why its made me crazy). tnx for the guys who helped me. GooLuck.

提交回复
热议问题