Skip to content

Latest commit

 

History

History
28 lines (26 loc) · 2.05 KB

README.md

File metadata and controls

28 lines (26 loc) · 2.05 KB

win-virtualenv-django-startup

This script was written to help automate creation of "virtualenv" environment for Django project on Windows computer.
So, what, exactly, this script do:

  • creating new virtualenv environment with selected name in your default virtualenv folder(%HOMEDRIVE%%HOMEPATH%\Envs)
  • downloading and installing latest version of Django into created in previous step 'virtualenv' environment(Note: internet connection needed)
  • creating new Django project with selected name in selected directory (Note: name of the Django project is the same as a name of created earlier virtualenv environment)
  • Binding virtualenv with Django project folder(newly created one)

  • To start - just run this script from your command prompt(cmd.exe). During the execution(will take about 2-3 min), you'll be asked to input two parameters: name of the project(it is also a name for your virtualenv instance) and Windows path to the directory, where you want to create new Django project with selected name. Note: virtualenv does not support parameter name with spaces! Also, before you start, you need to have python, pip, virtualenv, virtualenvwrapper-win already installed onto your system.
    After installation is finished, script would wrote details (name of the project and its folder path) into a .txt file named "virtualenv_django_startup.txt" located at %HOMEDRIVE%%HOMEPATH%\Envs if it's possible.

    To bind your Django project with "intelliJ IDEA community edition", you need to open a project within intelliJ IDEA and select "new..." project SDK in "project structure" menu(Ctrl+Alt+Shift+S). Then, chose a path to your python installation inside of the virtualenv directory (Usually looks like this: C:\Users\some_user_name\Envs\my_project_name\Scripts\python.exe).

    Executed commands:

  • mkvirtualenv <name>
  • pip install django
  • django-admin startproject <name>
  • setprojectdir <path>