You are not logged in.

#1 2018-06-14 12:05:57

akmann
Member
Registered: 2018-06-14
Posts: 3

Unable to create new Django project

Hi all.

I am Node developer learning Django.

I am getting the following error while creating a new django project:

lTsXkuh.png

I have installed all the prerequisites including django using this guide django tutorial.

I am on a fresh arch installation.

What could be the possible cause?

Thanks in advance

Last edited by akmann (2018-06-15 10:36:44)

Offline

#2 2018-06-14 12:13:11

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Unable to create new Django project

akmann wrote:
$ django-admin startproject django_project
The program 'django-admin' is currently not installed. You can install it by typing:
sudo apt install python-django-common

...
I am on a fresh arch installation.

Excuse me, but that doesn't look like Arch Linux at all.

How exactly did you install the prerequisites?

Last edited by ayekat (2018-06-14 12:13:54)


pkgshackscfgblag

Offline

#3 2018-06-14 14:24:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,768

Re: Unable to create new Django project

ayekat wrote:

Excuse me, but that doesn't look like Arch Linux at all.

Yeah, I am guessing Debian.  Closed. Dustbinned.

akmann,  If I am wrong, and you are running Arch, report this thread and drop the moderators an explanation.

Edit:  I saw your report, please update your first post with the correct output.  Re-opening and moving to "Applications and Desktop Environments"

Last edited by ewaller (2018-06-14 14:36:28)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2018-06-15 22:28:07

RoundCube
Member
Registered: 2016-05-14
Posts: 42

Re: Unable to create new Django project

What could be possible causes:

- that you are in a venv - I don't know, maybe you cannot access other python things which are not installed into said virtual environment

- maybe you want django-admin.py – although, no, that should not be the cause

Offline

#5 2018-06-16 04:33:21

akmann
Member
Registered: 2018-06-14
Posts: 3

Re: Unable to create new Django project

I have tried to replicate steps on Ubuntu, and it works like charm, but for some reason, it doesn't on Arch.

I am struggling with this issue for  2 days but haven't found any workaround.

Offline

#6 2018-06-16 06:59:51

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: Unable to create new Django project

django-admin works for me here in a virtual env. I used the builtin version in python3, though.

(pacman -S python)
mkdir -p /tmp/project
cd /tmp/project
python -m venv pythonenv
source pythonenv/bin/activate
pip install django==1.11
django-admin startproject django-project
deactivate

Last edited by progandy (2018-06-16 07:01:02)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2018-06-16 15:46:13

RoundCube
Member
Registered: 2016-05-14
Posts: 42

Re: Unable to create new Django project

progandy wrote:

django-admin works for me here in a virtual env. I used the builtin version in python3, though.

(pacman -S python)
mkdir -p /tmp/project
cd /tmp/project
python -m venv pythonenv
source pythonenv/bin/activate
pip install django==1.11
django-admin startproject django-project
deactivate

You installed django with pip into the venv. I wonder if it would generally not work if you installed the Archlinux package instead (which lies outside the venv)

EDIT:

akmann wrote:

I have tried to replicate steps on Ubuntu, and it works like charm, but for some reason, it doesn't on Arch.

Ubuntu uses by default python2, arch python3. This also reflects in a different naming scheme.
The ubuntu package python-django is the python2 package, while in Arch it is the python3 package.

The python2 package is python2-django, and to not clash with the python3 package the command in question has been renamed to django-admin2

That said, django did drop support for python 2 with version 2.0, the python 2 variant remains at version 1.11. Python 3 has been out for 10 years.

Last edited by RoundCube (2018-06-16 16:21:55)

Offline

#8 2018-06-20 16:30:05

akmann
Member
Registered: 2018-06-14
Posts: 3

Re: Unable to create new Django project

I reinstalled arch and now everything works as expected.

Offline

Board footer

Powered by FluxBB