Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,187 members, 7,822,007 topics. Date: Thursday, 09 May 2024 at 01:05 AM

Web Programming Tutorial In Python. - Programming (2) - Nairaland

Nairaland Forum / Science/Technology / Programming / Web Programming Tutorial In Python. (4241 Views)

Web-designing Tutorial In Ibadan / Who Wants To Learn Programming In Python Easily Without Stress? READ THIS / Loki v 1.8 http Bot | Best Botnet 2017| Programming Tutorial |all Browser (2) (3) (4)

(1) (2) (Reply) (Go Down)

Re: Web Programming Tutorial In Python. by Sync201(m): 12:30pm On Jul 31, 2017
No questions pls
continue the tutorial
Re: Web Programming Tutorial In Python. by greatface(m): 4:50pm On Jul 31, 2017
continue am following.. grin

i have few issues with image display in bottle but that is on android though. can you be of help?
Re: Web Programming Tutorial In Python. by Sync201(m): 6:59pm On Jul 31, 2017
@webstacka
Would I need to have knowledge on Javascript for bottle
Re: Web Programming Tutorial In Python. by webstacka: 8:05am On Aug 04, 2017
Sync201:
@webstacka Would I need to have knowledge on Javascript for bottle
For front-end development, yes.
Re: Web Programming Tutorial In Python. by webstacka: 8:20am On Aug 04, 2017
greatface:
continue am following.. grin

i have few issues with image display in bottle but that is on android though. can you be of help?

just use:



from bottle import Bottle, route, static_file

app = Bottle( )

@app.route("/static/<file : path>"wink
def static(file):
return static_file(file, root="static/"wink



now create a folder called static, under your working directory. Under the static folder, create three more folders: css, js, and img. Put your css files under the css folder, javascript files under the js folder, and image files under the img folder. Run and load your browser. You'll see everything. NOTE: make sure you have python imaging library (pillow) installed on python in order to load images.
Re: Web Programming Tutorial In Python. by greatface(m): 11:10am On Aug 04, 2017
webstacka:


just use:



from bottle import Bottle, route, static_file

app = Bottle( )

@app.route("/static/<file : path>"wink
def static(file):
return static_file(file, root="static/"wink



now create a folder called static, under your working directory. Under the static folder, create three more folders: css, js, and img. Put your css files under the css folder, javascript files under the js folder, and image files under the img folder. Run and load your browser. You'll see everything. NOTE: make sure you have python imaging library (pillow) installed on python in order to load images.

Thanks Greatly

From What Am Seeing, This Applies To Standard Python Distribution On Typical PCs.

But My Case Is Specific To Android Platform.

thanks again for replying
Re: Web Programming Tutorial In Python. by mexamor(m): 3:32pm On Aug 04, 2017
webstacka:
No much introduction. I'm a bit free so I decided to do this tutorial before I get busy again. Hope someone learns something from this tutorial.

The tutorial is about web programming in python using a micro web framework called bottle. Python bottle is a minimalistic and fast web framework used for developing simple REST services. However, nothing stops you from developing a full-fledged web application with python bottle. One good thing, or maybe a con, of bottle is its single file approach. Bottle is a single python file that requires no external library order than the python standard library. However, this approach makes it a bit difficult to integrate it with other modules, but this can be solved by building your web application with object-orientation in mind from scratch.

REQUIREMENTS:

1) Python 3.4 +

2) Bottle web framework (pip install bottle) with internet connection.

3) Web server (optional). Bottle can run with python's standard wsgiref server bundled with python. However, we need a faster web server that will make our development easier. Popular wsgi-based web servers for python are cherrypy, rocket, twisted, tornado, gunicorn, paste, etc. Since we're just using it for development, our best bet would be python paste or cherrypy. I'll use paste (pip install paste) and that's it!

4) text editor. Any good text editor is okay by me, except notepad. Well, I use notepad++

That is all we need for now. Let's get started!
webstacka pls we need to talk prv,can i have your email or digits OR should i drop mine
Re: Web Programming Tutorial In Python. by techie1: 10:32pm On Aug 04, 2017
I luv what you are doing pls if you can still teach django,flask etc i would be glad...you seem to be well grounded with python web programming #iluvpython #GREATWORK
Re: Web Programming Tutorial In Python. by SaintChukz(m): 11:03pm On Aug 04, 2017
Hello All,
Re: Web Programming Tutorial In Python. by melodyogonna(m): 11:53pm On Aug 04, 2017
op come and update
Re: Web Programming Tutorial In Python. by EmperorGE: 12:02am On Aug 05, 2017
Am making a simple, or should i say, a complicated blog with bottle, the blog will have the power to process login and register, upload post, update post, view post, delete post, post a comment, share a post.
This is my first real project on python and am hoping to host this blog someday.
This is being developed with my android phone with debian squeeze and python3.1

Re: Web Programming Tutorial In Python. by greatface(m): 7:54pm On Aug 11, 2017
EmperorGE:
Am making a simple, or should i say, a complicated blog with bottle, the blog will have the power to process login and register, upload post, update post, view post, delete post, post a comment, share a post.
This is my first real project on python and am hoping to host this blog someday.
This is being developed with my android phone with debian squeeze and python3.1
Can We Talk?
Re: Web Programming Tutorial In Python. by EmperorGE: 11:08am On Aug 12, 2017
greatface:
Can We Talk?
Ofcause melokhalifah@gmail.com
Re: Web Programming Tutorial In Python. by greatface(m): 11:54am On Aug 12, 2017
EmperorGE:
Ofcause
melokhalifah@gmail.com
I Will Message You
Re: Web Programming Tutorial In Python. by tokzy205(m): 12:45pm On Aug 12, 2017
webstacka:
Creating multiple functions

Functions are the building blocks of any programming language. We have already seen a function, that is, the index function wrapped with a decorator. We will later see how python decorators are built. Creating multiple functions is easy in bottle provided they are wrapped with the same decorator. Let us create some:



@app.route( " / " )
def index ( ):
return " This is the Index Page"


@app.route( " /profile " )
def profile ( ):
return " This is the profile page. "


@app.route( " /about " )
def about( ):
return " This is the about page. "



This demonstrates the power of python functions, decorator and routing functions in separating concerns. If you have not observed already, bottle follows a strict MVC design pattern; which is a good OOD principle.
nice one dude , we need more of things like these in the programming section cool
Re: Web Programming Tutorial In Python. by tokzy205(m): 12:48pm On Aug 12, 2017
do you understand the usage of the pygame with python in creating games
Re: Web Programming Tutorial In Python. by 4kings: 12:10am On Sep 21, 2017
tokzy205:
do you understand the usage of the pygame with python in creating games
Are you working on a project with pygame?

And webstacka wey you dey na?
Re: Web Programming Tutorial In Python. by gebop001: 9:23am On Sep 22, 2017
Learn Graphics Design

(1) (2) (Reply)

Where Are The Good Coders? / Are You A Newbie Java Programmer / Oracle Forms: Advices, Tips, Questions:

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 35
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.