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...
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"
First of all, set up Django with apache with this https://gulshan1996.blogspot.com/2020/08/set-up-django-with-apache.html If your JWT auth is not working on apache server, This is because of Apache block the header So you have to enable them by, adding this line in apache conf file WSGIPassAuthorization On WSGIScriptAlias / /home/farmafeed/manageFarmafeed/farmafeedProject/wsgi.py <Directory /home/farmafeed/manageFarmafeed> Order allow,deny Allow from all </Directory> Note: /home/farmafeed/manageFarmafeed/farmafeedProject this is my URL Just Add WSGIPassAuthorization On && <Directory /home/farmafeed/manageFarmafeed> Order allow,deny Allow from all </Directory>
Comments
Post a Comment