Simple and efficient web structure

I am looking for a suitable cross-platform web framework (if that is the right term). I need something that does not depend on knowing the server address or the absolute path to the files. Ideally, it will come with a development (development) server and will be widely supported.

I have already tried PHP, Django and web2py. Django had an admin panel, it required too much information (for example, server address or ip) and it was unpleasant to work; PHP had chown and chmod conflicts with the server (the code could not access the downloaded files or vice versa) and could not correctly handle the URLs; web2py crashed during compilation, and the manual did not cover this, not to mention the need to use the admin panel. Python may be the way to go, but even the number of different Python web frameworks and distributions is too much for me to install and test individually.

I need a simple and effective cross-platform web development language that works almost everywhere. There are no useless admin panels, no attractive user interfaces, no databases (required), no restrictions like users / access / levels and, of course, no "Web 2.0" crap (because I hate this retronym). Just a powerful file and query editor.

I use programming in C and other low-level languages, so the problem is not a problem.

+4
source share
12 answers

I think you need to be more specific about what you want to achieve and which product you want to develop. A non-installation product can come with tons of automatic configuration, while an infrastructure that requires a small installation file can be installed in minutes with much greater simplicity in the long run. Also, you should always consider some rights to security and access, simply because the Internet is an open place.

In addition, a framework that supports Web 2.0ish does not have to be automatically bad. Don’t throw away the good options, because they also do what you don’t like or need if they allow you to work without them.

PHP had chown and chmod conflicts with the server (the code could not access the downloaded files or vice versa) and could not correctly handle the URLs;

PHP is not a foundation in itself; it is a programming language. I don’t know which PHP-based platform or product you tried, but all the problems that you describe are solvable and not unique to PHP. If you like this language, maybe he will take another shot. Related questions:

If you need something that works everywhere (i.e., on as many servers as possible), PHP should naturally be your first choice, simply because it surpasses any other platform in terms of cheap hosting availability.

If I were you, I would not limit my possibilities in this matter. For example, I hear a lot of good things about Django. In addition, the Google App engine is an interesting scalable platform for working on the Internet with support for several languages,

+2
source

This question is based on a complete misunderstanding of any of the tools that you seem to have "researched", or indeed the web services as a whole.

Does Django have an admin panel? Well, do not use it if you do not want it. There is no configuration that needs to be done there to manage your data if you want.

Does PHP have problems with chown? PHP is a language, not a framework. If you try to run something with it, you will need to set permissions accordingly. This will be the case that you are using.

Do you need something that does not need to know its address or where are its files? What does that even mean? If you are setting up a web server, it must know which address to respond to. Then he must know what code should be executed in response to the request. Without setting the address and file path somewhere, nothing can happen.

+5
source

In web2py you do not need to use the admin interface. It's not obligatory. Here's how you create a simple application from scratch:

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

Advanced Change application

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

(you can delete everything that you do not need). Now run web2py and try

  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 editing the controller /default.py you have a controller like

  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 the same name as the action) or a string (the actual content of the page). For instance:

  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 index of the function, the default.py controller of the application in the applications of the / myapp / folder, and passes name = Max to request.vars.name = 'Max'.

+4
source

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 something from any other structure). You can use any ORM mechanism or Python template that you want (including from other Python frameworks), etc.

Basically these are just Request and Response objects built around WSGI plus some utilities. Python has more similar libraries (like webob or CherryPy ).

+1
source

I need a simple and effective cross-platform web development language that works almost anywhere.

Have you tried HTML?

But seriously, I think Pekka is right when he says that you need to specify and clarify what you want. Most of the functions that you do not need are standard web application modules (user and role mgmt., Data binding, persistence, interfaces).

Depending on customer requirements, we use any or the following combinations: perl, PHP, Flash, Moonlight, JSP, JavaScript, Java, (D / X) HTML, zk.

+1
source

I am new to python, but an experienced PHP developer for 12 years, but I have to admit that I switched to python from outside the scope for bottles . I am African, so you do not need to be smarter to use it ... Try it, you will like it. Hey, and it also works on appspot without configuration!

  • Install python
  • Download bottle.py (single file)
  • Create

      #your file name: index.py
     from bottle import route, run
    
     @route ('/')
     def index ():
         return 'jambo kenya!  hakuna matata na bottle.  hehehe '
     run () 
  • Relax, sip cocoa and smile :)
+1
source

I would say that Ruby on Rails is what you are looking for. It works everywhere and no configuration is required. You just installed it, install the stones you need and release it.

I also use ColdFusion, which is fully multi-platform, but uses admin settings to configure DSN and more.

0
source

TurboGears : everything is optional.

0
source

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

Here is a sample code that just needs bottle.py , no other dependencies.

 from bottle import route, run @route('/') def index(): return 'Hello World!' run(host='localhost', port=8080) 
0
source

Recently stumbled upon Quixote . Never used it.

0
source

Use plain old ASP. IIS doesn't care where the files are stored. All paths can be set relative to the virtual directory. This means that you can include "/myproject/myfile.asp", while in PHP this is often done using relative paths. Then Global.asa contains the global configuration for the application. You hardly have to worry about relative paths in your code.

In PHP you would include (dirname ( FILE ). '/../../Myfile.php "), which of course crashed. The only" solution "I found for this was to create HTML files and then use SSI ( server side).

ASP's only drawback is accessibility, as it should work on Windows. But ASP files just run, and the complex Linux configuration is not worried. VBScript is extremely simple, but you can also choose to write server-side JavaScript, as you are familiar with C.

0
source

I think you need to focus on Restful web applications. Zend is a PHP-based MVC framework.

-1
source

Source: https://habr.com/ru/post/1302858/


All Articles