I am trying to find the file Django admin but I can't find it. What command can I use to find where this is located? Thanks.
P.S I am using windows 10
Did you install django according to the documentation? In that case, modules installed via pip (that includes django, which in turn includes the admin) will reside in %USERPROFILE%\Envs, with %USERPROFILE% being %SystemDrive%\Documents and Settings\{your username}
From your terminal, type:
python -c "import django; print(django.__path__)"
Related
I will be thankful if someone can help me with the following issue.
I am using windows 10
Django version: 2.1.1 with Python version: 3.5
I have my TensorFlow object detection API, that trained my images which is totally outside of my Django project.
However, I created my Django project after that in the same environment that I had my TensorFlow object detection models.
Both of them with the same (python version: 3.5).
Before creating the Django webpage, I always needed to run my 'Object_detection_image.py' from anaconda prompt line, otherwise, I got an error.
My question is: how I can specify my Object_detection_image.py path directory in the setting.py in Django using anaconda prompt line?
When I write my directory like this: C:\tensorflow1\models\research\object_detection
then how I can use anaconda prompt line in this path? because if I write it like this, it doesn't work. please help me.
Thank you.
I did not run it because I have a problem with how to write the path for my TensorFlow project. I thought if they locate in the same environment, I won't get any problem. I mean before creating Django I could not run it directly from the script. I had to use an anaconda prompt line. but now, since i have django i dont know how to do it.
Currently I am trying to work with Django in PowerShell , Windows Vista. According to this blog, I need to
ad a .ps file to PowerShell with the text:
$env:PYTHONPATH=“R:\django\packages\django-trunk”
$env:PATH=$env:PATH + “;D:\Programs\Python25\;R:\django\packages\django-trunk\django\bin”
function django-admin {python (gcm django-admin.py | resolve-path) $args}
However, I cannot find the "django-trunk" folder anywhere under my Python27 directory. Am I overlooking or
misunderstanding something? I am using Python 2.7 with Django 1.4.2.
django-trunk is meant to be the path to your django installation. django-trunk would be the name of the directory if you were using the development version of Django (according to the Django docs).
Your Django installation is probably in ...python2.7/site-packages/django/.
So Cloud9 looks really cool, and you can create python files in it, but I can't figure out how to get it to run a Django project. I imported one from my github account into the IDE, but it says I need to install Django (a django.core import error) so I need to help getting going. Any Ideas? Any skeleton projects on the web that I missed that will do this?
After some research and looking for an answer on different blogs and sites I finally found a solution:
Create a new workspace
Execute easy_install django to install Django
Create new Django project python ./../bin/django-admin.py startproject myproject
Start dev server python ./myproject/manage.py runserver $IP:$PORT
Access http://projectname.username.c9.io
Voilà!!!
I hope this helps
Just write commands in shell as it is:
sudo pip install -r requirements.txt (you should have there django)
than
python manage.py runserver $IP:$PORT
you will have app on https://projectname-username.c9.io
You may also have to add the proper path: <workspace_name>-<username>.c9users.io to the ALLOWED_HOSTS list in django_project/settings.py file, as suggested by the error message returned by django server. Tested on Django 2.0
I've got a version of a module (South 0.6) installed system-wise and a newer version installed in my home. When I add 'south' to my INSTALLED_APPS, it uses the system-wise version. How can I tell Django to use the version in my home?
Thanks
Jul
Virtualenv (and virtualenvwraper) is definitely your friend for handling things like this when you are able to create a new environment. You should go ahead and play with it. If you are not able to mess around with virtualenv right now, you can just put your personal python lib path at the front of PYTHONPATH:
# from your command prompt:
$ export PYTHONPATH=$HOME/your/python/libs:$PYTHONPATH
There is a package named virtualenv which was designed to handle this specific problem. It allows you to create a virtual environment for each python project (ie. Django project), letting you choose which version of a module is installed.
Trying to upload my django app on my obunto slice. The problem I'm facing right now there are a couple of packages I'm using. Which I installed in site packages on my machine. Now when I put them online on the server their sadly not working. Any ideas how to make them work.
p.s I get a error on import
Python must have a way to find these packages. Did you use standard installation procedures for them (i.e. setup.py install) or copy them in an accessible directory? If you didn't use setup.py install, check your PYTHONPATH environment variable. It should contain the directory where your packages are stored. If it doesn't, you can create it.
This is a Python issue really, not a Django issue.
To get more help paste the import error you're getting, as well as the directory structure of where you installed this package.