Sinar / sinar_popit_ui

Just a UI app to communicate to popit with extra stuff we need
0 stars 1 forks source link

Missing config.yaml sample file + KeyError: 'apikey' #45

Open leowmjw opened 8 years ago

leowmjw commented 8 years ago

Is missing a sample config_sample.yaml that provide some guidance on what is needed.

I tried to create my own based on what I see in const.py but get following error:

(virtualenv) vagrant@precise64:/vagrant$ python manage.py

Traceback (most recent call last):
  File "manage.py", line 7, in <module>
    from app import db
  File "/vagrant/app.py", line 4, in <module>
    import const
  File "/vagrant/const.py", line 4, in <module>
    api_key= config["apikey"]
KeyError: 'apikey'

Details (YAML file validated with a Linter):

(virtualenv) vagrant@precise64:/vagrant$ cat config.yaml

--- 
config: 
    apikey: "ABef09876543210"
    api_endpoint: "popit_ng.service.consul:8000"
    secret_key: "0xxS&H1234567890"
    admin_name: "admin"
    admin_pass: "passw0rd"
    db_path: "postgresql.service.consul"
sweemeng commented 8 years ago

I have added example of config.yaml to statichack branch.

I also added a view to fetch auth token. at /api-token-auth/ Just post username and password.

http://www.django-rest-framework.org/api-guide/authentication/#generating-tokens