Jon
Jon

Reputation: 432

Opening Existing Django Project in Visual Studio

I've been using Jetbrains Pycharm for years, but lately the performance has been getting abysmal. I'd like to give Visual Studio a shot.

So I cloned my main repo, through VS, and tried to setup a "Solution". It doesn't seem to recognize my project. In Pycharm I could just clone any old repo, open the folder and then select the interpreter/env I wanted to run it in. I've kinda got it working by creating a django project in VS and then loading all my files in, but that doesn't seem right or viable.

Any tips on how to setup/create a "Solution" for a cloned django project?

Screenshot of My Issue

Upvotes: 7

Views: 6817

Answers (2)

Wtower
Wtower

Reputation: 19902

To add to VME's question, this is a screenshot from VS2017:

VS2017 Python existing

Make sure to select Python itself rather than any of the items below (Web etc).

Upvotes: 3

veuncent
veuncent

Reputation: 1712

In Visual Studio create a new project and select Python -> From Existing Python code.
For Location choose the folder of your existing Django project.

Clicking Ok will open the "Create New Project from Existing Python Code Wizard" screen.
Your existing folder should already be entered, so click Next.

On the next screen I kept the Python interpreter settings at default (use global default). Click Next.

Then, be sure to check the box Customize Project Type and select Django Web Project.

Click Finish.

Source

Upvotes: 6

Related Questions