views:

380

answers:

11

Hello there,

I'm looking for a suitable cross-platform web framework (if that's the proper term). I need something that doesn't rely on knowing the server's address or the absolute path to the files. Ideally it would come with a (development) server and be widely supported.

I've already tried PHP, Django and web2py. Django had an admin panel, required too much information (like server's address or ip) and felt unpleasant to work with; PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly; web2py crashed upon compiling and the manual didn't cover that -- not to mention it required using the admin panel. Python is probably the way to go, but even the amount of different web frameworks and distributions for Python is too much for me to install and test individually.

What I need is a simple and effective cross-platform web development language that works pretty much anywhere. No useless admin panels, no fancy user interfaces, no databases (necessarily), no restrictions like users/access/levels and certainly no "Web 2.0" crap (for I hate that retronym). Just an all-powerful file and request parser.

I'm used to programming in C and other low level languages, so difficulty is not a problem.

A: 

I'd say Ruby on Rails is what you're looking for. Works anywhere, and no configuration needed. You only have it installed, install the gems you need, and off you go.

I also use ColdFusion, which is totally multi-platform, but relies on the Administrator settings for DSN configuration and stuff.

Marcos Placona
A: 

TurboGears: Everything optional.

Ignacio Vazquez-Abrams
A: 

think u need to focus on restful web applications. Zend is a php based mvc framework.

deostroll
REST has nothing to do with the OP's question
jcdyer
author did say "I need something that doesn't rely on knowing the server's address or the absolute path to the files". Thot the latter part comes under the purview of REST...
deostroll
+2  A: 

I think you need to be more specific about what you want to achieve, and what kind of product(s) you want to develop. A "no setup required" product may come with tons of auto-configuration bloat, while a framework requiring a small setup file could be set up in minutes, too, with much more simplicity in the long run. There is also always going to be some security and access rights to be taken into consideration, simply because the web is an open place.

Also, a framework supporting Web 2.0ish things doesn't have to be automatically a bad framework. Don't throw away good options because they also do things you don't like or need, as long as they allow you to work without them.

PHP had chown and chmod conflicts with the server (the code couldn't access uploaded files or vice versa) and couldn't handle urls properly;

PHP is not a framework in itself, it's a programming language. I don't know which PHP-based framework or product you tried but all the problems you describe are solvable, and not unique to PHP. If you like the language, maybe give it another shot. Related SO questions:

If you need something that runs everywhere (i.e. on as many servers as possible) PHP will naturally have to be your first choice, simply because it beats every other platform in terms of cheap hosting availability.

If I were you, I wouldn't limit my options that much at this point, though. I hear a lot of good things about Django, for example. Also, the Google App engine is an interesting, scalable platform to do web work with, supporting a number of languages.

Pekka
A: 

Give bottle a try. I use it for my simple no-frills webapps. It is very intuitive and easy to work with in my experience.

Here is some sample code, and it requires just bottle.py, no other dependencies.

from bottle import route, run

@route('/')
def index():
    return 'Hello World!'

run(host='localhost', port=8080)
freespace
+1  A: 

Werkzeug:

import werkzeug

@werkzeug.Request.application
def app(request):
  return werkzeug.Response("Hello, World!")

werkzeug.run_simple("0.0.0.0", 4000, app)

You can optionally use werkzeug URL routing (or your own, or anything from any other framework). You can use any ORM or template engine for Python you want (including those from other Python frameworks) etc.

Basically it's just Request and Response objects built around WSGI plus some utilities. There are more similar libraries available in Python (for example webob or CherryPy).

Messa
+4  A: 

This question is based on a complete failure to understand any of the tools you have apparently "investigated", or indeed web serving generally.

Django has an admin panel? Well, don't use it if you don't want to. There's no configuration that needs to be done there, it's for managing your data if you want.

PHP has chown problems? PHP is a language, not a framework. If you try and run something with it, you'll need to set permissions appropriately. This would be the case whatever language you use.

You want something that doesn't need to know its address or where its files are? What does that even mean? If you are setting up a webserver, it needs to know what address to respond to. Then it needs to know what code to run in response to a request. Without configuring somewhere the address and the path to the files, nothing can ever happen.

Daniel Roseman
A: 

Just stumbled upon Quixote recently. Never used it though.

Didier Trosset
+2  A: 

In web2py you do not need to use the admin interface. It is optional. Here is how you create a simple app from zero:

 wget http://web2py.com/examples/static/web2py_src.zip
 unzip web2py_src.zip
 cd web2py/applications
 mkdir myapp
 cp -r ../welcome/* ./

Optional Edit your app

 emacs controllers/default.py 
 emacs models/db.py 
 emacs views/default/index.html
 ...

(you can delete everything in there you do not need). Now run web2py and try it out

 cd ../..
 python web2py.py -i 127.0.0.1 -p 8000 -a chooseapassword &
 wget http://127.0.0.1:8000/myapp/default/index.html

When you edit controller/default.py you have a controller for example

 def index():
      the_input = request.vars # this is parsed from URL
      return dict(a=3,b=5,c="hello")

You can return a dict (will be parsed by the view with same name as action) or a string (the actual page content). For example:

 def index():
      name = request.vars.name or 'anonymous'
      return "hello "+name

and call

 wget http://127.0.0.1:8000/myapp/default/index?name=Max

returns

 'hello Max'

/myapp/default/index?name=Max calls the function index, of the controller default.py of the application in folder applications/myapp/ and passes name=Max into request.vars.name='Max'.

mdipierro
A: 

Use plain old ASP. IIS does not care where files are stored. All paths can be set relative from the virtual directory. That means you can include "/myproject/myfile.asp", whereas in PHP it's often done using relative paths. Global.asa then contains global configuration for the application. You hardly ever have to worry about relative paths in the code.

In PHP you'd have include(dirname(FILE) . '/../../myfile.php") which is of course fugly. The only 'solution' I found for this is making HTML files and then using SSI (server side includes).

The only downside to ASP is the availability, since it has to run on Windows. But ASP files just run, and there's not complex Linux configuration to worry about. The language VBScript is extremely simple, but you can also choose to write server side JavaScript, since you're familiar with C.

Michiel van der Blonk
+1  A: 

What I need is a simple and effective cross-platform web development language that works pretty much anywhere.

Have you tried HTML?

But seriously, I think Pekka is right when he says you need to specify and clarify what you want. Most of the features you don't want are standard modules of a web app (user and role mgmt., data binding, persistence, interfaces).

We use any or a mix of the following depending on customer requirements: perl, PHP, Flash, Moonlight, JSP, JavaScript, Java, (D/X)HTML, zk.

FuePi