Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread Robin Fordham
> Very cool. > > Please post some notes about whole thign. Not as cool as it may sound, more me playing and trying to learn a bit of digital electronics and improve my coding skills. Video of my setup; http://youtu.be/MFISZPqdbD4 My code (note this is just the python object, django side of it

Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread George Silva
Very cool. Please post some notes about whole thign. On Fri, Feb 15, 2013 at 2:34 PM, Robin Fordham wrote: > Hi guys, > > Thanks for all the pointers! > > George / Bob - That's exactly the pointer I needed 'exec' or 'eval' > > Ryan - Celery is something I have been

Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread Robin Fordham
Hi guys, Thanks for all the pointers! George / Bob - That's exactly the pointer I needed 'exec' or 'eval' Ryan - Celery is something I have been looking into, but I hadn't thought of using it to to put processes in a sandbox; I have a raspberry pi project with an array of LEDs and am

Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread bobhaugen
I found this useful in doing something like that: http://lybniz2.sourceforge.net/safeeval.html http://effbot.org/zone/librarybook-core-eval.htm -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread Ryan Nowakowski
Robin, You could store that code as a string in the database. Then to run it you could execute it asynchronously using something like django-celery. Have celery fork off a separate python process for each instance of code execution. By running code asynchronously, badly behaved code(loop

Django project - Allow users to write a custom function and store in DB

2013-02-15 Thread Robin Fordham
Hi, I want to be able to allow users to write a custom function/object and save it to the database, so django can call up the function when needed. I am aware of potential issues of users writing functions that could break and/or exploit my app, this for internal use and can write some tests