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

Опубликовано: 21 Август 2020
на канале: 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...


Смотрите видео Django project deploy on CPanel step by step 100% working, in Bangla онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Easily CSE Learn 21 Август 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 6,360 раз и оно понравилось 91 посетителям.