473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Python framework questions

mp
Hello, I have a couple general questions.

First, how do most web frameworks serve html? I'm coding in python and
I want to keep all my html seperate from my python stuff. I can serve
these html files from a mysql database or just from the file system, do
people use both these options? Are there other options?

Second, is a cgi-bin directory really necessary? Are there security
issues with configuring Apache to allow cgi-bin execution in other
directories?

Thanks
MP

Jul 5 '06 #1
2 1079

mp wrote:
Hello, I have a couple general questions.

First, how do most web frameworks serve html? I'm coding in python and
I want to keep all my html seperate from my python stuff. I can serve
these html files from a mysql database or just from the file system, do
people use both these options? Are there other options?
most web frameworks generate html from some kind of templates.
templates for very much like html but you can substitute some text
dynamically at runtime. you may also be able to do conditionals and
loops inside templates.

if you want to get a feel of it, try web.py (http://webpy.org). web.py
is a very simple and powerful web framework.
Second, is a cgi-bin directory really necessary? Are there security
issues with configuring Apache to allow cgi-bin execution in other
directories?
i am not an apache expert.

but to the best of my knowledge, there should not be any problems. it
will be slower because for handling each request a new process has to
be created.

Anand

Jul 6 '06 #2
mp wrote:
Hello, I have a couple general questions.

First, how do most web frameworks serve html? I'm coding in python and
I want to keep all my html seperate from my python stuff. I can serve
these html files from a mysql database or just from the file system, do
people use both these options? Are there other options?
The basic idea of templates is that you write something like:

<h1>{{ HEADLINE }}</h1>
<p>by {{ AUTHOR }}</p>
<p>{{ STORY }}</p>

and the web framework fills in the blanks. No need to store templates
in a SQL database; they are just files.
>
Second, is a cgi-bin directory really necessary? Are there security
issues with configuring Apache to allow cgi-bin execution in other
directories?
Not only unnecessary but unadvisable. It's very 1995, quite out of
fashion now. Read Tim Berners-Lee's article on "Cool URIs." URIs
should just describe content. They are for the user's benefit, not
yours. They are not a place to remind yourself where you stored code,
or what language you write in (hello, .php, .asp, .pl, and .py), or how
your web server gateways with your code.

Jul 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Ubaidullah Nubar | last post by:
Hi, How well is Python suited for developing database based applications? I am new to Python so please bear with me if some of the questions are too simple. I specifically have the following...
0
by: Emile van Sebille | last post by:
QOTW (in the OS agnostic category): "There is a (very popular) Python package out there which exposes the win32 api. I'm not sure what it's called. (win32api? pythonwin? win32all?)" -- Francis...
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
0
by: Neil Benn | last post by:
Hello, I'm attempting to determine what paths I would need on a win32, Linux, OSX box to run python. This should be a vanilla python with no extra packages (including tk). The paths I have...
1
by: John Chambers | last post by:
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13...
0
by: Magnus Lycka | last post by:
QOTW: "The IEEE-754 standard doesn't wholly define output conversions, and explicitly allows that a conforming implementation may produce any digits whatsoever at and after the 18th signficant...
13
by: aum | last post by:
Hi, I'm a Python programmer, just starting to get into javascript. On reading some of the js guides, and not liking any of the OO usage patterns I saw, I've cooked up something which python...
0
by: has | last post by:
Hi all, need a little bit of advice on dynamically binding an embedded Python interpreter. First, the code for anyone that wants a look: ...
7
by: sami | last post by:
Hi I am trying to write a facebook application in python - I have been programming simple desktop applications till now and am not really familiar with web apps Pyfacebook is the wrapper for...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.