How to deploy exactly in django stack for existing project ?
You have two options:
- Create a new project following this guide: https://docs.bitnami.com/oci/infrastructure/django/get-started/deploy-django-project/. Then, replace all files in /opt/bitnami/apps/django/django_projects/PROJECT-NAME/PROJECT-NAME. (easiest way)
- Replicate a Bitnami application structure by putting your new project in /opt/bitnami/apps/PROJECT-NAME. This may requires advanced configuration. You can check how Bitnami stacks like Weblate or ERPNext are configured to replicate the structure if you prefer to. (more complicated)
How to install requirements to the python path(for that I found use_django_stack script but bit confused with the usage) ?
Load the environment:
If you are using a virtualenv you would need to activate it beforehand:
Then navigate to your Django project and install requirements as you usually would (e.g. from a requirements.txt file):
pip install -r requirements.txt
How to migrate models ?
That is specific to Django, see: https://docs.djangoproject.com/en/2.1/topics/migrations/
After loading the environment, and loading the virtualenv if configured, you would need to navigate to the folder where your manage.py exists and run:
python manage.py migrate
How to activate virtualenv ?
You can create a virtual env with:
For your Apache app to use this virtualenv properly, you must edit httpd-app.conf and add the following property to your WSGIDaemonProcess action (supposing you are using Django 2 with Python 3.7):