Simple-todo tool in Python Django framework

Source: Internet
Author: User
Tags file url

Simple-todo tool in Python Django framework

This article mainly introduces the simple-todo tool in the Python Django framework. This tool is based on the open-source project in the original web. py. If you need it, refer

Origin

Simple-todo is the first example of a Chinese tutorial on web. py. Later, the Uliweb author limodou thought this tutorial was good, so he had the Uliweb version of simple-todo. Then we have the Bottle and Flask versions. This has become a FrameworksShow project. Since it is FrameworksShow, Django should never be missing.

Simple-todo: A simple todo Program

Http://simple-is-better.com/news/309

Simple Todo (Uliweb version) tutorial by @ limodou

Http://simple-is-better.com/news/312

Simple-TODO Bottle implementation edition by @ zoomquiet

Http://simple-is-better.com/news/509

Simple-TODO Flask implementation version by @ wyattwang

Http://simple-is-better.com/news/524

Operation requirements

Django >=1.3

Installation and running

Initialize the database: python manage. py syncdb

Start: python manage. py runserver

Use: Open http: // 127.0.0.1: 8000/in the browser/

Django Admin: Open http: // 127.0.0.1: 8000/admin/in the browser/

Project development records

Create a django project and app:

?

1

2

3

Startproject simple_todo_site django-admin.py

Cd simple_todo_site/

Python manage. py startapp simpletodo

Edit settings. py to configure databases, templates, and static files. The main configuration items are as follows:

# Note: I think django should add more default settings. These configuration changes are annoying.

DATABASES

INSTALLED_APPS

STATIC_ROOT

STATICFILES_DIRS

TEMPLATE_DIRS

Edit urls. py to add the django admin and static File url configurations.

Edit simpletodo/models. py to complete the data model:

?

1

2

3

4

5

6

7

8

9

From django. db import models

From django. contrib import admin

 

Class Todo (models. Model ):

Title = models. CharField (max_length = 255)

Finished = models. IntegerField (default = 0)

 

Def _ unicode _ (self ):

Return self. title

Create a database:

?

1

Python manage. py syncdb

Run it up and enter django admin to see first:

?

1

2

Python manage. py runserver

# Http: // 127.0.0.1: 8000/admin/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.