I'm studying Django here.
"Super Primer" The first web application made with Django Part6 (Data acquisition, detail page)
static folder and madia folder,
I didn't like having two image folders
Images uploaded by users
I changed it as follows so that it will be uploaded to the static folder and it worked normally.
MEDIA_ROOT = os.path.join (BASE_DIR,'blog_app/static') MEDIA_URL ='/ media /'
Existing image files are static folders
Images uploaded by the user are in the madia folder
What is the reason for separating them?
I also don't know why STATIC_URL and MEDIA_URL are created separately
Django 1.3: MEDIA_URL vs. STATIC_URL-Stack Overflow
It seems that there is no particular reason to create a madea folder or MEDIA_URL on this site ...
Answer # 1
I'm sorry I'm not familiar with it, but I looked it up.
Deployment Checklist | Django Documentation
STATIC_ROOTPlaces static files provided by the developer
MEDIA_ROOTPlaces files uploaded by users
It seems to assume that.
Answer # 2
I found a URL that seems to be helpful, so I will post it instead of a memo
[Django] How to use the file upload function [Basic settings]
- python - i want to change the ip address that the django app gets by default from remote_addr to http_x_forwarded_for in middlew
- python - about image deletion in django
- python - [django] gte works with filter in queryset, but lt doesn't work and i can't get the specified range of data
- php - i want to create a mail form with the django framework
- python - how to count url clicks in django and record them in the db
- name error in underscore in python django
- python - object is not displayed in html in django queryset
- python - tabelog scraping: i want to create a data frame for each store name, address, and evaluation score
- python - create a program to automatically take a screenshot of the kindle screen and save it
- how to create a qr code in python and paste it directly into word
- python - i want to create a function that finds the standard deviation sigma from x, y
- how to create a multi-line format input/output form with django-bootstrap4
- python - i want to create a contour image
- python - i want to use asyncio with django custom commands
- python - django i want to filter the data associated with a foreign key and display it in a template
- python - i can't find some url paths after deploying django
- python 3x - save the selected file to another folder
- python 3x - how to rename a folder created using jupyternotebook
- python - when i set the uuid field in django, i get field'object_id' expected a number but got '78a0767cb607488087a73f17565bb
- python : Order operation logic and basket Django
- python : How to change the entry in the database using Django ORM in one request
- python : How to display objects associated via ForeignKey in Django pattern?
- python : Models and forms in Django
- python : How to make username from other fields?
- python : PycharmPro Installation Error
- python : Download Django Server File
- python : Model with quantity in Django ORM
- python : Django Forms auto-generated field
- python : Django debugging can not import modules when you are Visual Studio Code