python - What to do after starting simple_server? -


For some quick backgrounds, I am an XHTML / CSS man with some basic PHP knowledge. I am trying to dip my feet into the Python pool, and yet I understand how to start simple_services and the same. The extent to which I understand this is the extent.

How do I integrate simple_service and my original XHTML / CSS files? I want to start the server and call it automatically, for example, index.py (does it require .py?). Obviously within the index file, I will have my markup and stylesheet and I will work as a normal site at that point.

My last goal is to go to the original message board (post, edit, delete, user session). I realize that I need access to a database, and I do not have enough information to worry about my database.

Thanks for the help.

Edit: Allow me to clarify my goal, as I have been told that Python is much more than PHP, my goal is to start simple web applications in my already existing static XHTML pages To do. With PHP clearly, just make sure that it is installed on your server and you start writing code. I would like to know what is Python in different meanings, and what I have to do, say, an original in Python Write message board.

"Obviously with PHP, just make sure it's on your server Is installed and you start writing code. "

Python. Python is only one language, not Apache plug-ins like PHP.

Generally, you can use something like Apache to create a dragon plug-in. What do you know that web page processing involves a lot of steps, none of which is part of Python language .

You should use an extension library or a framework to process the web request [in this time], some PHP people ask why Python is very popular and the reason is that Library or framework.]

PHP parses the request and allows you to embed the code in the resulting page.

Python Framework - Generally - Not working in this way Most python framework breaks operations in several steps.

  1. Parsing the URL and applying the appropriate piece of code

  2. The code is being run to get the result data object.

  3. Mixing the resulting data objects into HTML templates.

    >

"My goal is to start simple web applications in my already existing static XHTML pages."

How we see you want to do this.

  1. Create a DJ ango project.

  2. Create a Django app.

  3. Convert your XTHML pages to Django templates. Remove the dynamic content and put it in the {{somevariable}} Depending on what the dynamic content is, it can be simple or complex.

  4. Define the URL to see the function mapping in your urls.py file.

  5. Define the visual function in your views.py file. These visual functions create dynamic content to run in the template, and which template renders.

At that point, you should be able to start the server, start the browser

"Write a basic message board in Python. "

Let's see how you do it

  • < Li>

    models.py

  • Define your data model in tests.py Write the unit test.

  • The built-in administrator plays with pages.

  • create Django templates

  • URL for viewing function mappings in your urls.py file Define.

  • Define the view in your views.py file create dynamic content that runs in these visual functions templates, and which template to render is.


  • Comments