background preloader

PYTHON

Facebook Twitter

Build Web Apps as Easily as Native Ones - Home. Dmytro Zikrach. Mitsuhiko/flask. Wheezy.template 0.1.135. Write a Tumblelog Application with Flask and MongoEngine. Introduction This tutorial describes the process for creating a basic tumblelog application using the popular Flask Python web-framework in conjunction with the MongoDB database.

Write a Tumblelog Application with Flask and MongoEngine

The tumblelog will consist of two parts: A public site that lets people view posts and comment on them.An admin site that lets you add and change posts. This tutorial assumes that you are already familiar with Flask and have a basic familiarity with MongoDB and have installed MongoDB. This tutorial uses MongoEngine as the Object Document Mapper (ODM,) this component may simplify the interaction between Flask and MongoDB. Where to get help If you’re having trouble going through this tutorial, please post a message to mongodb-user or join the IRC chat in #mongodb on irc.freenode.net to chat with other MongoDB users who might be able to help.

Installation Begin by installing packages required by later steps in this tutorial. Prerequisite pip install virtualenv virtualenv myproject source myproject/bin/activate Add the Views. Todo List Application in One File — The Pyramid Tutorials v0.1. This tutorial is intended to provide you with a feel of how a Pyramid web application is created.

Todo List Application in One File — The Pyramid Tutorials v0.1

The tutorial is very short, and focuses on the creation of a minimal todo list application using common idioms. For brevity, the tutorial uses a “single-file” application development approach instead of the more complex (but more common) “scaffolds” described in the main Pyramid documentation. At the end of the tutorial, you’ll have a minimal application which:

Cheetah - The Python-Powered Template Engine. How To Use the Bottle Micro Framework to Develop Python Web Apps. Introduction Python is an excellent language for web programming due to its flexibility and high-level functionality.

How To Use the Bottle Micro Framework to Develop Python Web Apps

Web frameworks can make programming web applications much simpler because they connect many of the components necessary for a robust web interface. While some web frameworks attempt to provide everything that a user might want to use to develop an application, others try to stay out of the way while taking care of the important, difficult to implement issues. Bottle is a Python framework that falls into the second category. It is extremely lightweight, but makes it very easy to develop applications quickly. In this guide, we will cover how to set up and use Bottle to create simple web applications on an Ubuntu 12.04 server. How To Install Bottle Python, the programming language that Bottle is built for, comes installed on Ubuntu by default. Install and Activate a Virtual Environment We can install this easily from the repositories: source venv/bin/activate deactivate Conclusion.

Using PyCharm with Pyramid — The Pyramid Tutorials v0.1. This tutorial is a very brief overview of how to use PyCharm with Pyramid.

Using PyCharm with Pyramid — The Pyramid Tutorials v0.1

PyCharm is an Integrated Development Environment (IDE) for Python programmers. It has numerous features including code completion, project management, version control system (git, Subversion, etc.), debugger, and more. This tutorial is a continually evolving document. Both PyCharm and Pyramid are under active development, and changes to either may necessitate changes to this document. In addition, there may be errors or omissions in this document, and corrections and improvements through a pull request are most welcome. Crash Course in web2py (part 3 - form validation) - Michael Herman. Well, in the last tutorial I showed you how to create a basic web form that stores the submitted data in a SQLite database.

Crash Course in web2py (part 3 - form validation) - Michael Herman

In this tutorial, we’re going to add in data validation to your form. Assumptions: You have web2py already installedYou know what a web form isYou created the skeleton web form in Part 2 Start the web2py server, go to the admin interface, and then edit the “form” application (or whatever you decided to name it). Model Right now, there is a requirement set in the db.py file for each field- In other words - all fields must be filled out or an error populates. View What do you want to display to the user? Open up display_your_form.html and change your code to match the following: By adding { {extend ‘layout.html’}}, you will be able to display the flash error messages, which we’ll add in next.

Controller Update deafult.py to match the following code- This adds an If Statement to display text based on whether the user submits your form with the required fields or not. Test Got it? Python from Scratch: Getting Started. Welcome to Python from Scratch, where I'm going to teach you the ins and outs of Python development... from scratch.

Python from Scratch: Getting Started

In this first lesson, we're going to choose a version, install Python, and then create the obligatory "Hello world" script. If you're already familiar with Python, feel free to skip ahead to a later lesson in the series. Video Tutorial Companion Article. Intro to Django – Building a To-Do List. Welcome to Python.org.