Project settings for Webstorm/Django/AngularJS
Hi,
I'm a new user of Webstorm, using it to develop a new AngularJS app in an existing Django app. Anyone have any experience with that?
I want to make sure I get the Webstorm project set up correctly.
The VCS is git on github.
I've installed djangular. Among other things, djangular provides app name-space when copying the static files.
When deploying a Django app, normally you call "manage.py collectstatic" which copies static files up to a separate directory from where they are served directly by an HTTP server.
Here is an abbreviated tree that shows how things are currently set up.
static <-- served directly by HTTP server ├── lib │ └── angular │ └── i18n ├── rideshares <-- static app files copied here by collectstatic (name-spaced to app name "rideshares" by djangular) │ ├── bower_components │ │ ├── angular │ │ ├── angular-bootstrap │ │ ├── bootstrap │ │ ├── ng-grid │ ├── css │ ├── js │ ├── partials │ └── views project/apps/rideshares <-- Django application source ├── app <-- this and below is the Angular app structure created by djangular │ ├── bower_components │ │ ├── angular │ │ ├── angular-bootstrap │ │ ├── bootstrap │ │ ├── ng-grid │ ├── css │ ├── js │ ├── partials │ └── views project/templates ├── rideshare │ ├── main.html (contains the angular <ng-view>, but this file doesn't change much)
So, in configuring/creating my Webstorm project from the existing code, should I set the Project Location to be project/apps/rideshares/app ? That would kind of make sense. In that case, I believe Webstorm would add various project files to that directory. Should I either commit them or .gitignore them?
Now, if I do that, changes I make there would normally have to be copied to the static directory (static/rideshares) using the Django collectstatic command. Should I create a deployment target that would perform the same function? Is it possible to have it automatically or continuously deployed, so I don't have to do it manually each time?
I think I may not want to use the Webstorm VCS since this JavaScript app is just a smaller part of a larger application. Often when I'm committing code, I'm including other stuff that is not related to JavaScript or the files in the Webstorm project.
Thanks in advance for your help!
Liam
Please sign in to leave a comment.
Hello!
> In that case, I believe Webstorm would add various project files to that directory. Should I either commit them or .gitignore them?
it's up to you... the only files that shouldn't be shared are workspace.xml and tasks.xml files which store user specific settings
See also https://intellij-support.jetbrains.com/entries/23393067-How-to-manage-projects-under-Version-Control-Systems
Note that you can avoid creating .idea files in your project/apps/rideshares/app directory: just create a project somewhere else and then add project/apps/rideshares/app as a content root in settings/Directories
>Should I create a deployment target that would perform the same function? Is it possible to have it automatically or continuously deployed, so I don't have to do it manually each time?
Yes. You can configure auto-deployment - see http://www.jetbrains.com/webstorm/webhelp/options.html, 'Upload changed files automatically to the default server'