Django learning record first day, django first day
From this article, I will record my Django learning process.
Day-1
I
The first step is to install Django. I chose Django1.11. Why choose 1.11, because it is a long-term technical support version (LTS). The official website will add new features and fix some bugs.
Now,
Before using django, let's take a look at these materials to cheer yourself up ~, Django look at these
If you go to djangoproject.com, you will find the following explanation of Django:"Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design ."Let's look at it.
1. Installing DjangoIf you do not have Python installed, you need to install python,django1.6 for 2.6,2.7,3.2 or 3.3, which is python2.7.8Then install Django, the release version has been updated to 1.6.6, download in https://www.djangoproject.com/(if the old version is installed, you need to delete the old version first)Installation method win, first unpack the Django package, and then run the Python setup
I. References
1. Django Book2. Google Baidu django official website documentation
2. Introduction to Django1. History
Baidu .......
2. Features
3. MVC design mode
The biggest feature of django's mvc development model is loose integration.
Iv. Django Installation
1. installation steps:
Baidu or blog
2. Note
(1).
The original is from understanding Django Middlewares, which describes the middleware definition, function, and how to write middleware –orangleliu in general.
Note: Middleware and middleware have the same meaning in the following article, not completely translatedLet's say you've read the middleware section of the Django official documentation. The knowledge mentioned in the documentation is described
First find the httpd.conf under Apache2 's conf file and add the following information:Alias/static/e:/wamp/apache24/www/static/static> Options followsymlinks allowoverride None Require all granted Settings for the setting under the Django Project:# Static files (CSS, JavaScript, Images)# https://docs.djangoproject.com/en/1.8/howto/static-files/' /static/'staticfiles_dirs ="static"),) [Django
Solution for Django to forget the Administrator account and password: django account
After looking at the Django tutorial to build a website, I forgot my first account and password. As a result, you cannot log on to the Management page and cannot proceed.
:
I can't find many methods on the Internet. I finally use the method of creating a superuser, but the acc
Django file storage (1) default storage system, django file storage
Django's default file storage system 'django. core. files. storage. filesystemstore' is a local storage system, determined by the DEFAULT_FILE_STORAGE value in settings.
ClassFileSystemStorage(Location = None,Base_url = None,File_permissions_mode = None,Directory_permissions_mode = None)
The File
1. Installationlinaro-django-paginationSettingsInstalled_apps = ( # ... 'linaro_django_pagination',) Middleware_classes= ( # ... 'Linaro_django_pagination.middleware.PaginationMiddleware',) Template_context_processors= (#in 1.7 This option is canceled by default, seemingly. How we go about loading in templates and views is an important issue. 'Django.contrib.auth.context_processors.auth', 'Django.core.context_processors.debug', 'd
Inheritance of Django templates, django templates
When using djangofor webdevelopment, a basic framework template base.html will be constructed in the past, and then the common parts and definition blocks of the websites it contains will be reloaded in its subtemplates.
First, create a base.html file. The source code is:
This base.html template defines a simple html framework document, which will be used o
[Django] get and filter differences in Django's ormGet and filter are different in Django's orm.
The Django orm framework is good for applications with low business complexity. It is easy to write and use. For beginners, the two longest-used get and filter methods in the query operation sometimes make some minor errors when you don't pay attention to them. The two methods in this section are different tod
How to generate non-HTML content in django ., Django
In some cases, you may need to click a link or button on the webpage to return an image, a pdf file, a csv file, and so on, rather than HTML. It is easy to do this in diango. View in django is used to receive http requests and return web response. Normally, the returned content is HTML, but it can return more t
Method access and search in Django framework, django framework
The key to traversing complex data structures in the Django template is the period (.).
It is best to use a few examples. For example, assume that you want to pass a Python dictionary to the template. To access the value of the dictionary by using the dictionary key, you can use a period:
>>> from dja
[Django] adding and deleting tables (for reference), django instance
You have not used any table plug-ins. For more information, see the examples on the Internet. For more information, see!
First, let's take a look at the figure. The table layout uses bootstrap. As the saying goes, css will be used when there are more bootstrap slaves:
There are two buttons on them, which are dynamically added. You can use
http://zmrenwu.com/post/3/1 Building a Python virtual environment:
Install virtualenv (provided that Python and Pip are already installed) pip install Virtualenv
Computer New directory: D:\software\python_virtual_envs\djanoproject_env
Execute command virtualenv D:\software\python_virtual_envs\djanoproject_env
Executing a virtual environment: running D:\software\python_virtual_envs\djanoproject_env\Scripts\activate
CMD interface sign (BLOGPROJECT_ENV), indicating that a v
Django builds a blog quickly and Django builds a blog
If preparation:
1. Python
2. Django
3. Git
Install Python:
Download from official website
Install Django:
# Install Django $ pip install django in the latest version # or speci
This section describes the static resource manager Django-pipeline and pythondjango in Python's django framework.
Django-pipeline is a very convenient static resource management app in Django. Especially after version 1.2, It is very convenient to use the collectstatic command of d
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
This article mainly introduces the use of django-tagging in the Python Django Framework, for the function of the tag part of network programming to help, the need for friends can refer to the
Django uses the app mechanism to reuse components, and making full use of existing apps can greatly simplify the development effort. Currently Django's app is not rich enou
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.