Django Configuration in python 2.7 + installation - django

I did goggling for at-least 2 hours. I did go through with the documentation of Django and Installation Guide properly but still not succeed to configure Django in my system. I need help
I've windows-07, python 2.7 and want to configure Django 1.4.1 in my system.
What I did till time?
1.installed successfully python 2.7
checked the version by
import sys
print sys.version
2. Now, downloaded and unzipped Django (official version 1.4.1) and put this directory in my C Drive (where folder python 27 resides)
I did run setup.py of Django through cmd but still not succeed.
Can any one give me suggestion what I'm doing wrong here?
Any help is welcome, thanks

for windows-7, official version of django... have you tried this command in cmd !
in directory of django -> python setup.py install

Related

Google Cloud SDK fails to install on Windows 10

Having Python27 installed on a Windows 10 I'm failing to install Google's Cloud SDK.
Its install fails with:
ImportError: cannot import name _remove_dead_weakref
Failed to install.
On its way to this failure it suggests:
Please verify that the following is the path to a working Python 2.7 executable:
C:\Users\c\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe
If it is not, please set the CLOUDSDK_PYTHON environment variable to point to a working Python 2.7 executable.
A working Python 2.7 is indeed in the desired place. Setting CLOUDSDK_PYTHON doesn't fix its problem
I removed the environment variable PYTHONHOME and the Google Cloud SDK installed successfully.

ImportError: No module named 'django' despite having it installed running apache2 server

I know that many have posted similar question however I tried most solution without success.
I'm trying to host a webpage with apache2 and django in python3.
In the error log I found ImportError: No module named 'django' when accessing the wsgi.pyfile, where I also added import sys, sys.version to confirm which python version is used and from the error log I can see that I'm running following python version 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609].
When I run python3.5 I see that I uses the same python version and here I can run import django without any error!
EDIT: I checked django.__file__and saw that it was located in /home/USERNAME/.local/lib/python3.5/site-packages/django/init.py and that path /home/USERNAME/.local/lib/python3.5/site-packages wasn't in the sys.path that tried to run django. But adding it with sys.path.append(path) didn't help :(
Any thoughts what I might have messed up?
If you have Setup the whole configuration in VirtualEnv then , i suggest you to activate it by,
source /location to /env/bin activate
pip3 install django=version_id
or pip install django=version id
if you want to pass version id then its good or it will install the latest django from your repo.
Now test Django Version there.
Hope you will no get the error.
Location - means the path where env will be located in project directory, if you have followed the standard installation process of django or else you don't need, and version id- vesion of django framework.
I finally understood how to solve it! first I had to run pip3 uninstall django then run sudo pip3 install django.

I can't run cqlengine on centos

I installed python 2.7 and django 1.5 on centos server. I installed cqlengine too but when I want to run my project
This error happen:
can not import model cqlengine
CAn any one help me what shoud I do..
Thanks
You need to upgrade python on your centos box. It looks like you're using python 2.6 on your centos box. Set comprehensions (what's happening in the cqlengine file) were not introduced until python 2.7. That's most likely your problem.

Setting mod_wsgi, django python version

I'm having trouble setting up the correct python version for mod_wsgi / django setup.
After numerous bugs I think i'm nearing the end of this tedious setup... I'm trying to run a command from my manage.py file using ./manage.py collectstatic
This is failing because it's trying to use the Python 2.4 version (I have 2.7 installed as well), I believe the version error only occurs when i manually try and run manage. My django.wsgi file inserts the python 2.7 dir into sys.path
Thanks for your help
python2.7 manage.py collectstatic worked. Thanks to Display Name for the comment

importerror: No module named django

I installed python 2.6 alongside my mac's 2.5.2 version. As soon as I did, python2.6 manage.py runserver failed because it couldn't find django.core.management.
From a shell, import django returns importerror: No module named django.
Why?
Did you reinstall Django?
This happens when I install side by side versions of Python on Gentoo. Whenever I install a new version, I have to either reinstall the new ones or make a symlink to the old site-packages.
Because each installation of Python uses its own directory to store libraries. On a Mac, they are in /Library/Python/2.x/site-packages/. Presumably you originally installed Django in the 2.5 directory, but it isn't yet in the 2.6 one. You can symlink it there if you want to, or reinstall it using the new version.
Add site-packages to PYTHONPATH:
export PYTHONPATH="/home/jerome/bin/django-1.1/lib/python2.6/site-packages:$PYTHONPATH"
Worked on Ubuntu, with a python/django virtual environment using virtualenv and pip.
Source: http://benfsayer.com/importerror-no-module-named-django-core-management/
I use Bitnami's Django installer, and this happened for me when I wasn't in their custom shell, which I believe sets related python path environment variables. I ran ./use_djangostack in the root of the Bitnami package and then was successful running the server again.