forked from kaletushar222/django-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.TXT
35 lines (31 loc) · 1.32 KB
/
README.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Installation
Backend
# python3 and node should be installed
# mkdir backend mkdir frontend - create folders backend frontend
# cd backend
# python3 -m venv venv - create virtual environment in backend folder
# source venv/bin/activate - activate source
# pip install django djangorestframework django-cors-headers - install django
# django-admin startproject backendapi - create django project
# cd backendapi - cd to backendapi
# django-admin startapp api - start app
# python3 manage.py migrate - migrate
# python3 manage.py createsuperuser - create django superuser
# add in backendapi->settings.py installed apps -> 'rest_framework','corsheaders','api'
# python3 manage.py migrate - migrate
# python3 manage.py runserver
# write view classes in views.py of api folder
# create new file in api folder for serializer
# in backendapi/backendapi folder edit urls.py file and add route for api.
# create file urls.py in api folder.
# add blank path and import urls from backend folder
Frontend
# npx create-react-app frontendapp - create react application
# cd frontendapp
# npm start
# remove logo.svg, app.test.js
# create folder components
# npm install react-router-dom
# npm i react-bootstrap
# npm install --save bootstrap@latest
# import '../node_modules/bootstrap/dist/css/bootstrap.min.css'; in index.js