Script Cron Job not working


#1

Hi,
tried creating script for email reminder users not logged for 14 days…
Error returned: python manage.py email_reminder is not a valid command…
Any suggestion?(using python 3.4 django 1.8)
thanks


#2

Is your script in the right directory?


#3

yes,
inside management folder created file init.py .
Then inside it created folder commands and inside it created files init.py and email_reminder.py
where did I go wrong? thanks


#4

Just to be careful, can you write out the location of your files like so:

— yourproject (whatever you named it)
—— manage.py
—— collection (whatever you named it, your app)
——— models.py

Etc — just need to see the exact placement of the script files relative to your project.


#5

This is how I did:
Project folder
manage.py
—myappfolder:
———init.py
—————command folder:
———————init-py
————————email_remider.py

then I go back to project folder and enter: python manage.py email_remider


#6

Looks like you have the structure wrong, should be like this:

manage.py
— myappfolder
—— management
——— __init__.py
——— commands
———— email_reminder.py
———— __init__.py

So there is a management directory within your app directory, which has an __init__.py. In the management folder, there is a commands directory, which has another __init__.py and your command file, email_reminder.py.