[Django]-How to start new web app in Spyder IDE using Django REST framework

1👍

Django Rest Framework is, in a way, a wrapper over Django that makes building REST services in Django easy.

Regardless of your IDE, it seems like you haven’t got a hang of Django per se.

To start an app quickstart,

  1. Install Python and pip
  2. Install Django using pip: pip install django should do the trick.
  3. Setup a database
  4. Setup your first django app django-admin.py startproject quickstart

This would install Django and a Django app called quickstart. Your best place to start learning Django would be this excellent tutorial: http://www.tangowithdjango.com/book17/

Also, please look at the Django docs, which are very exhaustive: https://docs.djangoproject.com/en/1.7/

Please note, that both the above links are for Django 1.7.

However, if you do know about Django, then you just need to pip install djangorestframework, add it to your INSTALLED_APPS in settings.py and get started.

👤Newtt

5👍

Django framework above 3+ version project in Spyder IDE

Follow this steps:

  1. Install python
  2. Execute this command python -m pip install Django
  3. Use this command to confirm Django installed python -m django --version
  4. Create new project, execute django-admin startproject mysite
  5. Go to Spyder IdE, Open Projects -> New Project
  6. Select existing directory in pop-up screen, browse the mysite folder.

Now you can see the Django created and imported in Spyder IDE.

enter image description here

0👍

If the command django-admin startproject mysite can be directly run in the Anaconda command terminal.

Alternatively you can run the command in the command prompt of your computer, but you will have to run it in the directory "C:\Users…\anaconda3\Scripts"

The new django project will also get created in the Scripts folder

0👍

Press Ctrl+F6 then check ‘command line options’ after that type ‘runserver’ in the box. you must have selected manage.py when pressing run.

Leave a comment