0

I've been reading some info about django and I saw some youtube videos about websites made with django but I don't really understand what it really is, so I have a question. If for example I had an script named script.py that given an url, let's say: http://www.stackoverflow.com printed in console http://www.stackoverflow.com/questions , would i use django to make this script runnable from the website and the "print" would be in the website itself? I know I would have to change the code to insted of print create an html tag like <p>http://www.stackoverflow.com/</p> or something like this. Thanks.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
lpares12
  • 3,504
  • 4
  • 24
  • 45

1 Answers1

0

It depends!

If you're just doing simple forms and scripts, you could check out the Python CGI modules. This would suffice for your example above.

If you want to do more complex stuff, I highly recommend using a microframework such as flask. This will make scripting very easy, and there are a number of extensions you can use to streamline your code further.

afischer
  • 61
  • 3
  • so django is not useful for what I want to do? I'd also make connections to some mysql database – lpares12 Jan 07 '15 at 13:15
  • no actually i didn't said `django is not userful`. I said `Django is very powerful` .... – Raja Simon Jan 07 '15 at 13:18
  • @lluk12 see this link for setting up mysql http://stackoverflow.com/a/19189930/3762142 – Raja Simon Jan 07 '15 at 13:20
  • Django is a templating web language that is included with Flask. You can use mysql commands within your python code, which can then output to a Django template. Django's learning curve is very nice—If you find it useful, I think you will find you will pick it up rather quickly. – afischer Jan 08 '15 at 14:03