deploy django application with pipenv on apache

  • Last Update :
  • Techknowledgy :

If your virtualenv path is /home/user/.local/share/virtualenvs/ then try this:

sudo - u www - data cat / home / user / .local / share / virtualenvs / - IuTkL8w_ / bin /`

Suggestion : 2

Date: 08 Jul 2018

dj - database - url
packageC >= 1.0, <= 2.0
$ pip install pipenv
python - m pip install--user pipenv
pip install pipenv
$ pipenv shell--three

Suggestion : 3

Django + pipenv + Apache + mod_wsgi deployment on ubuntu not loading modules,Deployment Django using Apache and mod_wsgi on Remote Ubuntu Server,Django + Apache deployment on Ubuntu,Apache ImportError: No module named _socket in wsgi deployment on Django

Also, the addition in is unnecessary and didn't help solve the problem:

python_home = '/srv/project/.venv'

activate_this = python_home + '/bin/'
exec(open(activate_this).read(), dict(__file__ = activate_this))

Suggestion : 4

mod_wsgi is an Apache module which can host any Python WSGI application, including Django. Django will work with any version of Apache which supports mod_wsgi.,Deploying Django with Apache and mod_wsgi is a tried and tested way to get Django into production.,If, however, you have no option but to serve media files on the same Apache VirtualHost as Django, you can set up Apache to serve some URLs as static media, and others using the mod_wsgi interface to Django.,If multiple Django sites are run in a single mod_wsgi process, all of them will use the settings of whichever one happens to run first. This can be solved by changing:

WSGIScriptAlias / /path/to/
WSGIPythonHome /path/to/venv
WSGIPythonPath /path/to/

<Directory /path/to/>
      Require all granted
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
os.environ["DJANGO_SETTINGS_MODULE"] = "{{ project_name }}.settings"
export LANG = 'en_US.UTF-8'
export LC_ALL = 'en_US.UTF-8'
WSGIDaemonProcess lang = 'en_US.UTF-8'
locale = 'en_US.UTF-8'
WSGIDaemonProcess python - home = /path/to / venv python - path = /path/to /