Map of street food in nyc.
App will have map of common street food corners with lists of food available and average price. Log the price of your food from a selection of street foods.
TL;DR: Django, DRF, DRF SimpleJWT with React Frontend sample.
The purpose of this is to get you started with a secure React-Django project. No need to implement authentication+authorization on your frontend when it's already done for you. You can start by pressing "Use this template"; it's not a fork but a new repository with a fresh initial commit with all the code from here.
Test user: test
and pw test
.
This repository is an example of using React on the front end comminicating with Django, Django Rest Framework and DRF SimpleJWT applications.
cd server
to get your terminal/cmd into the server directory.- To run the server
a. create a virtual environment
virtualenv venv && source venv/bin/activate
. On Windows, you should dovenv\Scripts\activate
instead ofsource venv/bin/activate
b. install packagespip install -r requirements.txt
orpip3 install -r requirements.txt
on mac OS using Python 3-- the requirements.txt file is inside the server subdirectory c. Runpython manage.py migrate && python manage.py runserver
orpython3 manage.py migrate && python3 manage.py runserver
for mac OS using Python 3. - If you're writing for an example repository, please create
a new directory labeled with the name of the framework (e.g. jwt-ios),
and add its
.gitignore
. Please use the github/gitignore repository. Provide detailed instructions if necessary.
A default user with the username test
and password test
have been created.
This repository does not come with throttling, but it is highly recommended that you add throttling to your entire project. You can use a third-party package called Django-ratelimit or DRF's internal throttling mechanism. Django-ratelimit is more extensive -- covering Django views, as well -- and thus more supported by SimpleJWT.
-
cd jwt-react
to get your terminal/server into the frontend (react) folder. -
npm install
to install all of the dependencies for the front end application. -
npm start
and you should be good to go, ensure that your backend is running on porthttp://localhost:8000
, if you run it on another port/ip please change theBASE_URL
. -
Use
npm test
if you'd like to run the test which tests the api/ folder currently.
This repository is licensed under the MIT License.