Django project deploy on CPanel step by step 100% working, in Bangla

Published: 21 August 2020
on channel: Easily CSE Learn
6,360
91

#please_subscrib_my_channel,

#easy_cse_bangla
Here shown , How to deploy Django project on CPanel step by step in Bangla and solved all errors or problems.
follow the steps :
It's hard to deploy python django project in cPanel without Terminal, Here's how you can do it.
How to do it:
First, create a requirements.txt of your project using pip freeze {Greater-than sign} requirements.txt
Now zip and upload the project into your hosting server/shared host and extract it
create a python app from cPanel and use the application root as the same folder of the project.
Stop the application
Now, using cPanel install requirements.txt
then on the application root, there will be a passenger_wsgi.py file open the file change and import application from your project wsgi eg. from myproject.wsgi import application
run the python app, it should be working. Fix the static by changing static dir to public_html and moving the files to public_html


Thank you, hope this helps


Another setting is needed thats are ....
in settings.py :
TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates')
MEDIA_DIR = os.path.join(BASE_DIR, 'media')


STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'


Extra places for collectstatic to find static files.
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
MEDIA_URL = '/media/'


MEDIA_ROOT = MEDIA_DIR




in urls.py:
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL,
document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)




#please like my facebook page:
  / easycsebangla  
#Code from here :
https://github.com/MdRanaSarkar/DJang...


Watch video Django project deploy on CPanel step by step 100% working, in Bangla online without registration, duration hours minute second in high quality. This video was added by user Easily CSE Learn 21 August 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 6,360 once and liked it 91 people.