1
  1. create virtualenv
  2. create project (chat)
  3. follow instructions at https://github.com/qubird/django-chatrooms, after which there is a src folder in the root of the virtualenv
  4. navigate to virtualenv/src/chatrooms and run the command python setup.py install, this installs app folder with all files and folders at virtualEnv/src/chatrooms/chatrooms

How do I get this to install to my project, not to virtualEnv/src/chatrooms/chatrooms? I also checked Can't install Django app from git and how can i download code from git hub using command line but am still stuck.

Community
  • 1
  • 1
Paddy Popeye
  • 1,634
  • 1
  • 16
  • 29
  • 1
    virtualenv just encapsulates your project requirements which you installs via `pip install ..` . So just pip install the app at project directory level, add that app in the INSTALLED_APPS list in settings.py, and you are ready to use the app in your project.I think this is what you want to listen - It will not be installed alongside your project directory. – kapilsdv Jul 14 '16 at 11:37
  • As @KapilSachdev said, just use `pip install django-chatrooms`, like the app [mentions](https://github.com/qubird/django-chatrooms#installation). – dasdachs Jul 14 '16 at 11:47
  • ok, if installed at the project directory level(with virtualenv deactivated). I end up with a "SRC" at the project directory level. In order to run "setup.py install", I nedd to navigate to VirtualEnv/chat/src/chatrooms. This installs the app to VirtualEnv/chat/src/chatrooms/chatrooms .. ... so far only working solution is to manually copy the app folder from virtualenv/chat/src/chatrooms/ to virtualenv/chat/ .But this cannot be the correct way of doing this ???? – Paddy Popeye Jul 14 '16 at 12:16
  • Why deactivate virtualenv ? Just make and activate it (from project dir), pip install your app and that's it. What do you want with "src" or anything if you want to use the app. Why do you need to run setup.py install ? Your app is already installed just waiting for you to add it in the INSTALLED_APPS. Don't worry about virtualenv directory tree. – kapilsdv Jul 14 '16 at 12:34
  • activated or deactivated same result – Paddy Popeye Jul 14 '16 at 12:37
  • also it is already in INSTALLED_APPS, and also the required url in the urls.py,(as per https://github.com/qubird/django-chatrooms ) and also the correction of an import statement in the models.py file to from polymorphic.models import PolymorphicModel.. but the app is always installed to virtualenv/chat/src/chatrooms/chatrooms – Paddy Popeye Jul 14 '16 at 12:49
  • No, That's what you are doing wrong. You shouldn't create a dir by yourself. Just enter `virtualenv env` on the cmd line and you will have a virtualenv with the dir named **env** inside your project dir. Now activate it `source /env/bin/activate`(if you are on the project dir) and then just install all your apps. See [here](https://virtualenv.pypa.io/en/stable/userguide/). – kapilsdv Jul 14 '16 at 13:13
  • 1..create dir mkdir VirtualEnv 2...cd to Virtual Env and run virtualenv . 3...django admin.py startproject chat 4....cd chat 5... run pip install -e git+git://github.com/qubird/djangochatrooms#egg=chatrooms 6...cd src/chatrooms 7..run python setup.py install NOW i have an app installed to VirtualEnv/chat/src/chatrooms/chatrooms... Where exactly am I going wrong ??? – Paddy Popeye Jul 14 '16 at 13:14
  • ok have tried as I listed but with the change step 1 and 2 from above are now just virtualenv DjangoChatEnv all other steps from 3 onwards remain as above.. and I get the exact same thing installed to DjangoChatEnv/chat/src/chatrooms/chatrooms. – Paddy Popeye Jul 14 '16 at 13:24

2 Answers2

3

Just follow these:

  1. cd in to the directory where you want your project to store you source code eg. home/.
  2. Then run django-admin startproject chat
  3. This will create a chat directory in your current directory
  4. Now cd to the chat directory.
  5. run virtualenv env
  6. This will create a directory namely env. Now just activate the virtualenv by running source /env/bin/activate (if you are in the chat dir).
  7. As you now have you virtualenv ready and activated, just installed all your apps by running pip install .. and you are ready to go.

And don't worry about the env folder and its content or where your installed app code goes (until you want to change something in the installed app, which is usually not the case).

All you have to see is if your installed app works or not.

kapilsdv
  • 719
  • 4
  • 10
  • ok following your instructions of project first then virtual env really changes nothing, the app chatrooms is now installed to root/chat/env/src/chatrooms/chatrooms... and this when installed from either the chat dir or the env dir .... i need a smoke :0 – Paddy Popeye Jul 14 '16 at 13:47
  • I really don't understand what do you want with the virtualenv directory structure. Also, all the apps are installed from the project directory, (chat here). Don't worry where the installed app source code goes. All you should worry about is either you installed app(chatroom or any) is working or not.And Lastly using virtualenv is a recommendation not a requirement. So don't worry about it at all. All it does is provide you an isolated environment for your project. – kapilsdv Jul 14 '16 at 15:46
  • And also DON'T run `python setup.py install`, you have already installed the app with _pip_. – kapilsdv Jul 14 '16 at 15:59
0

The method below installs directly to the prjoect level directory with no nedd to manually move file , .ie, not installed to src/chatrooms/charooms

1 create virtualenv (optional)

2 create project

3 cd to project

4 run git init

5 run command git clone "{protocol:url}"

6 add app to settings & and urls to main UURLCONF file

Paddy Popeye
  • 1,634
  • 1
  • 16
  • 29