- Install dependency for creating virtual environment
pip install virtualenv
- Create virtual environment
virtualenv venv
- Activating the virtual environment for Linux
source venv/bin/activate
For window
.\venv\bin\activate
- Open terminal. Make sure to be at the root of your project
pip install -r requirements.txt
- Make sure MongoDB server is install.
- Open your console and run this command
mongo
- Creating DB
user database_name
-
Setting up credentials for DB
db.createUser( { user: "username", pwd: "password", roles: [ "userAdmin" ] } )
-
Make changes in LMS/settings.py file for DB respectively
DATABASES = { 'default': { 'ENGINE': 'djongo', 'ENFORCE_SCHEMA': False, 'NAME': 'lms', 'HOST': 'mongodb://localhost:27017/lms', 'PORT': 27017, 'USER': 'daud', 'PASSWORD': 'daud123' } }
-
run these commands
python manage.py migrate
python manage.py makemigrations
python manage.py migrate
- Create super user by providing the required information
python manage.py createsuperuser
-
Login at
http://127.0.0.1:8000/admin
-
Make sure to make changes accordingly in LMS/settings.py
# FTP SERVER FTP_HOST = 'ftp.com' FTP_USER = 'user' FTP_PASSWORD = 'password' # SMTP SERVER EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'thedarkbot9@gmail.com' EMAIL_HOST_PASSWORD = 'password' EMAIL_PORT = 587 DEFAULT_FROM_EMAIL = 'Roche Team <admin@roche.com>' # Key for map MAPBOX_KEY = "" # GEO CODING GEOCODE_URL = "https://geocode.xyz/"
Right now, the GEO coding API is use for mapping longitude and latitude to Location but it's limited to one request per second more over. It's free so is it slow. You can switch to google API.
Contact me at daud.ahmed@tranchulas.com.