Server setup w/wo PyCharm

14 views
Skip to first unread message

somada141

unread,
Sep 25, 2014, 7:52:04 AM9/25/14
to mun...@googlegroups.com
Hi all,

I have no experience in web-apps with or without Muntjac. Upon installing muntjac, running the tests, and checking the sampler, I put together a simple file containing the 'hello world' code as shown on the website and below: 

class HelloWorld(Application):

    def init(self):
        main = Window('Hello window')
        self.setMainWindow(main)

        main.addComponent(Label('Hello World!'))

wsgi_app = ApplicationServlet(HelloWorld, debug=True)

wsgi_app = paste.session.SessionMiddleware(wsgi_app)

httpd = make_server('localhost', 8080, wsgi_app)
httpd.serve_forever()

After running it everything goes well but upon killing the process with Ctrl+C, I tried amending the file, and re-running, but I got an error that the address was taken. Clearly, the server wasn't killed. Can someone explain to me what the procedure to work with muntjac is? Do I need to somehow kill the server and restart it through Python? How do I 'refresh' the application that will be ran by the servlet? 

I've also been working a lot with PyCharm on non-web Python code. PyCharm has built-in support for working with different servers and works great with Django, Flask, etc but I can't figure out how to make it work with muntjac. Does anyone know how to do it?

Thanks a lot!

Richard Lincoln

unread,
Sep 25, 2014, 8:09:02 AM9/25/14
to mun...@googlegroups.com

This might be due to your session being preserved using cookies.

Try Ctrl+F5 or using Incognito mode.

--
You received this message because you are subscribed to the Google Groups "muntjac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to muntjac+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

somada141

unread,
Sep 25, 2014, 8:36:41 AM9/25/14
to mun...@googlegroups.com
So is the server actually stopped upon killing the process? Am I not supposed to stop it with just a typical Ctrl+C (just reminding you that I'm a complete noob at these)? 
Also are those 4 lines after the derived Application class supposed to be re-ran every time?

Richard Lincoln

unread,
Sep 25, 2014, 9:06:37 AM9/25/14
to mun...@googlegroups.com
The server will be stopped using Ctrl-C.  You should be able to stop and start it as much as you like.  If you use something like Google App Engine it will notice changes to your files and restart the server automatically.

Incognito mode is often very useful for web development as you can close the window and all session data is discarded.

somada141

unread,
Sep 25, 2014, 9:21:30 AM9/25/14
to mun...@googlegroups.com
Fantastic! Thanks a lot Richard (I had no idea whatsoever)!
Reply all
Reply to author
Forward
0 new messages