Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: If one project using a spreadsheet exists, and you create second project without spreadsheet, running fab runserver immediately after returns error #18

Open
chrislkeller opened this issue May 19, 2013 · 1 comment

Comments

@chrislkeller
Copy link
Contributor

I've found this happens when I create a project, add credentials and key to secrets.py and config.py respectively, and then make a new project.

Step by step:

  • With only the readme project in the directory, I create a "new-project" using fab newproject and I choose to not associate a spreadsheet, largely because that isn't working for me.

  • In the "new-project" secrets.py to include my Google Drive account and password.

  • In the "new-project" config.py I add a key to a spreadsheet.

  • I go ahead and build out the project, test it, build it with fab deploy and everything runs smoothly.

  • The issue seems to arise when I go to create "second-new-project" using fab newproject and I choose to not associate a spreadsheet.

  • The project is created fine, but running fab runserver immediately after the project is created kicks out the error.

  • If I add a spreadsheet key -- or even an empty "key" -- to config.py in "second-new-project"

     GOOGLE_DOC = {
        'key': '',
    }
    

the test server boots fine

    (tarbell)19:31 [tarbell-template]  ( kpcc_production_templates ✖) 
    ... fab runserver
    Point your browser to http://localhost:5000/
    Type ctrl-c to quit.
    [localhost] local: python runserver.py
     * Running on http://0.0.0.0:5000/
     * Restarting with reloader
    ^C
    Stopped.

Terminal output leading to the error below:

    (tarbell)19:19 [tarbell-template]  ( kpcc_production_templates ) 
    ... fab newproject
    What is the directory name for the project? test-project
    What is your project's full title? This is a test
    Do you want a Google doc associated with this project? [Y/n]: n
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/config.py
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/secrets.py
    Created directory /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/static/css
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/static/css/project-styles.css
    Created directory /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/static/js
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/static/js/app.js
    Created directory /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/templates
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/templates/data_visuals_content.html
    Created /Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/templates/index.html
    Would you like to create a new branch and initial commit for this project? [Y/n]: n
    Okay! No new branch...

    Welcome to This is a test. Great work! What's next?

    - Edit test-project/config.py to set up template values and adjust project settings.
    - Edit test-project/secrets.py to configure Google spreadsheet authentication variables.
    - Edit test-project/templates/index.html to edit your default template.
    - Edit test-project/static/js/app.js to edit your default Javascript app.
    - Run `fab runserver` and view your project at http://localhost:5000/test-project/

    Run `fab deploy` and `fab project:projectname deploy` to deploy to S3 if you have a bucket configured.

    Done.
    (tarbell)19:19 [tarbell-template]  ( kpcc_production_templates ✖) 
    ... fab runserver
    Point your browser to http://localhost:5000/
    Type ctrl-c to quit.
    [localhost] local: python runserver.py
    Traceback (most recent call last):
      File "runserver.py", line 4, in <module>
        site = TarbellSite(os.path.dirname(os.path.abspath(__file__)))
      File "/Users/KellerUser/.virtualenvs/tarbell/src/tarbell/tarbell/app.py", line 36, in __init__
        self.projects = self.load_projects()
      File "/Users/KellerUser/.virtualenvs/tarbell/src/tarbell/tarbell/app.py", line 59, in load_projects
        project = imp.load_module(name, filename, pathname, description)
      File "/Users/KellerUser/Programming/2kpcc/tarbell-template/test-project/config.py", line 129, in <module>
        GOOGLE_DOC.update(secrets.GOOGLE_AUTH)
    NameError: name 'GOOGLE_DOC' is not defined

    Fatal error: local() encountered an error (return code 1) while executing 'python runserver.py'

    Aborting.
@eads
Copy link
Collaborator

eads commented May 19, 2013

Oh, weird! Good catch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants