Here my env: /home/user/test/env project: /home/user/test/mysite sudo sh -c ". $HOME/test/env/bin/activate && cd $HOME/test/ && python manage.py runserver --insecure 0.0.0.0:80"
1. Create Project [ for project structure] mkdir django_project cd django_project virtualenv env source env/bin/activate pip3 install django // Set up static file & media file // setting.py //import os //at the end of file STATIC_ROOT = os.path.join(BASE_DIR, "static/") // collect static file python3 manage.py collectstatic 2. Create site for django sudo nano /etc/apache2/sites-available/djangoproject.conf //Add this in conf file with your domain and directory <VirtualHost *:80> ServerAdmin admin@djang...
Step1 : Update && upgrade package sudo apt-get update && upgrade Step 2: install apache2 sudo apt install apache2 Step3: Adjust the firewall to allow web traffic sudo ufw app list If you look at the Apache Full profile, it should show that it enables traffic to ports 80 and 443 : sudo ufw app info "Apache Full" Step4: Set up your location suppose path is /home/gulshan/Projects && url will be http://projects then for this set up *Disable the old config* sudo a2dissite 000-default.conf *Create new config with name projects.conf* *Add this to them* <VirtualHost *:80> ServerAdmin webmaster@projects ServerName projects ServerAlias projects DocumentRoot /home/gulshan/Projects <Directory /home/gulshan/Projects> Options Indexes FollowSymLinks AllowOverride all ...
Comments
Post a Comment