Last active
May 16, 2017 05:10
-
-
Save nck2/2685ce77e78f586308db02c8055ccad7 to your computer and use it in GitHub Desktop.
crontab & kronos error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#settings/common.py | |
INSTALLED_APPS = [ | |
'django.contrib.admin', | |
'django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.staticfiles', | |
'sshsapp', | |
'django_crontab', | |
'kronos', | |
] | |
#settings/prod_aws.py (배포세팅) | |
INSTALLED_APPS += ['storages'] | |
#ssapp/cron.py | |
@kronos.register('*/1 * * * *') #1분마다 | |
def my_scheduled_job(): | |
Post2.objects.create(extext="kkk") | |
dday=datetime.date.today() | |
yday=dday+datetime.timedelta(days=-1) | |
tday=dday+datetime.timedelta(days=1) | |
fai="등록된 메뉴가 없습니다." | |
fai2="등록된 사진이 없습니다." | |
## 이후 스크래핑 소스 | |
#requirements.txt | |
appdirs==1.4.3 | |
awscli==1.11.85 | |
awsebcli==3.10.1 | |
beautifulsoup4==4.6.0 | |
blessed==1.14.2 | |
boto==2.46.1 | |
boto3==1.4.4 | |
botocore==1.5.48 | |
cement==2.8.2 | |
colorama==0.3.7 | |
Django==1.10 | |
django-bootstrap3==8.2.3 | |
django-crontab==0.7.1 | |
django-kronos==1.0 | |
django-storages==1.5.2 | |
docker-py==1.7.2 | |
dockerpty==0.4.1 | |
docopt==0.6.2 | |
docutils==0.13.1 | |
jmespath==0.9.2 | |
olefile==0.44 | |
packaging==16.8 | |
pathspec==0.5.0 | |
Pillow==4.1.1 | |
psycopg2==2.7.1 | |
pyasn1==0.2.3 | |
pyparsing==2.2.0 | |
python-crontab==2.2.2 | |
python-dateutil==2.6.0 | |
PyYAML==3.12 | |
requests==2.9.1 | |
rsa==3.4.2 | |
s3transfer==0.1.10 | |
semantic-version==2.5.0 | |
six==1.10.0 | |
tabulate==0.7.5 | |
termcolor==1.1.0 | |
wcwidth==0.1.7 | |
websocket-client==0.40.0 | |
#error log | |
[2017-05-16T04:52:57.901Z] INFO [2060] - [Application update app-1943-170516_135237@25/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_xzeroapp/Test for Command 01_migrate] : Completed activity. Result: | |
Completed successfully. | |
[2017-05-16T04:52:57.902Z] INFO [2060] - [Application update app-1943-170516_135237@25/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_xzeroapp/Command 01_migrate] : Starting activity... | |
[2017-05-16T04:52:58.182Z] INFO [2060] - [Application update app-1943-170516_135237@25/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_xzeroapp/Command 01_migrate] : Activity execution failed, because: Traceback (most recent call last): | |
File "manage.py", line 22, in <module> | |
execute_from_command_line(sys.argv) | |
File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line | |
utility.execute() | |
File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 341, in execute | |
django.setup() | |
File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/__init__.py", line 27, in setup | |
apps.populate(settings.INSTALLED_APPS) | |
File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/apps/registry.py", line 85, in populate | |
app_config = AppConfig.create(entry) | |
File "/opt/python/run/venv/local/lib/python3.4/site-packages/django/apps/config.py", line 90, in create | |
module = import_module(entry) | |
File "/opt/python/run/venv/lib64/python3.4/importlib/__init__.py", line 109, in import_module | |
return _bootstrap._gcd_import(name[level:], package, level) | |
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import | |
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load | |
File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked | |
ImportError: No module named 'django_crontab' | |
(ElasticBeanstalk::ExternalInvocationError) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment