Category Archives: How to Fix

Four ways to get Django parameters in request

1. Query string data (String)
Like:?key1=value1& Key2 = value2
use

requisition.get ("key", "value") GET
2. request-getlist ("key", []) GET the last value

Ii. Request Body Data (BODY) :
For example: form data, JSON,…
2.1 form data :(only post requests are supported)

request.POST.get("name", "")

2.1 json data :(post and put requests are supported)

Loads (json_str) json_str = request. Body # attribute to get the original request data
json_dict = json.json (json_str)# convert the original data into dictionary format
json_dict. Get ("key", "default value ") # get the data

3. Specific part of data in the URL path

Regular, or routing converter

4. Request Header Data (HEADER) :

request.MEAT.get("key")

Installing swig on Linux

git clone https://github.com/swig/swig.git
cd swig
sudo apt-get install automake
./autogen.sh
./configure
sudo apt-get install bison flex
make
sudo make install
When following the above steps,
sudo: apt-get: command not found
reports an error. The high probability is due to the CentOS system being used. When downloading, change the apt-get to yum

How to Fix “Slow Access of Stackoverflow” Issue

1. Use the public free DNS server to find StackOverflow IP.
Provide free public DNS server (IP address 8.8.8.8 and 8.8.4.4 respectively) to provide domain name resolution service for the public.
CMD input instruction

nslookup -vc stackoverflow.com 8.8.8.8


2. Verify IP availability

ping 151.101.65.69


It is ok to see that the corresponding time is only 323ms
3. Add IP to host
CD C: \ Windows \ System32 \ drivers \ etc. Administrator privileges to open Host
Update THE DNS map for StackOverflow
4. Solve stackoverflow jquery.min.js loading slow problem
Update the ajax.googleapis.com IP in the host file

127.0.0.1  ajax.googleapis.com

It can be opened not because it is loaded in jquery.min.js, but because the HTTPS certificate causes the request handshake to fail, so it is opened without pending.
5. Refresh host.cMD refresh DNS

Run the ipconfig /flushdns command to refresh the dns.

and the way to install plug-ins for Chrome
https://github.com/justjavac/ReplaceGoogleCDN

Vacuum box installation CentOS encountered the pit

Vagrant Box installation Centos encounter pit
The main thing is that there are some pits when installing Centos. Moreover, most of the online tutorials are not complete, so I am writing this blog to help some of the newcomers to the pit of Vagrant Box.
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox> Virtualbox-6.0.18-136238-win
1. CMD below to initialize your virtual environment vagrant init your environment name, which I use when

D:\self\vagrant_workspace>vagrant init  centos7

2. Generally, this process is extremely slow and may not succeed, because it needs to go to the remote factory to download, you can use the University of Science and Technology of China mirror this is faster

D:\self\vagrant_workspace>vagrant init centos7 https://mirrors.ustc.edu.cn/centos-cloud/centos/7/vagrant/x86_64/images/CentOS-7.box

3. Don’t worry about the following errors that may occur in the first and second steps

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
again.

4. Use the following command to view the Vagrant installation list to see if the installation was successful

D:\self\vagrant_workspace>vagrant box list

5. Start the vagrant

D:\self\vagrant_workspace>vagrant up

The following error may occur

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file D:/self/vagrant_workspace/base

Box = “base”, default is “base”, you need to change the name of your own environment, here I will change it to “config.vm.box =” centos7 “
and then execute the command again

D:\self\vagrant_workspace>vagrant up

The presence of this indicates successful startup

default: SSH username: vagrant
default: SSH auth method: private key

How to cancel the commit, how to cancel the commit after git commit, and how to change the submitted content

How does Git cancel commit, how do You cancel the commit after Git commit, and how do you change the commit content
When you’re using Git, you might accidentally click commit, so how do you plug in the commit?
1. You can first check the historical commit record with Git Reflog
Soft, soft
The local code does not change, except that git transitions revert to the pre-COMMIT state
Do not delete the workspace change code, undo commit, and do not undo Git Add.

git reset --soft HEAD~1

Represents the last commit to be revoked, and 1 can be replaced with an earlier number
Hard to cancel
The native code will change directly to the specified commit version. Use with caution
Delete the workspace change code, undo commit, undo Git Add.
Note that after this operation, the last COMMIT state is restored.

git reset --hard HEAD~1

If the message content is just COMMIT, the error is filled in
The input

git commit --amend

Enter ViM mode and make changes to Message
There’s another one, mixed

git reset --mixed HEAD~1

Do not delete the workspace change code, undo commit, and undo git Add. Operation
is the default parameter,git reset –mixed HEAD~1 and git reset HEAD~1 have the same effect.

A Chrome extension to protect the privacy of personal favorites

As a programmer, I often have to share my desktop with others due to the demands of my work.
But I don’t want people to see my browser favorites when I share the desktop, as follows:

I could, of course, hide the entire favorites bar using the Ctrl+Shift+B shortcut, but that would make it inconvenient for me to use it myself:

Later I found a nice Chrome Bookmarks extension: Neater Bookmarks:

After clicking on the extension icon in the upper right corner of the screen, my favorites will be displayed in a tree structure:

For example, the Angular folder is expanded this time. Next time you click on the Icon of the Favorites, the rendered tree structure will still be expanded Angular folder:

The extension id: ofgjggbjanlhbgaemjbkiegeebmccifi
Extended link: https://chrome.google.com/webstore/detail/ofgjggbjanlhbgaemjbkiegeebmccifi
More of Jerry’s original articles, all in: “wang zixi” :

Problems caused by vs project build order: link: fatal error lnk1181: cannot open input file ‘zoom’_ Ui_ style.lib ‘

Problem solving
Project description
My three projects, 1, 2, 3; 1 is static DLL, 2 is EXe, 3 is static DLL2 depends on 1, 3; Three depends on one; First of all, I went to stackflow and wandered around the main stream, which means that the configuration of your link is not well configured, so that you can configure Blabla…
But I know my configuration is ok, then I scroll down and find another answer, as shown in the figure below:
basically means that you have a problem with the order of each project build of this project, then I have a look according to the instructions, and sure enough, I have a dependency which is not checked. Here the project depends on your own mind to know ~ method 1: Menu-& GT; Project-> Project Dependencies method 2: Right Click Soultion -& GT; properties-> Project Dependencies is perfectly solved, but today CSDN’s Markdown seems to be a little buggy

There has been an error processing your request magento

If you’re using Magento, the following page appears:

indicates that there is an Error, but dear, don’t worry, please find the corresponding report in the var/report in the root directory of the website according to the number of “Error recordnumber: XXXXXXXXX “and open it, there are specific problems.

this error is usually caused by the use of incompatible templates or components, and in some cases, database connection problems or PHP environment problems can also cause the error.

A JNI error has occurred, please check your installation and try again

1. The question is:
A JNI error has occurred once again, please check your installation and try again

 
2. Analysis:
The JDK was installed repeatedly and there were different versions on the computer
 
3. Solution:
The command line through “Java-version” and “Javac-version” query SDK version
Delete the unwanted version (uninstall in the control panel)
(3) Adjust the environment variable to leave the JDK related information
Recompile to see whether there is still an error
 
4. The validation:
Javac is the same version as the Java directive