This forum is no longer active. Please post your questions to our new community site

./manage.py permission denied

Subscribe to ./manage.py permission denied 15 post(s), 3 voice(s)

 
Avatar timwilliams 7 post(s)

Hi, I’ve just installed the djangostack in mac osx Tiger. I cannot run any command with./manage.py. I’m trying to syncdb but keep getting permission denied error. I’ve thought making it executable by running the command: chmod +x django-admin.py from the bin file but still permission denied.

can anyone help please?

Thanks

Tim

 
Avatar antonio 621 post(s)

Have you loaded the environment by executing the script named use_djangostack?

 
Avatar timwilliams 7 post(s)

yeah I started it up like this.

$ cd /Applications/djangostack-1.0.2-0
$ ./use_djangostack

started a project and an app, just can’t get the syncdb to work.

 
Avatar antonio 621 post(s)

Mmmm and what does the error say exactly? We are not Django developers, I am afraid that none of us knows exactly how to use syncdb :S

 
Avatar timwilliams 7 post(s)

./manage.py syncdb from the project directory produces this error:

./manage.py: Permission denied

i’m a beginner myself, so slightly confused

Thanks for your help

 
Avatar antonio 621 post(s)

And what are the permissions of the file? Who is the owner? Is it possible that you installed the stack as a different user? (I know this is basic and you have probably checked)

 
Avatar timwilliams 7 post(s)

Yeah i’m the owner, and the stack is installed under the same user profile. all can read and write.

 
Avatar antonio 621 post(s)

Damn, well, we had to try that one :)

How can we reproduce this issue on our side? Remember, we know nothing about Django.

Thanks in advance

 
Avatar timwilliams 7 post(s)

right well I’m using your Djangostack 1.0.2-0 on Mac OSX Tiger.

I have started a project called Tim: $ django-admin.py starpproject Tim

In the Tim Directory I have created an application called “Ticket” :$ django-admin.py startapp Ticket

In the Ticket Directory I have put the following in the models.py file:

from django.db import models
from django-contrib.auth.models import User
from django.contrib import admin

TICKET_STATUS_CHOICES = ( (‘new’, ‘New’), (‘assigned’, ‘Assigned’), (‘reopened’, ‘Reopened’), (‘closed’, ‘Closed’),

)

class Ticket(models.Model): assigned_to = models.ForeignKey(User, null=True, blank=True) status = models.Charfield(max_length=20, choices=TICKET_STATUS_CHOICES, default=’new’) description = models.Textfield() created_on = models.DateTimeField(‘date created’, auto_now_add=True) updated_on = models.DateTimeField(‘date updated’, auto_now=True)

def name(self):
    return self.description.split('\n', 1)[0]

Class TicketAdmin(admin.ModelAdmin): pass

admin.site.register(Ticket, TicketAdmin)

Back in the Tim Directory I try to run the ./manage.py syncdb to create the database but get the permission denied message.

Thanks very much

 
Avatar antonio 621 post(s)

What database engine have you configured in settings.py?

 
Avatar timwilliams 7 post(s)

sqlite3

 
Avatar antonio 621 post(s)

Hi,

I have tested this on Linux, and it works for me. I’ll try OS X later. In the meanwhile, where is the database file that you are using, and what are the permissions of it, its folder, and all its parent folders? Does the database exist already? If not, can you try to use the touch command to create it in the place that is defined by settings.py?

Thanks in advance

 
Avatar Ansem 4 post(s)

Does manage.py have the necessary permissions?
It looks like you’ve chmoded django-admin,but forgot about manage.py.

Have you tried calling the script with path_to_python/manage.py ?

 
Avatar timwilliams 7 post(s)

Cheers Ansem, yeh, how did I miss that!? Problem solved!

 
Avatar antonio 621 post(s)

Hehe, it usually happens. The more difficult issues tend to have the most simple solution. Glad to hear that it worked :)