Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 286 Vote(s) - 3.35 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using django-admin on windows powershell

#11
After trying all of these solution, none worked for me on Windows 10. So I decide to follow [Django's docs][1] on how to fix it using '**venv**'.

First add these to your PATH on Win 7:

C:\CondaApps\

C:\CondaApps\Scripts

C:\CondaApps\Library\bin

DO NOT DOWNLOAD MICROSOFT STORE PYTHON!! IT MESSES WITH CONDA PYTHON!

(optional) Now uninstall Django: "python uninstall Django" then:

a) python -m venv myDjangoEnv2

b) cd into \Scripts

c) Run 'activate' command in command prompt

d) python -m pip install Django

e) django-admin --version

f) In another command prompt or terminal, cd back to your project folder (i.e. where the "manage.py " would be if you
already created a project)

g) python manage.py runserver

:)


[1]:

[To see links please register here]

Reply

#12
When I tried to uninstall Django, got the below message

(env) PS C:\Users\Windows 11\Documents\Python\env> pip uninstall django

WARNING: Skipping django as it is not installed.

So, went ahead and installed Django using below command
(env) PS C:\Users\Windows 11\Documents\Python\env> pip install django

Then, the django-admin utility worked for me.

(env) PS C:\Users\Windows 11\Documents\Python\env> django-admin startproject demoproject

This command was successful after that.
Reply

#13
Probably not the best way to do it, but it worked for me: <br/>
1.
```
pip uninstall django
```
2.
```
pip install Django
```
You should see this error in your terminal:
```
WARNING: The script django-admin.exe is installed in 'C:\Users\elio\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
```
Simply follow the instruction you get on the error:<br/>
You need to add django-admin.exe to your PATH, to do this you need to change the environment variable.<br/>
3. Open your settings, and search for 'environment variable' to open the 'system properties' window (in win10, it somehow won't find it if you type 'system properties')<br/>
4. Open the 'environment variable' <br/>
5. Find a User variable named 'Path' and click on 'edit'<br/>
6. Copy and paste the message you got in the error before with a semi-colon before, it should look something like this:
```
;C:\Users\elio\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts
```
Reply

#14
**Use the below command instead of your command:-**

python -m django startproject app-name
Reply

#15
`pip`, `django`, and/or `django-admin` are not in the PATH.

Either:
1. Set the path to include <python path>\Scripts.
2. Use a venv (which sets the scripts folder as part of the PATH in the venv)
3. Start whichever module you're trying to use with python/python3, e.g. `python3 -m pip install ...`.

Which of these options you choose depends on your usage of Python.
1. If you use it all the time and only use one version of python and one group of modules, set the $PATH for your installation of python.
2. If you use Python daily with multiple versions and/or differing sets of modules, use conda venvs.
3. If you rarely use python, or want to try the solution without modifying your system, call your python project using python/python3 and the module switch (-m).
Reply

#16
This problem is not related with django.This problem is related with command prompt.

first step: check your terminal if it is Powershell then change it to command prompt.

second step: download django using command pip install django.

third step: now type the start ptoject command ie django-admin startproject mysite and hit the enter button.

your project folder is now created.

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through