Last active
June 13, 2020 15:23
-
-
Save mitulp236/20629389789d07851cb2022a178490e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project Directory Structure | |
---------------------------- | |
project-main-dir | |
- db.sqlite3 | |
- venv | |
- requirement.txt | |
- myproject | |
- myproject | |
- settings.py | |
- wsgi.py | |
- urls.py | |
... | |
***************************************************** | |
deployment steps | |
----------------------- | |
sudo apt-get update | |
sudo apt-get install apache2 libapache2-mod-wsgi-py3 | |
sudo vi/etc/apache2/sites-available/000-default.conf | |
<VirtualHost *:80> | |
Alias /static /home/user/project-main-dir/myproject/static | |
<Directory /home/user/project-main-dir/myproject/static> | |
Require all granted | |
</Directory> | |
<Directory /user/project-main-dir/myproject/myproject> | |
<Files wsgi.py> | |
Require all granted | |
</Files> | |
</Directory> | |
WSGIDaemonProcess myproject python-path=/home/user/project-main-dir/myproject python-home=/home/user/project-main-dir/venv | |
WSGIProcessGroup myproject | |
WSGIScriptAlias / /home/user/project-main-dir/myproject/myproject/wsgi.py | |
</VirtualHost> | |
if you using Sqlite DB then : | |
chmod 664 ~/myproject/db.sqlite3 | |
sudo chown :www-data ~/myproject/db.sqlite3 | |
sudo chown :www-data ~/myproject | |
else: | |
pass (No worries i will take care) | |
sudo service apache2 restart | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment