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

20,210

Solution 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.

Solution 2

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

Share:
20,210
zelmundo
Author by

zelmundo

I came, I saw, I coded.

Updated on April 15, 2021

Comments

  • zelmundo
    zelmundo about 3 years

    This may be a noob question for some of you to answer, but I'm fairly new to the Anaconda software. I recently downloaded the django REST framework (version 3.1.3) I'm trying to develop a web app with the framework in Spyder IDE but I'm not exactly sure how to start it. I read the framework documentation at http://www.django-rest-framework.org/tutorial/quickstart/ but it's kind of vague. I want to know how exactly I can start the new app "quickstart".

  • zelmundo
    zelmundo almost 9 years
    Solved the problem. It turns out that I was using the right commands in the wrong window. I was supposed to write the commands in the command prompt within Spyder, not the Python console. Btw thanks for the tangowithdjango link, there's some really valuable information there!