This is a demo application built with Django and Gatsby.
The project hierarchy is as follows:
Root
|
|__ backend
|__ frontend
|__ README.md
|__ requirements.txt
Clone the repository in your local storage.
Project Backend is built with Django and frontend with Gatsby. It has been tested with the following:
- Python 3.6.8
- virtualenv 20.2.2
- [email protected]
- Gatsby CLI version: 3.4.0
- Gatsby version: 3.14.2
In a Terminal:
- First go to the root directory.
- Create a virtual enviornment with
virualenv env
- Activate the virual enviornment:
- Windows:
env\Scripts\activate
- Linux:
source env/bin/activate
- Windows:
- Install requirements
pip install -r requirements.txt
- Goto the backend directory
cd backend
. - Create all the database migrations
python manage.py makemigrations
. - Run all the created database migrations
python manage.py migrate
. - Create a super user
python manage.py createsuperuser
and follow the wizard. - Load dummy data
python manage.py loaddata data.js
. - Run the project
python manage.py runserver
In a Terminal
- From the root goto the frontend directory
cd frontend
. - Install the requirements
npm install
- Run the project
npm run develop
.
You can access the backend admin section when running the default dev server with http://localhost:8000/admin
with the admin credentials that you setup in the step 8 above. Backend API is exposed on the base URL http://localhost:8000/api
Access the frontend with http://localhost:3500/
There are two users created when running the dummy data command above in step 9 with the following credentials:
username: user1
password: 123
username: user2
password: 123
You can login with these to test out the system.