Django Website ( ecommerse and blog application )
Requirement | Commend |
---|---|
update os |
|
upgade |
|
install apache |
|
apache firewall info |
|
allow permittions to firewall |
|
install python 3 pip |
|
apache mod wsgi |
|
change dir |
|
make dir |
|
change dir |
|
install virtual environment |
|
create virtual environment |
|
activate virtual environment |
|
install django |
|
make project in django |
|
change dir |
|
open settings.py file |
|
change in settings.py | and host_ip into allowed_host [] and below of static url |
change dir |
|
make migrations |
|
migrate |
|
create superuser |
|
collect static |
|
run django server |
|
change dir |
|
change appache configrations |
|
<VirtualHost *:80>
ServerAdmin webmaster@localhost
Alias /static /var/www/djangomac/static
<Directory /var/www/djangomac/static>
Require all granted
<Directory /var/www/djangomac/djangomacproj>
Require all granted
WSGIDaemonProcess djangomac python-path=/var/www/djangomac python-home=/var/www/djangomac/djangomac
WSGIProcessGroup djangomac
WSGIScriptAlias / /var/www/djangomac/djangomacproj/wsgi.py
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
sudo a2dissite 000-default.conf
sudo a2ensite 000-default.conf
sudo service apache2 restart
cd /var/www
chmod 664 dir_name/db.sqlite3
chown :www-data dir_name/db.sqlite3
chown :www-data dir_name/
sudo service apache2 reload