I have already tried and found different ways and different conventions for
creating a project in Django using virtual environment
(virtualenv).
Creating a project in Django has no relation to virtualenv, I do not know if the question was poorly formulated, but creating the project depends only on having Django, having no dependence on the environment. Virtualenv is just a tool for creating isolated environments.
So, just having Django installed on the machine or the virtualenv environment, you can create your project using django-admin startproject meuprojeto
, this is the default, installing any other package to do this is redundant.
Maybe your question is:
How to create an isolated environment and how to start the environment?
In MacOSX I do this:
iMac:~ Orion$: pip install virtualenv, virtualenvwrapper
In the .profile file I add the references responsible for running virtualenvwrapper (storing in the file you are sure to restart the computer when the variables are reloaded):
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
To create an environment (creating it already activates the environment):
iMac:~ Orion$: mkvirtualenv ambiente_teste
To disable:
(ambiente_teste)iMac:~ Orion$: deactivate
To reactivate (using workon
):
iMac:~ Orion$: workon ambiente_teste
And to create a project (make sure you are creating the project in the desired directory):
(ambiente_teste)iMac:~ Orion$: django-admin startproject meuprojeto