This project has moved and is read-only. For the latest updates, please go here.

change DjangoApp\vstemplate to get a DIY project structure

Nov 28, 2014 at 9:51 AM
we use a different project structure at work, just like the position of settings, wsgi etc.

so i try to find a way to change the django vstemplate which installed by ptvs tool.

nothing found, so i look into the ide install dir, find how to change the template

in case someone have the same problem as me, i write the way here down:

there to dir under ide dir:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
  1. ProjectTemplates
  2. ProjectTemplatesCache
1 used by ptvs installer, just some zipfile conatins vstemplate.

2 is what we need, but if we repair ptvs tool, 2 will be override by 1.
this is a dir, not zip file.
contains the configuration ide need when create a new project.
means the projectname input . it appears in almost everyfile
    <Project File="DjangoApp.pyproj" ReplaceParameters="true">
      <ProjectItem ReplaceParameters="true" TargetFileName=""></ProjectItem>
      <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$\"></ProjectItem>
      <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$\"></ProjectItem>
      <ProjectItem ReplaceParameters="true" OpenInEditor="true" TargetFileName="$safeprojectname$\"></ProjectItem>
      <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$\"></ProjectItem>
templateContent section is the most import conf, change this is a effective way to get a DIY directory hierarchy.

remember change the $safeprojectname$ in settings urls etc.
Nov 28, 2014 at 4:08 PM
You can also create your own template by saving a project into your Visual Studio 201x\Templates folder in your documents (plus a few subdirectories). This is the easiest way to create your own template, though it misses some functionality.

Also, if you install or repair basically any VS extension, the changes you've made in ProjectTemplatesCache will be overwritten, so this isn't the best way to do it. You could update the zip file or create a new one and then repairs won't break you.

Our of interest, how do you structure your projects? Maybe we could add a second template.