Using Django as a framework to deploy python script on a website:

28 views
Skip to first unread message

Eran Ariel

unread,
Jun 14, 2014, 12:22:24 PM6/14/14
to django...@googlegroups.com

Hi, I am interested in Django as a platform to deploy applications using mod_wsgi, accordingly, whether existing Django libraries such as the forms library could be applied for this purpose as user initiated POST requests – to pass the variables.  I can place my scripts within the models.py file, accordingly, the script runs at the shell upon running "python manage.py runserver" command, however, I cannot see any output at http://localhost/8000 (at least for now).

How do I get my python application "browser enabled"? 

 

Daniel Roseman

unread,
Jun 14, 2014, 12:26:14 PM6/14/14
to django...@googlegroups.com
On Saturday, 14 June 2014 17:22:24 UTC+1, Eran Ariel wrote:

Hi, I am interested in Django as a platform to deploy applications using mod_wsgi, accordingly, whether existing Django libraries such as the forms library could be applied for this purpose as user initiated POST requests – to pass the variables.  I can place my scripts within the models.py file, accordingly, the script runs at the shell upon running "python manage.py runserver" command, however, I cannot see any output at http://localhost/8000 (at least for now).

How do I get my python application "browser enabled"? 

 

Your question is not very clear. In particular, I don't understand why you have put your code in models.py - that's for database models and their associated logic.

Django, like all web frameworks, operates on the basis of HTTP requests and responses. That is, a user makes a request over the web (usually via a browser), and Django returns a response which is displayed. If you want to make your script "web-enabled", then you need to fit it within that request-response cycle. That usually means calling it from a view.
--
DR.
Reply all
Reply to author
Forward
0 new messages