How To Show SQL Query Command In Django Migration

Django model class is defined in models.py file in Django application folder, each model class will be mapped to a database table in the project backend database server. After you define the model class, you can create the related table use Django manage.py tasks command, all the low level sql command ( such as table […]

How To Show SQL Query Command In Django Migration Read More »

How To Run Unit Test Use External CSV Test Data In Python

Python unittest library is used to run the unit tests for Python classes and functions. It is a built-in library provided by Python, so you do not need to install any third-party library to use it. This example will demo how to use it to make your unit test more clear and easy. But the

How To Run Unit Test Use External CSV Test Data In Python Read More »

How To Pass Multiple Parameters Via Url In Django

If you find the Django url pattern is not easy to use when you want to pass multiple request parameters via url, you can use the original method to implement it. The original method is to use url like this http://127.0.0.1:8000/dept_emp/emp_list/?dept_id=1&user_name=jerry. It just adds the parameter name and value pair after the question mark (?) of

How To Pass Multiple Parameters Via Url In Django Read More »

How To Create / Remove Django Project Application

Each Django project can have multiple applications. Each application can have multiple models and each model has mapped to one table in the backend database. This article will tell you how to create Django project application. How to remove all database table of the application and how to remove the application completely.

How To Create / Remove Django Project Application Read More »

Python Connect To MySQL Database With MySQL Connector & PyMySQL Example

When you want to connect to the MySQL database in Python code, you can use both the mysql-connector-python MySQL driver and PyMySQL. The mysql-connector-python MySQL driver is a MySQL server built-in driver and the PyMySQL is a third-party library. All the two MySQL python libraries provide classes for you to get MySQL database connection, execute insert, delete,

Python Connect To MySQL Database With MySQL Connector & PyMySQL Example Read More »