Implementation of REST Based on mongo
With the widespread use of NoSQL, the use of traditional relational data such as mysql is gradually decreasing.
django's REST support for mysql should be very clear to all, but mongo's support does not seem to be so perfect, it still needs to be supplemented by itself, which is always not easy to use.
The company just had a project to add, del ...
Posted by Maleko on Sat, 30 Mar 2019 15:54:30 -0700
Python Road [Chapter 23]: Django Model Operations (II)
Model operation
1. Operation summary:
# increase
#
# models.Tb1.objects.create(c1='xx', c2='oo') Add a data to accept dictionary type data **kwargs
# obj = models.Tb1(c1='xx', c2='oo')
# obj.save()
# check
#
# models.Tb1.objects.get(id=123) # Acquire single data, report error ...
Posted by Zooter on Sun, 24 Mar 2019 06:45:30 -0700
python——Django Admin management tool, create APP
In the last blog has been implemented, link database and create APP, this time we do a web page.
The main contents include: mysql's primary key, foreign key, class Meta's use, basic operation and so on.
A data Import project was created and an APP named blog was registered.
First, in. / blog/models.py, two models are defined, on ...
Posted by steply on Sat, 23 Mar 2019 00:48:54 -0700
Python 3.7.0 + Django 2.0.4 pits encountered using django-celery
First of all, you know that Django is a synchronization framework.
In order to speed up user response time and improve user experience. So I decided to use asynchronous tasks to perform some tasks in the background.
In addition to asynchronous tasks, celery can also start timing tasks to facilitate scheduling.
Packages to be ins ...
Posted by forgun on Wed, 20 Mar 2019 15:39:25 -0700
Django+Apache+mod_wsgi deployment under Ubuntu
OS: Ubuntu16.04LTS
Django: 1.11
Python: 2.7.11
Apache: 2.4
This article is just a simple deployment of Django+Apache
First, put the Django Project in the / var/www directory
1. Install Apache and mod_wsgi
sudo apt-get install apache2
sudo apt install libapache2-mod-wsgi
pip install virtualenv
2. Modi ...
Posted by vbnullchar on Thu, 07 Feb 2019 16:03:16 -0800
Centos7+virtualenv+supervisor+python3+uwsgi+django+nginx environment deployment
Viralenv and supervisor are installed in centos 2.7.5, but my project uses Python 3.6, so I need to compile Python 3 myself. If you use virtualenv as Python 3, make sure that uwsgi also uses Python 3! Otherwise, there will be an ImportError: no module named site error, which is caused by the difference between the home ...
Posted by William on Wed, 06 Feb 2019 03:36:16 -0800
django extends its own permissions to support object permissions
Extending django's own permissions
Explain
On the basis of not rewriting its own privileges, it completes the support object privileges, which are suitable for small projects.Amendments are welcome.
Software support
jsonfield
data base
Three new tables
from django.db import models
from django.contrib.auth.models import AbstractUser, Group ...
Posted by gmann001 on Thu, 31 Jan 2019 19:03:15 -0800
FastDFS Actual Operation
1. The process of uploading and displaying pictures after Django integrates FastDFS
2.FastDFS Installation (Operation in Virtual Machine Environment), (omitted)
3.Django Project Core Code
(1) File location:
(2)storage_util.py
from django.core.files.storage import Storage
from django.conf import settings
from fdfs_client.client i ...
Posted by matt.sisto on Thu, 31 Jan 2019 13:00:15 -0800
DJango - Project Creation
Project creation
You need to select a directory as the project's home directory
You can have multiple apps in a project
Command help
Creating project methods
django-admin help startproject
usage: django-admin startproject [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS]
...
Posted by TJaaaay on Sun, 27 Jan 2019 17:09:14 -0800
(django) 11 class views
Catalog
1. Use Class View
Create Class View
Registration routing
Class View Using Decorator
Decorate in url
Decorate in Class View
name parameter of method_decorator
Using Mixin Extension Class
The view defined by function mode is called function view. Although it is convenient to use and easy to understand, when a s view has multiple r ...
Posted by peachsnapple on Sat, 19 Jan 2019 08:48:12 -0800