How to Setup Django/DRF Project | Complete Django and React Project #2
Step-by-step instructions on how to correctly set up a Django/DRF (Django Rest Framework) project: 1) Install virtual environment On the terminal create a virtual environment. Terminal command: python -m venv [name of the environment (usually env)] 2) Activating the virtual environment In order to use the virtual environment has to be first activated. What it means to be activated is that the next commands in the terminal will be on the virtual environment. To activate, type the following command (in my laptop): source env/Scripts/activate (different depending on the OS and the terminal used) 3) Creating and setting up Django Project a) Install django in terminal: pip install django, djangorestframework b) Install also "djangorestframework" for projects using django only as a backend a. Add 'rest_framework' in installed_apps in setting.py c) Create project in terminal: django-admin startproject [name of project] (use . for not creating subdirectory) 4) Run Django application Go to the project route directory (the virtual environment) and run the following command: python manage.py runserver If you want to run on a specific port just put the number of the port in the front of the command( eg: python manage.py runserver 8001 ) 5) Create an app In the project route directory (the virtual environment) and run the following command: python manage.py startapp [name of the app] 💡 What You'll Learn in this Project: • Set up a Django and React application • Create beautiful styles with Tailwind CSS and DaisyUI • Organize project directories and files • Understand the principles of RESTful design • Database modeling with Django ORM. • Developing RESTful APIs with Django Rest Framework, serializers, and views • Set up a React project with React Router DOM • Use Redux for internal state management • Use TanStack Query (also known as React Query) for remote state management (to see) • Integrate Django with React • Deploy the Django API and React application (to see) 👉 Tutorial Series: https://www.youtube.com/watch?v=lnKRbV-LcZg&list=PLJlAVd0VeOMQqqhNS00R7x08-2EshVyHe&index=2&ab_channel=Danyoncode 📚 Related Resources: 🔗 Django and React Todo App - - https://www.youtube.com/watch?v=FdMf_3SurOA&t=425s&ab_channel=Danyoncode 🔗 Django and React Authentication Series - https://www.youtube.com/watch?v=hBdr_9FPz9U&list=PLJlAVd0VeOMSF5z64X0nMZZwC88Q8pLBi&ab_channel=Danyoncode 🎉 Thanks for Watching! Thank you for being a part of Dany on code. If you found this video helpful or entertaining, consider sharing it with your friends. Your support means a lot! #danyoncode #django #djangorestframework #webdevelopment #djangoProject #djangosetup
Download
0 formatsNo download links available.