View Platform: http://www.mrktdb.com/
Demo Video: https://youtu.be/Md8tcX2EX_s
-
Clone this repository
-
Create a virtual environment. (Follow tutorial here)
virtualenv myenv
-
Activate the virtual environment
source myenv/bin/activate
-
Install all the required packages from
requirements.txt
pip install -r requirements.txt
Install all the required packages for working with React.js
npm install
-
Install mongodb-community version 4.2.8
brew install mongodb-community@4.2
Follow this tutorial to install it interactively:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/
Follow this to install from the command prompt:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows-unattended/
-
Follow this tutorial to run mongodb:
-
You are ready to run the Django app. To run django app follow the django tutorial
-
Go to the directory having manage.py
-
Run -
python manage.py runserver
to run the Django server. Open and terminal window and go to same directory as manage.py, and Run -
npm run dev
to run React
-
Create a .env file in the same directory as setting.py
-
Enter the secret variables and their values that you want to use
-
If you are using the application locally then set a variable LOCAL_DB_NAME in the .env file and give it the name of local database that you want to use
-
Go to the directory containing the .env file and run this command in the terminal:
eb setenv `cat .env | sed '/^#/ d' | sed '/^$/ d'`
-
Go to the admin page by using URL/admin as the url in the browser.
URL = http://mrktdbapi-prod.eba-ae6apzne.us-west-2.elasticbeanstalk.com for the deployed app
URL = http://127.0.0.1:8000 if you're running the app locally
-
Enter the login credentials
-
Then you'll land on the site administration page. Look for the TESTAPP and click Add.
-
Make an entry in the testapp and click SAVE. (testapp is an app made solely for checking the database connection)
-
Run this command in your terminal to access the database hosted in EC2:
mongo -u user -p pwd IP/db
where,
user = username for the database hosted in EC2
pwd = password for the database hosted in EC2
IP = IP of EC2 instance
db = database name that is hosted in EC2
OR
Run
mongo
in your terminal to enter the mongo console. Use the database: " market-db-local " and check for your entry.
The application hits local MongoDB when running in our system and when it runs on AWS it uses the MongoDB in EC2 instance.
- Create a new branch before making any change.
- Add all new packages to
requirements.txt
(Make sure you are in a virtual environment before doing this)pip freeze > requirements.txt
- Put up a PR for review.
Run the following command in virtual environment.
python cik_scraper.py
- Python 3.7.3