ChiranthakaJ
ChiranthakaJ

Reputation: 47

How to run previously created Django Project

I am new to Django. I am using Python 3.7 with Django 2.2.6.

My Django development environment is as the below.

At the first time I could run the project using >python manage.py runserver

Then I had to restart my computer.

But my problem is I don't know how to go inside the previously created project 'firstProject' and app 'firstApp' using the 'Command prompt' or using the 'VSCode Terminal window'

Thanks and regards, Chiranthaka

Upvotes: 0

Views: 7039

Answers (3)

Chisom Ogugua
Chisom Ogugua

Reputation: 26

Simply navigate to the folder containing the app you want to manage using the command prompt.

The first cd should contain your parent folder. The second cd should contain the folder that has your current project. The third cd should be the specific app you want to work on. After that, you can use the python manage.py to keep working on your app.

Upvotes: 1

Hussain Abdullah
Hussain Abdullah

Reputation: 43

  • Go to the directory where manage.py file of your Django project is present. It is normally the Base directory of your project.
  • In that directory, Press Shift and Right Click at the same time.
  • The from the Right Click Menu, Click on "Open PowerShell window here".
  • If you have previously frozen the dependencies, you should download them first through requirement.txt file using command:
    pip install -r requirements.txt
  • Then run start server command in your PowerShell window.
    python manage.py runserver
  • You will see output like this in PowerShell:
    Validating models...

    0 errors found
    November 10, 2019 - 17:36:02
    Django version 1.5, using settings 'my_django15_project.settings'
    Development server is running at http://127.0.0.1:8000/
    Quit the server with CONTROL-C.
  • Open the address e.g in above case it is http://127.0.0.1:8000/ in your browser, and you will be able to see your project.

Upvotes: 1

Niknak
Niknak

Reputation: 593

Your concern is that you just have to guide your way into the correct folder using the command cd. As in this example:

1. C:\Users\User: cd MainFolder
2. C:\Users\User\MainFolder: cd firstProject
3. C:\Users\User\MainFolder\firstProject: dir (or ls -la for linux, to list all files etc.)
   16-Apr-19  07:14    <DIR>          .
   16-Apr-19  07:14    <DIR>          ..
   15-Apr-19  21:50    <DIR>          .idea
   15-Apr-19  21:43           195,961 firstApp.py

Just a roughly tree structure below to show how it is visualized:

C:
|
|---Main folder
     |
     |---firstProject (if this is your folder)
           |
           |---firstApp (this is your app)

Upvotes: 1

Related Questions