where does django install in ubuntu

I am looking for the init.py file for django. I tried whereis and find, but I get a lot of dirs.


Asked by: Audrey541 | Posted: 06-12-2021






Answer 1

you can just print it out.

>>> import django
>>> print django.__file__
/var/lib/python-support/python2.5/django/__init__.pyc
>>>

or:

import inspect
import django
print inspect.getabsfile(django)

Answered by: Edgar334 | Posted: 07-01-2022



Answer 2

This (or something like this) also works when you are searching for files in other packages:

$ dpkg -L python-django | grep __init__.py

Answered by: John740 | Posted: 07-01-2022



Answer 3

Its now at

/usr/lib/python2.7/dist-packages/django/....

circa 2012

Answered by: Adelaide258 | Posted: 07-01-2022



Answer 4

A one-liner command (which is given in the django docs) to find where your django source files are:

$ python -c "import django; print(django.__path__)"

Answered by: Kelvin635 | Posted: 07-01-2022



Similar questions

python - How to install django?

I have installed python 2.7 and ran the setup.py it executed various commands on command prompt but how can i see tha face of django i don't know what next step is. Whether i should have to set the path or not and how can i start the framework after setting the path. Thanks in advance.


python - How do I install Django on Ubuntu 11.10?

I'm using The Definitive guide to installing Django on ubuntu and ironically need something more definitive because I can't make it work. (I have followed the steps before this on the link above) Here is my situation/standstill: drewverlee@ubuntu:/var/src$ tar xzvf Django-1.3.1.tar.gz tar (child)...


python - How to install the Django plugin for the Eric IDE?

I can't believe I have to ask this, but I have spent almost three hours looking for the answer. Anyway, I have Eric IDE 4 installed on my linux distro. I can't seem to download any plugins to the plugins repository. The only one I really want is the Django plugin so when I start a new project in Eric, the Django option shows. The plugin repository just shows me an empty folder for .eric4/eric4plugins and there...


python - Django install issue

I was installing Django and was working through the steps when I ran python setup.py install. It was not recognized as an external or internal command. I did change the path to C:\Python27;.


python - Why is Django 1.0.x not able to install from PyPI?

I tried it on virtualenv: (venv) $ pip install Django==1.0.4 Downloading/unpacking Django==1.0.4 Could not find a version that satisfies the requirement Django==1.0.4 (from versions: ) No distributions matching the version for Django==1.0.4 Storing complete log in /home/tokibito/.pip/pip.log


python - Cannot install django 1.4 error

When I try install django 1.4 it gives me 1.5: imac9:site-packages pdadmin$ sudo pip install django==1.4.1 Downloading/unpacking django==1.4.1 Running setup.py egg_info for package django warning: no previously-included files matching '__pycache__' found under directory '*' warning: no previously-included files matching '*.py[co]' found under directory '*' Requested django==1.4.1, but installin...


python - How to install django 1.4

When trying to download django through: sudo pip uninstall django However, this downloads the new version of django 1.5. How would I force download version 1.4 through pip? Here is what I get when trying to install: imac9:site-packages pdadmin$ sudo pip install django==1.4.1 Downloading/unpacking django==1.4.1 Running setup.py egg_info for package django warning: no ...


python - Django install as local app

all. I am trying to use the Django-Plupload in my project(src:https://github.com/vellonce/django-plupload). And I need to customize the view.py of this external app. Since I am developing in my localhost and I need to deploy it on server in the future, I don't want it to stay in site package. Instead, I want to install it as local app. May I know what...


python - How to install Django in Ubuntu 11.10

I am very new to Ubuntu OS and Python as well. I want to install Django. But i dont have easy_install and I tried below command to install pip sudo apt-get install python-pip I got an error as below Unable to locate package python-pip I tried below command as well sudo apt-get install python-pip and i got erro...


python - Install Django from ZIP

I'm running Mac OS X 10.8.5, and am attempting to install Django from a ZIP. I downloaded the Django ZIP and ran the installer: RYAN-1970:~ jamesryan$ /Users/jamesryan/Downloads/django-django-597ab3c/INSTALL ; exit; /Users/jamesryan/Downloads/django-django-597ab3c/INSTALL: line 1: Thanks: command not found /Users/jamesryan/Downloads/django-django-597ab3c/INSTALL: line 3: To: command not found /Users/jamesry...


python - Django Failed to install index for?

When trying to migrate my django site to a fedora server and trying to run python manage.py syncdb/ test results in the following errors. How should I proceed to determine what is causing these errors? ceramic@astro1: ~/tmn_project >> python manage.py test Creating test database for alias 'default'... Failed to install index for admin.LogEntry model: (1, "Can't create/write to file '/tmp/ibj971An' (E...


python - How to run Django after Ubuntu 14.04 install

I am brand new to programming, but hopefully someone can help and this makes sense. When I run python from the terminal in Ubuntu it runs it from the following path. /homeX/your_username/python27/bin/python I used pip to install django which worked successfully, but it installed it to this path. /usr/local/lib/python2.7/dist-packages/Django There...


python - sudo pip install django

So this is my first attempt at trying to install Django, and when I ran it, it successfully installed Django-1.7.3 but I received these warnings below. I wasn't able to find any information about it online so I was hoping someone could clarify what they mean, if I need to fix them, and how I could go about doing that? Thanks! below is the output from my terminal


python - django send email - install time delay between sent emails

I am learning django and I have a test page that allows a user to "contact us" - and it is working - the emails are being delivered on my local development server. I have tried for two days now (I have read SO posts, django docs, google and a few tutorials), and cannot workout how to do the following: How do I place a time delay so the user would have to wait 3 minutes (or so) before sending the 'co...


python - Can't Install Django

I can't install Django, I read that pip is included in python 3.4, but when I write following command: pip install django this error appears: SyntaxError: invalid syntax. What I should do? Am I missing something? I'm using Python 3.4.2


python - Error trying to install Django with pip

I get the following error when I do "pip install django" in OSX... Downloading/unpacking django Error <urlopen error [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm> while getting https://pypi.python.org/packages/source/D/Django/Django-1.8.1.tar.gz#md5=0f0a677a2cd56b9ab7ccb1c562d70f53 (from https://pypi.python.org/simple/django/) Cleaning up.....


python - Django How to Install Forked App

I've forked an app on GitHub to add my own customizations. I'd now like to use the fork. I tried: pip install original_app pip install -e git+https://github.com/username/original_app.git#egg=original_app python manage.py syncdb It successfully installs my forked app. But none of my customizations are effective.


Install Python and Django - WHERE?

I have read tons of how-to install and watched several You-tubes regarding this matter. And they are all great, but none of the tells me as complete newbie how Python/Django works. The first question is: Where should I install what? On my client computer (Mac) or my server (Debian)? Or both? Second question: What is Django? A server or an app? The word framework tells me nothing how it works.


python - Django static jquery pip install won't load

Following along here I successfully ran: pip install django-static-jquery==2.1.4 However, I cannot get the static content to be served in Django properly. I have a simple html page: <html> {% load staticfiles %} {% static 'static_jquery/js/jquery.js' %} </...


python - pip install django error

I'm trying to install django using pip in Terminal. I always get an exception, however. The last error is always "permission denied", and I do not understand why. Any help is appreciated. Log: pip install django You are using pip version 7.1.0, however version 8.1.0 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Coll...


python - How can I install pyCurl?

I used libcurl with no problems and used pyCurl once in the past. Now i want to set it up on my machine and dev. However i have no idea how to do it. I rather not DL libcirl files and compile that along with pycurl, i want to know the simplest method. I have libcurl installed on my machine. I am on Windows. I tried DLing the sources and use pycurl setup script, but I had no luck.


Install python 2.6 in CentOS

I have a shell that runs CentOS. For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4. From what I've read, a number of things will break if you upgrade to 2.5. I want to install 2.5 separately from 2.4, but I'm not sure how to do it. So far I've downloaded the source tarball, untarred it, and did a ./configure --prefix=/opt which is where I want it to end ...


What should I install in order to be able to use GTK in Python on Ubuntu?

In my source code I have: import gtk But when I run the script with python3 script.py command I get the following error. What package should I install to get it working? Edit: my bad. here is the error: ImportError: No module named gtk Edit2: Thanks for the answer, kaizer.se. But I'm still getting an error message. Take a look at the following...


install python Mysql module

I've just installed python 2.6 on my win7 machine. Now I tried to install mysqldb. But when run "python setup.py install" C:\MySQL-python-1.2.3c1>python setup.py install Traceback (most recent call last): File "setup.py", line 15, in <module> metadata, options = get_config() File "C:\MySQL-python-1.2.3c1\setup_windows.py", line 7, in get_config serverKey = _winreg.OpenKey(_winreg....


boost - I've got Python built using VS2008, how do I install it?

I'm working with boost::python and wanted to build the whole thing to make sure I can pull it off. However, I don't see any install script or way to build the MSI so I can install it. Anyone know where the directions are? Or the projects I could use to make an MSI file? Doing this on linux seems trivial: make install How do I do this under windows


python - Error install PyGtk

I tried to install pygtk on mac. I downloaded the pygtk file, opened up terminal and set it to my working directory, then ran the command "python setup.py install". There was an import error because there was no module dsextras. Does anyone know how to install pygtk on a mac or get dsextras.


python - How do I install boto?

So that I am able to work with it within my python scripts?


python - How do I install pyCurl?

I tried everything! I cannot find a way to install pyCurl on my Windows 7 machine! I found these binaries link... BUT there are no binaries for 2.6. : ( Help would be great. : )


python - What is paster and how do I install it?

I am installing an application and have installed python and easy_install. I now have two steps to complete: 5. Make a config file as follows:: paster make-config openbiblio development.ini 6. Tweak the config file as appropriate and then setup the application:: paster setup-app config.ini I have read Stackoverflow answers and tried the web but cannot f...


How to install SSL for python 2.5 on Debian Linux?

Question How do I install SSL for Python 2.5 on Debian? I have tried: sudo easy_install ssl But getting: $ python setup.py build looking for /usr/include/openssl/ssl.h looking for /usr/include/krb5.h running build running build_py running build_ext building 'ssl._ssl2' extension creating build/temp.linux-i686-2.5 creating build/temp.linux-i686-2.5/ssl gcc ...


macos - python install on leopard

I'll admit I'm completely dumbed by python install. Can someone help me on how to install module I want to play with PyGame, PyOpenGL etc. So I install them, but I everytime I type "import pygame" error message shows up. here's my environment so far. In .bash_profile PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versions/Current/bin Using easy_install PyO...


python - How can I install pyCurl?

I used libcurl with no problems and used pyCurl once in the past. Now i want to set it up on my machine and dev. However i have no idea how to do it. I rather not DL libcirl files and compile that along with pycurl, i want to know the simplest method. I have libcurl installed on my machine. I am on Windows. I tried DLing the sources and use pycurl setup script, but I had no luck.


python - Install mysqldb on snow leopard

I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am running snow leopard and have mysql installed natively it is not part of MAMP or similar. Please can some tel...


Install python 2.6 in CentOS

I have a shell that runs CentOS. For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4. From what I've read, a number of things will break if you upgrade to 2.5. I want to install 2.5 separately from 2.4, but I'm not sure how to do it. So far I've downloaded the source tarball, untarred it, and did a ./configure --prefix=/opt which is where I want it to end ...


How to install 64-bit Python on Solaris?

I am trying to install Python 2.6 on Solaris by building the source on Solaris machine. I installed one this way and it appears that it is 32-bit. I downloaded some source tar ball as Linux or Unix for this purpose. Everything works well but I need 64-bit Python. I looked up the Python download site and there is no sepa...


macos - Install PyObjC on Python 2.6 on OS X 10.5?

OS X 10.5.8 came with Python 2.5, and had PyObjC already installed. I installed Python 2.6 from the python.org site, and PyObjC isn't there. I can't find a download to install PyObjC on my Python 2.6 install. Is checking out the PyObjC trunk and trying to build it my only choice? Will that work "out of the box"?


python - How to install numpy and scipy on Windows XP


python - How do I install SciPy on 64 bit Windows?

How do I install SciPy on my system? For the NumPy part (that SciPy depends on) there is actually an installer for 64 bit Windows: numpy-1.3.0.win-amd64-py2.6.msi (is direct download URL, 2310144 bytes). Running the SciPy superpack installer results in this message in a dialog box:...


What should I install in order to be able to use GTK in Python on Ubuntu?

In my source code I have: import gtk But when I run the script with python3 script.py command I get the following error. What package should I install to get it working? Edit: my bad. here is the error: ImportError: No module named gtk Edit2: Thanks for the answer, kaizer.se. But I'm still getting an error message. Take a look at the following...


python - How to install pycairo on osx?

I am trying to install the pycairo (Python bindings for the cairo graphics library) under OSX. I started with easy_install pycairo and got: Requested 'cairo >= 1.8.8' but version of cairo is 1.0.4 error: Setup script exited with Error: cairo...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top