7
Vote

Django 1.5 - support creating projects with different Django versions

description

Hi,

I looked around for a bit for a direct answer but only found bits and pieces. I was wondering what would people recommend me doing in order to use PTVS with the beta of Django 1.5? Should I be creating the project outside of VS and import it or is there
an easier way to specify Django versions when creating a new project from within VS at the new project creation wizard?



Thanks!

comments

newfound wrote Mar 14, 2013 at 6:11 AM

I was the original one who posted the description text in the discussions section and I was wondering what the status of this was especially since Django has now moved from version 1.4 to 1.5. Which basically leads me to the obvious. If this will not be a future feature when will PTVS no longer include Django version 1.4 and instead include version 1.5?

Lastly I was wondering if the workaround that I was given in the discussions (see below) will work with the PTVS 2 Alpha?


Here is the work around I was given.
This is a little bit rough right now.  What I would suggest creating it outside of VS and importing it, but the new project from existing code feature currently doesn't create Django projects.  So I'd suggest after using that to import the code I'd open the project by hand and make a couple of updates to it.  You should add:

 

<Import Project="$(VSToolsPath)\Python Tools\Microsoft.PythonTools.Django.targets" />

At the end right before the "</Project>" line, and then replace the 1st property group in the .pyproj file with:

  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>$guid1$</ProjectGuid>
    <ProjectHome>.</ProjectHome>
    <ProjectTypeGuids>{5F0BE9CA-D677-4A4D-8806-6076C0FAAD37};{349c5851-65df-11da-9384-00065b846f21};{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
    <StartupFile>manage.py</StartupFile>
    <SearchPath></SearchPath>
    <WorkingDirectory>.</WorkingDirectory>
    <LaunchProvider>Django launcher</LaunchProvider>
    <OutputPath>.</OutputPath>
  </PropertyGroup>

That'll give you all of the normal Django project features.  I'll also open a work item for us to support creating projects with different Django versions.

Zooba wrote Mar 14, 2013 at 7:38 PM

That workaround will let you use the New Project From Existing Code wizard, but it shouldn't matter for the newer Django versions.

We haven't been testing against the newer version, but we don't really do anything that magical - we're only an editor - so if you install the later version then your code will use it. That said, IntelliSense may be a little bit off, depending on what they've changed, and it's possible that the launcher may need to be updated.

Since they've released, we'll certainly look at supporting both versions, which basically means we'll work with whichever version you've decided to install.

newfound wrote Mar 14, 2013 at 10:22 PM

Thanks for the info. For reference the discussion post I was talking about where I first got the code change was from http://pytools.codeplex.com/discussions/405277