- At first install Django
pip install django
- Next
pip install djangorestframework
- Next
pip install django-filter
- Install MySQldb
sudo apt-get install python-dev
pip install mysql-python
- Run project server
python manage.py runserver 0.0.0.0:8000
sudo apt-get install python-pip
sudo pip install virtualenv
# create virtualenv
virtualenv rivnefish-env
# activate rivnefish-env, this command works only in BASH
source rivnefish-env/bin/activate
# now you can install required packages
pip install -r requirements.txt
# apply migrations
python manage.py migrate
Django Extensions https://github.com/django-extensions/django-extensions
Shell plus https://github.com/django-extensions/django-extensions/blob/master/docs/shell_plus.rst
by URL http://api.rivnefish.com/admin/site_manager/markers/97/
- Next strings should be added into httpd.conf:
cat /usr/local/directadmin/data/users/rivnefish/httpd.conf
WSGIPythonPath /usr/home/rivnefish/domains/api.rivnefish.com/rivnefish-env/lib/python2.7/site-packages
<VirtualHost api.rivnefish.com:80>
ServerAdmin webmaster@localhost
ServerName api.rivnefish.com
WSGIScriptAlias / /usr/home/rivnefish/domains/api.rivnefish.com/rivnefish/RivneFish/wsgi.py
CustomLog /var/log/httpd/domains/api.rivnefish.com.log homedir
ErrorLog /var/log/httpd/domains/api.rivnefish.com.error.log
WSGIPassAuthorization On
</VirtualHost>
<VirtualHost 77.120.80.6:80 >
ServerName www.ads.rivnefish.com
- Restart httpd process
This line should be present in config file:
# grep LoadModule /etc/httpd/conf/httpd.conf
LoadModule wsgi_module /usr/local/libexec/apache22/mod_wsgi.so