Install python-3.7.2
and python-pip
. Follow the steps from the below reference document based on your Operating System.
Reference: https://docs.python-guide.org/starting/installation/
# Install virtual environment
pip install virtualenv
# Create virtual environment
virtualenv env
# Activate virtual environment
source env/bin/activate
pip install -r requirements.txt
# open mysql bash
mysql -u <mysql-user> -p
# Give the absolute path of the file
mysql> source ~/simple-django-project/world.sql
mysql> exit;
OR ELSE USE PHPMYADMIN MYSQL SERVER USING XAMPP
# open settings file
panorbit/settings.py
# Edit Database configurations with your MySQL configurations.
# Search for DATABASES section.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'world',
'USER': '<mysql-user>',
'PASSWORD': '<mysql-password>',
'HOST': '<mysql-host>',
'PORT': '<mysql-port>',
}
}
# Edit email configurations.
# Search for email configurations
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '<your-email>'
EMAIL_HOST_PASSWORD = '<your-email-password>'
EMAIL_PORT = 587
# save the file
# Make migrations
python manage.py createsuperuser
# Make migrations
python manage.py makemigrations
python manage.py migrate
# For search feature we need to index certain tables to the haystack. For that run below command.
python manage.py rebuild_index
# Run the server
python manage.py runserver