Simple use of Simple-todo tools in Python's Django framework

Source: Internet
Author: User
Origin

Simple-todo was first an example of a Chinese course in web.py. Later Uliweb author Limodou that this tutorial is very good, so there is uliweb version of the Simple-todo. Then there is the bottle version and the flask version. This has become a frameworksshow project. Since it's frameworksshow, there's no need for Django.

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 by @zoomquiet
http://simple-is-better.com/news/509

Simple-todo Flask Implementation by @wyattwang
http://simple-is-better.com/news/524
Operational requirements

django>=1.3
Installation and operation

Initialize database: Python manage.py syncdb

Start: Python manage.py runserver

To use: Open http://127.0.0.1:8000/in the browser

Django Admin: Open http://127.0.0.1:8000/admin/in Browser
Project Development Record

Create a Django project and app:

django-admin.py startproject simple_todo_site  cd simple_todo_site/  python manage.py startapp Simpletodo

Edit settings.py to complete the configuration of databases, templates, static files, and the main configuration entries:

#注: I think Django should add more default settings, and these configurations are annoying.
DATABASES
Installed_apps
Static_root
Staticfiles_dirs
Template_dirs
Edit urls.py Add the Django Admin and static file URL configuration.
Edit simpletodo/models.py to complete the data model:


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

To create a database:

  Python manage.py syncdb

Run up and go to Django Admin to see first:

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.