Issues In Initial Setup For Django Project
Solution 1:
You can just run django-admin startproject mysite
(Note: not django-admin.py
), because if you install django by pip, a executable program named 'django-admin.exe' will be added to 'C:\Python34\Scripts', which is already in your environment variable 'PATH' normally(if not, add it to PATH).
Solution 2:
I was facing the same issue while installing Django 2.0.5. This can be resolved using Virtual Environments.
Environment details:
- Python version: 3.6
- OS: Ubuntu 18.xx.x
Steps:
- Install Virtual Environment
pip install virtualenv
- Create a Virtual work-space('VEnv')
virtualenv --python=python3 VEnv
- Activate the Virtual Environment:
cd VEnv/ source bin/activate
- Install Django(Version - 2.0.5)
pip install django==2.0.5
- Create Project (Project Name: HelloDot)
django-admin startproject HelloDot
- Run the server as below and then access it from "http://127.0.0.1:8000/"
cd HelloDot/ python manage.py runserver 8000
For more details, take a look at this: https://www.howtoforge.com/tutorial/how-to-install-django-on-ubuntu/
Solution 3:
Make sure that you follow the troubleshooting guide because it looks like you don't have django-admin.py on your system path correctly. From the docs:
django-admin.py should be on your system path if you installed Django via python setup.py. If it’s not on your path, you can find it in site-packages/django/bin, where site-packages is a directory within your Python installation. Consider symlinking to django-admin.py from some place on your path, such as /usr/local/bin.
You should also use a virtualenv for each of your projects to allow isolation of dependencies per project and easier management of them. virtualenvwrapper is a useful tool for creating and managing your virtualenvs.
Post a Comment for "Issues In Initial Setup For Django Project"