What directory do I need to put the files in?
I tried public_html but when I put the files there and clicked on setup.py, it didn't start the script.
相关问题
- Django __str__ returned non-string (type NoneType)
- Django & Amazon SES SMTP. Cannot send email
- Django check user group permissions
- Django restrict pages to certain users
- UnicodeEncodeError with attach_file on EmailMessag
相关文章
- Profiling Django with PyCharm
- Why doesn't Django enforce my unique_together
- MultiValueDictKeyError in Django admin
- Django/Heroku: FATAL: too many connections for rol
- Django is sooo slow? errno 32 broken pipe? dcramer
- Django: Replacement for the default ManyToMany Wid
- Upgrading transaction.commit_manually() to Django
- UnicodeEncodeError when saving ImageField containi
It's probably not the best thing to run Django application on cPanel (shared hosting) because of the following:
pip
install packages into as long as they do not require anything to be compiled (e.g. Django)However it is not to say that it is impossible. These rough steps should be accurate enough to guide you to the right path. I haven't done this is a while so there might be mistakes.
Login into your account and create virtualenv for your django project
Add virtualenv bin folder to the path (inside
.bash_profile
)Then
pip
install everything your project requires. Make sure to activate virtualenv firstConfigure Django as usual. Make sure
DEBUG
isFalse
Inside
public_html
createindex.fcgi
. Make sure to use the virtualenv Python path. Django docs about this here.Configure the
index.fcgi
inpublic_html/.htaccess
Activate the fastcgi
All Done!
However this method will drive you crazy very fast. Apache is not meant for this and this method is not popular for a reason. This should be good enough in the beginning however as you will get more advanced deploying Django app, you should consider using some other hosting provider which allows for more flexibility such as WebFaction or heroku.
Django is a framework that runs in a Python instance, and not as a set of files that are served from a web server, like HTML or PHP. Most likely you will need another hosting provider that hosts web applications like Heroku.