How to get/assign the contents of the app code directory into my Django project

40 views
Skip to first unread message

jaisol

unread,
Mar 10, 2015, 5:47:57 PM3/10/15
to django...@googlegroups.com
Hi,

Sorry to ask such a silly question.... I just cloned a Django app via git and I want to get the contents of the app code directory into my Django project.

The Readme.md says the following but I don't get it :-(

Folder Structure

You will need to get the contents of the src/idea directory into your Django project. The simplest way to do this might be a symbolic link.

mydjango_project/
  |- idea/      (includes models.py, views.py, etc.)
  |- mydjango_project/ (settings.py, url.py, etc.)
  |- manage.py
  |- etc etc etc
Any advice or guidance would be greatly appreciated !!

Thanks!

Gergely Polonkai

unread,
Mar 10, 2015, 6:03:55 PM3/10/15
to django...@googlegroups.com

Hello,

this pretty much depends on your environment. I, personally, use virtualenv and pip, so most likely will install such an external app like this:

pip install git://my.favourite.provider/awesome/app.git

If you use your system python, with a system-wide installed django, then you may either want to install this new app into a system-wide python directory, or simply inject it into your application's structure (which, in turn, may mess up your version control system, if you use any; and you should).

Best,
Gergely

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b5f3a14a-a487-4459-843f-ca7d560beff9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jaisol

unread,
Mar 10, 2015, 7:09:47 PM3/10/15
to django...@googlegroups.com
Thanks for your quick response.

Ok. I'm using my system python with a system-wide installed django.

I ran git clone:
git clone https://github.com/provider/app.git and it created the folder structure of the django app I think.

what I don't get is how to complete your advice ("or simply inject it into your application's structure") within the downloaded app.
I mean, after downloading the app via git clone... should I create/edit some configuration file to get the contents of the "src/idea" app directory into my django project? and how? :-(

Thanks again!

Gergely Polonkai

unread,
Mar 11, 2015, 2:59:59 AM3/11/15
to django...@googlegroups.com

Hello,

as you didn't say which module you downloaded from GitHub, I cannot give you exact information. Most Python modules have a ”setup” system, which will copy all installable components to their place. If you can't (or don't want to) install a module, you have to copy these files manually.

From your question I guess that this module has all its files under appname/src, so I think it will be enough to copy the src folder next to your app directory, with a sane name (e.g. extmodule). After this step, you can use extmodule as if it were your own app, like inserting it into INSTALLED_APPS, etc.

However, the way you want to do it can really mess up things, especially when a new version of this app gets released. You should install (and I mean install, not just copy) the app system-wide, or into your own home directory (and in this case add the location to PYTHONPATH). I personally suggest to use virtualenv, which makes this above process a child's play :)

Best,
Gergely

jaisol

unread,
Mar 11, 2015, 12:23:49 PM3/11/15
to django...@googlegroups.com
Thanks again for your time on this.

Even the setup.py comes with the downloaded app I didn't execute it because it wasn't part of the Install steps noted at the README.md file.

Also, I didn't say which module I downloaded from GitHub because I thought it was against the forum policies so I guess I was wrong :-(, I mean... to point an specific url outside externally.

Would you mind to take a look at https://github.com/mherick/idea-box and let me know what is the best way (virtualenv, setup.py, copy src folder, ...) to make this app/module usable? (by the way, I have completed all the Installation steps except the "Folder Structure" section which is the cause of my original post)

Once again, Thank you so much for your time !

jaisol

unread,
Mar 11, 2015, 3:20:24 PM3/11/15
to django...@googlegroups.com
After re-reading I just got what I should do... Thanks again !
Reply all
Reply to author
Forward
0 new messages