Django user registration and logon: Django User Registration
Django is a free open-source website framework developed by Python. It can be used to quickly build high-performance and elegant websites!
It is very difficult to learn django, and it is so difficult to get the simplest user logon and registration interface r
After the last chapter, we've created the good one Django app, and then we're ready to refine it.First, let's start with some basic concepts.
Each application created in Django is made up of Python packages that follow certain conventions. Django comes with a utility that automatically generates the basic directory structure of an application, so you can
Django-full-text retrieval, django-full-text retrieval
After two months, I finally completed all the major functions. In the past week, I have consulted a lot of materials to achieve full-text retrieval, I will record it here today, so as not to catch it later ~
First, I will introduce the Django full-text search logic I used. I checked various materials on the I
Django Model Modification and data migration, django model migrationMigrations
It is troublesome for Django to modify the Model. The syncdb command only creates tables that are not in the database and does not modify existing data tables synchronously, you cannot delete the data model. If you add or modify fields in the data model or delete a data model, you need
Django unit test (1), Django unit test (
The Django testing framework is very simple. The preferred method is to use the unittest module in the python standard library.Writing tests
Unit Tests of Django use the unittest module of python, which defines tests using class-based methods. Class Name:
version: Django 1.10.1 (Other versions may have different implementations for a good workaround)Reference Official document:https://docs.djangoproject.com/en/1.10/topics/auth/customizing/In the development process, the Django User Management module can bring us a lot of convenience, but the Django Users module provides too few fields, so the extension of the user
Python Web development framework-Django (2), python-django
Next, I will introduce some practical skills and notes. The first time I used MarkDown for editing, I felt that the gap was too large and not so nice.GET/POST
Data Interaction between the front and back ends. JQuery is used to implement get/post requests.GET Method 1: Use a regular expression to match url parameters
$. Ajax ({type: "GET", url: "/se
I have been paying attention to Django a long time ago, but I have been too busy and have no time to summarize it. Today I will summarize some Django resources collected.
1. www.djangoproject.com
Official website. Django's documentation is absolutely first-class, updated in a timely manner, simple and easy to understand.
There are also many examples, such
Http://www.djangoproject.com/weblog/
Http://code.dja
Once upon a time, Ajax had dominated the web development client, while rest became the most popular architecture style in the web world ). Therefore, our choice becomes simple: The frontend Ajax accesses the backend restful web service to operate resources.Django has some optional rest frameworks, such as Django-piston and Django-tasypie. But Google and I recommend this:
Django User Authentication System (3) groups and permissions, django Authentication
Django's permission system is simple. It can grant users or users in groups permissions.
This permission system is used in the Django admin background, but it can also be used in your own code.
The User object has two ManyToManyField fields: groups and user_permissions.
groups
In the previous chapter, we completed the basic functions of admin, but the appearance of it is too ugly, then we will try to change it ~
If you want to change it, you'll use Django's templating system. Because admin is a Django-brought app, he uses a Django-brought template system.
First you need to create a template folder in the project, you can put it anywhere in the file, assuming the pat
Download Django Create a projectOn the command line, use the CD command to enter the directory where you want to store the code, and then run the following command:
django-admin.py startproject mysite
Let's take a look at what Startproject has created:mysite/ manage.py #一个实用的命令行工具 allows you to interact with the Django project in a v
The first Django app we're going to make a polling site.He is made up of two parts:
A common interface allows users to vote
A management interface, to vote on the deletion.
First of all, you have to create a new project, just one line of code, and Django will automatically do the job for you.Switch the CD to the path you want to store your project under, such as C: \, enterdjango-admin.py
Example of Django file download function: django File Download
For a Django-based website that provides the file download function, the simplest way is to hand over static files to Nginx for processing. However, sometimes, due to the website logic, you must use Django to provide download functions, such as page data ex
Example of a scheduled task using django-crontab, and django-crontab
Today, I plan to add a scheduled task in my Django application to regularly execute some regular check functions. So I thought that using the django-crontab plug-in can satisfy my needs, the following describes how to use this plug-in.
First, use pip
Django getting started case development (I), django case
Django is a heavyweight web development framework that provides many internal plug-ins for us to use. Here, we do not describe Django to directly enter the development process.
The Django entry-level case consists of t
Catalogueone, Django URL Applicationsecond, Django View Applicationthird, Django Template ApplicationIv. Django's ORM ApplicationAdd:Supplement One: GetlisApplication Scenario: The current side of the data sent at multiple times, the background if you also get data with get, then there will be a problem, so there is a getlist method for data Acquisition.Test Case
[Django] user permission operation commands (1), django operation commands
To create a py file for testing, add the following code to the file.
# Coding: UTF-8 import OS. environ. setdefault ("DJANGO_SETTINGS_MODULE", "www. settings ") ''' when the Django version is greater than or equal to 1.7, add the following two statements: import djangodjango. setup () othe
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.