Miserlou / django-aws-billing

Django AWS Usage/Billing Package.
MIT License
14 stars 5 forks source link

Package not creating management/command folder and scripts #4

Closed zerosoul13 closed 10 years ago

zerosoul13 commented 10 years ago

Hello,

I've reported this already (Issue #1) but thought that this issue could be related to my custom python2.7 acting a bit weird. Just did an install on a fresh virtualenv and issue persists. Here's the deal:

pip install django-aws-billing #This goes ok
installed app on settings.py ('aws_billing') # ok
python manage.py syncdb # Still ok

(django_aws)[angel@localhost dab]$ python manage.py syncdb
Creating tables ... 
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_groups
Creating table auth_user_user_permissions
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table aws_billing_billingrecord

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'angel'): arod
Email address: zerosoul13@ljdhkaj.com
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

but when i try to execute the process_aws_billing command it fails:

(django_aws)[angel@localhost dab]$ python manage.py process_aws_billing
Unknown command: 'process_aws_billing'
Type 'manage.py help' for usage.

Since i have the cloned repo, i just did a copy of the missing dirs:

cp -a management/ /home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing

Before:

/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing
/home/angel/coding/django_aws/lib/python2.7/site-packages/django_aws_billing-0.1.1-py2.7.egg-info
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/__init__.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/__init__.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/admin.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/admin.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/aws_billing.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/aws_billing.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/models.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/models.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/tests.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/tests.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/views.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/views.pyc

After:

/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing
/home/angel/coding/django_aws/lib/python2.7/site-packages/django_aws_billing-0.1.1-py2.7.egg-info
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/__init__.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/__init__.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/admin.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/admin.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/aws_billing.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/aws_billing.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/models.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/models.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/tests.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/tests.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/views.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/views.pyc
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/__init__.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/commands
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/commands/__init__.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/commands  /aws_costs.py
/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/commands/process_aws_billing.py

Now execute again and it works (no config was done so this is expected):

(django_aws)[angel@localhost dab]$ python manage.py process_aws_billing
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)

File "/home/angel/coding/django_aws/lib/python2.7/site-packages/django/core/management/init.py", line 399, in execute_from_command_line utility.execute() File "/home/angel/coding/django_aws/lib/python2.7/site-packages/django/core/management/init.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/angel/coding/django_aws/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv self.execute(_args, _options.dict) File "/home/angel/coding/django_aws/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute output = self.handle(_args, _options) File "/home/angel/coding/django_aws/lib/python2.7/site-packages/aws_billing/management/commands/process_aws_billing.py", line 31, in handle fd = retrieve_remote_stats(aws_settings.AWS_ACCOUNT_ID.replace('-', ''), aws_settings.AWS_BILLING_BUCKET) File "/home/angel/coding/django_aws/lib/python2.7/site-packages/django/conf/init.py", line 55, in getattr return getattr(self._wrapped, name) AttributeError: 'Settings' object has no attribute 'AWS_ACCOUNT_ID'

The package is basically broken on pip. What do we need to get this fixed? I'm willing to contribute if needed.

Cheers,

Angel.

Miserlou commented 10 years ago

AttributeError: 'Settings' object has no attribute 'AWS_ACCOUNT_ID'

That looks to be the error. Did you put your AWS settings in your project?

Miserlou commented 10 years ago

Oh, I see. Hang on.

zerosoul13 commented 10 years ago

The exception is expected due that no config was done. Just wanted to share the output to show how i solved the issue. The package is not placing the management/commands folders when installing.

Miserlou commented 10 years ago

Yeah, I see that now. Although the manifest includes a recursive *.py include, so I don't know why it's skipping that directory.

Miserlou commented 10 years ago

I added a more explicit inclusion. I thiiiink it works now?

zerosoul13 commented 10 years ago

Created a virtualenv and installed django-aws-billing from pip (got package django-aws-billing==0.1.3)

Worked out of the box. Many thanks for fixing this!

Miserlou commented 10 years ago

Thank you for reporting it!