Creating a Django Project with MySQL and File Upload Using PyCharm

This tutorial walks through preparing the development environment, creating a Django project and app in PyCharm, configuring MySQL, adjusting Django's MySQL backend, setting up URL routing, and establishing a folder for file uploads, all illustrated with step‑by‑step screenshots.

Test Development Learning Exchange
Test Development Learning Exchange
Test Development Learning Exchange
Creating a Django Project with MySQL and File Upload Using PyCharm

Welcome readers and invite them to follow the tutorial on setting up a Django project for file upload, encouraging participation and sharing of technical documentation.

1. Prepare the environment : install Python 3.7.6, Django 3.0.4, and MySQL 8.0.19.

2. Create a Django project and app in PyCharm :

a) Use PyCharm to create a new Django project.

b) Inside the project directory upload_file, create an app named upload with the command django-admin startapp upload and add it to settings.py.

c) Configure the settings.py file to connect to the MySQL database and adjust language settings.

3. Create the MySQL database : open a terminal and run create database informations to create the informations database.

4. Adjust Django's MySQL backend : because the MysqlDb module is deprecated in Python 3, edit site‑packages/django/mysql/db/base.py and comment out lines 35‑37.

5. Configure upload.urls to route file upload requests.

6. Create a folder for uploaded files to store the uploaded content.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonBackend Developmentmysqlfile uploadDjangoPyCharm
Test Development Learning Exchange
Written by

Test Development Learning Exchange

Test Development Learning Exchange

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.