permission denied while collect static django - python

I had project with django + guicorn + nginx (this tutorial)
I delete virtualenvironment and get a new one, everything works correctly but, when I try to use command:
source projectenv/bin/activate
folder1/project/manage.py collectstatic
I got an error:
-bash: folder1/folder/manage.py: Permission denied
even when I try:
folder1/folder/manage.py runserver 0.0.0.0:8000
-bash: folder1/folder/manage.py: Permission denied
What should I do to make this virtualenvironment work correctly?

python3 folder1/project/manage.py collectstatic
worked properly
thanks to comment falsetru

Related

Python Django Beginner: can't open manage.py

Trying to get started with Django on pycharm.
(venv) C:\Users\Vince\PycharmProjects\assignment>python manage.py runserver
But I get this error message whenever i run manage.py:
C:\Users\Vince\AppData\Local\Programs\Python\Python37-32\python.exe: can't open file 'manage.py': [Errno 2] No such file or directory
I do have a django directory opened with a manage.py file in it. Can anyone assist me on what to do?
I have tried other solutions, like:
python -vvvvv manage.py runserver
python manage.py migrate
You need to either specify the exact location of the manage.py file. I.e.:
python3 Users/Vince/Desktop/DjangoProject/manage.py runserver
or cd to the directory it's in and run from there.
cd Users/Vince/Desktop/DjangoProject > python manage.py runserver

Accidently deleted Profiles and Stubs4 from Django and unable to run manage.py

I wanted to clear the database because I messed in putting correct parameters to update_or_create and create functions of django.For that I deleted the database from pgadmin4 in postgres and deleted all__pycache__, stubs.v4 and the Profiles folder in my django project because I wanted to again feed data into the database.
My goal is to upload a .csv file and fill data row by row (create/update) to database.
Now these errors neither let me create superuser not let me do run manage.py
PS C:\Users\Dell\Desktop\github\DjantoSoft> python manage.py runserver
c:\python37\python.exe: can't open file 'manage.py': [Errno 2] No such file or directory
PS C:\Users\Dell\Desktop\github\DjantoSoft> django-admin createsuperuser
No Django settings specified.
Unknown command: 'createsuperuser'
As told by #aasmpro, the error was that in Visual Studio Code I was out of the folder where manage.py was located.
Also, to empty database python manage.py flush should be used instead.

Django: cannot import name “get_svn_revision”

I'm trying to install OSQA, a Django application on Linux Red Hat (Python 2.7 and Djando 1.6). I synchronized the databases and I restarted Apache without get any error.
export DJANGO_SETTINGS_MODULE=settings
python2.7 manage.py syncdb --settings=settings
python2.7 manage.py migrate --settings=settings --fake
$APACHE/restart
After I opened the site from the browser I get HTTP status "200" Error, and in the logs I get this error:
ImproperlyConfigured: Error importing module forum.middleware.extended_user: "cannot import name get_svn_revision"
(See complete Logs)
Any help is greatly appreciated. Thank you!
I was also having this issue with OSQA, and restarting Apache solved it for me. I'm not sure why this happened though; sorry!

Deploy hook for django syncdb not working on openshift

I created a django app on openshift successfully. But, I'm not able to run syncdb using the following deploy hook.
#!/bin/bash
source $OPENSHIFT_HOMEDIR/python/virtenv/bin/activate
cd $OPENSHIFT_REPO_DIR/wsgi/$OPENSHIFT_APP_NAME
python manage.py syncdb --noinput
What could be wrong? Please help!
I think its simply because you forget to add the right for file execution with chmod +x filename

with ./mange.py syncdb getting permission denied in django project

root#domU-xx-xx-39-04-x5-36:/opt/sana# ./manage.py syncdb
-bash: ./manage.py: Permission denied
I tried both django.db.backends.mysql and mysql for 'ENGINE'
I am able to connect to root using
mysql -u root -p
My settings.py file is correct
My Django version is 1.1.1 on Ubuntu LTS 10.04 in EC2
Check manage.py has execute permission. If not give it by
# chmod +x manage.py
List permissions:
ls -l
If it has x permission on the first 3 characters "--x":
./manage.py syncdb
Also, you are able to execute it using python just with read permission "r--":
python manage.py syncdb

Categories

Resources