Use 3rd party django package in my own project (PYTHONPATH)

48 views
Skip to first unread message

Kasra Khosravi

unread,
May 11, 2015, 3:21:06 PM5/11/15
to django...@googlegroups.com
i am creating a susbcription management system and I want to use a third party django package for reporting :


Since I am new to django, I'm not sure how to use it, First I install it using pip (I have also tried installing it using setup.py), after that I think I have to add this package to my PYTHONPATH but I have no idea how to do it.

After doing this, when I put that package under "Installed_Packages" in django settings.py, Nothing happends.

i was wondering if anybody can help me with this?

Mario Gudelj

unread,
May 12, 2015, 1:51:43 AM5/12/15
to django...@googlegroups.com
Have you looked at https://django-model-report.readthedocs.org/en/latest/installation.html ?

After you add it to "INSTALLED_APPS" (I guess that's what you meant by adding it to 'Installed_Packages') you need to create reports.py etc. The instructions on RTD are pretty good...

--
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/ac50f0ad-ea9a-4e61-90ad-6d8ef281f329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kasra Khosravi

unread,
May 12, 2015, 3:48:25 AM5/12/15
to django...@googlegroups.com
Thanks for the reply. My problem is with this section. can you guide me how to do this part in Ubuntu or Windows?

  • Add the model_report directory to your Python path.

Joakim Hove

unread,
May 12, 2015, 4:17:54 AM5/12/15
to django...@googlegroups.com


,

Thanks for the reply. My problem is with this section. can you guide me how to do this part in Ubuntu or Windows?

  • Add the model_report directory to your Python path.


Well - the main point is not adding the model_report directory to your Python path per se - the point is that your python interpreter should find the model_report package. To test that you can run Python interactively and try to import the model_report package:

python
>> import model_report

If that works (which it should when you have installed with pip install) you are good to go, otherwise you need to update the PYTHONPATH environment variable. Exactly how to set the PYTHONPATH variable depends on your OS/Shell - but for instance with Ubuntu and bash it would be:

export PYTHONPATH=/path/to/your/python/stuff

J
 
Reply all
Reply to author
Forward
0 new messages