wagtaildemo errors

303 views
Skip to first unread message

Jeffrey Knorr

unread,
Dec 19, 2014, 2:17:40 PM12/19/14
to wag...@googlegroups.com
Hello,

I was impressed with the wagtail video and wanted to give this a try on my own. I'm new to Python (coming from Drupal and PHP land) so I might be missing something here.  I have vagrant up and running, cloned the wagtail demo repo, and am trying to run the ./manage.py createsuperuser step.  I'm getting the following errors no matter how I try to execute that.

Any ideas on what I'm missing here?

Thank you,

Jeff

-bash-4.3$ pwd
/home/vagrant/wagtaildemo
-bash-4.3$ ls
demo  etc  LICENSE  manage.py  media  README.md  requirements  Vagrantfile  Vagrantfile.local.example  wagtaildemo
-bash-4.3$ ./manage.py createsuperuser
: No such file or directory

-bash-4.3$ manage.py createsuperuser
-bash: manage.py: command not found
-bash-4.3$ python manage.py createsuperuser
Traceback (most recent call last):
  File "manage.py", line 8, in <module>
    from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
-bash-4.3$

Jeffrey Knorr

unread,
Dec 19, 2014, 2:20:45 PM12/19/14
to wag...@googlegroups.com


I wasn't very clear above, I'm getting the error at the line indicated below:
git clone https://github.com/torchbox/wagtaildemo.git
cd wagtaildemo
vagrant up
vagrant ssh
  (then, within the SSH session:)
./manage.py createsuperuser  <--- Errors
./manage.py runserver 0.0.0.0:8000
 

Matthew Westcott

unread,
Dec 19, 2014, 3:01:50 PM12/19/14
to wag...@googlegroups.com
Hi Jeff,
If the Vagrant VM had come up correctly, I would expect to see "(wagtaildemo)vagrant@vagrant-ubuntu-trusty-32:~/wagtaildemo$" as the command prompt, rather than "-bash-4.3$", so I think something's going astray before that point. Can I confirm the following:

* You're starting the commands (from "git clone https://github.com/torchbox/wagtaildemo.git" onward) from your machine's own command prompt, not within an existing Vagrant instance
* When you run 'vagrant up', several minutes worth of installation takes place, ending with the lines:

Running migrations for demo:
- Migrating forwards to 0004_create_form_page.
> demo:0001_initial
> demo:0002_auto__add_field_standardpage_postcode
> demo:0003_auto__del_field_standardpage_postcode
> demo:0004_create_form_page
- Loading initial data for demo.
Installed 0 object(s) from 0 fixture(s)

* Running 'vagrant ssh' then gives you a login message beginning with "Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-35-generic i686)"

If this isn't the case, please can you let me know the output from these commands? (Just the last 30 or so lines should be fine)

Cheers,
- Matt
> --
> You received this message because you are subscribed to the Google Groups "Wagtail" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+u...@googlegroups.com.
> To post to this group, send email to wag...@googlegroups.com.
> Visit this group at http://groups.google.com/group/wagtail.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/a72acdfd-5b7b-42f8-a8f4-00331b269ab1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jeffrey Knorr

unread,
Dec 19, 2014, 3:42:49 PM12/19/14
to wag...@googlegroups.com
Hi Matt,

I'm trying to test this on a Windows 7 laptop. It looks like there are several instances of syntax errors relating to \r after executing the 'vagrant up' command.  Could this just be due to unnecessary carriage returns/bad formatting in some of the scripts? 

Here's more output as you requested showing some of the errors.  vagrant SSH does launch but shows errors as below.  Thank you for any additional help that you can send my way.

Jeff

==> default: Cleaning up...
==> default: /home/vagrant/.bashrc: line 4: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 6: $'return\r': command not found
==> default: /home/vagrant/.bashrc: line 7: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 11: $'\r': command not found
: invalid shell option name.bashrc: line 13: shopt: histappend
==> default: /home/vagrant/.bashrc: line 14: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 18: $'\r': command not found
: invalid shell option name.bashrc: line 21: shopt: checkwinsize
==> default: /home/vagrant/.bashrc: line 22: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 25: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 25: $'\r': command not found
==> default: /home/vagrant/.bashrc: line 32: syntax error near unexpected token
`$'in\r''
'=> default: /home/vagrant/.bashrc: line 32: `case "$TERM" in
==> default: Syncing...
==> default: Creating tables ...
==> default: Creating table auth_permission
==> default: Creating table auth_group_permissions
==> default: Creating table auth_group
==> default: Creating table auth_user_groups
==> default: Creating table auth_user_user_permissions
==> default: Creating table auth_user
==> default: Creating table django_content_type
==> default: Creating table django_session
==> default: Creating table south_migrationhistory
==> default: Creating table django_admin_log
==> default: Installing custom SQL ...
==> default: Installing indexes ...
==> default: Installed 0 object(s) from 0 fixture(s)
==> default:
==> default: Synced:
==> default:  > django.contrib.auth
==> default:  > django.contrib.contenttypes
==> default:  > django.contrib.sessions
==> default:  > django.contrib.messages
==> default:  > django.contrib.staticfiles
==> default:  > south
==> default:  > compressor
==> default:  > modelcluster
==> default:  > django.contrib.admin
==> default:  > wagtail.wagtailsnippets
==> default:
==> default: Not synced (use migrations):
==> default:  - taggit
==> default:  - wagtail.wagtailcore
==> default:  - wagtail.wagtailadmin
==> default:  - wagtail.wagtaildocs
==> default:  - wagtail.wagtailusers
==> default:  - wagtail.wagtailimages
==> default:  - wagtail.wagtailembeds
==> default:  - wagtail.wagtailsearch
==> default:  - wagtail.wagtailredirects
==> default:  - wagtail.wagtailforms
==> default:  - demo
==> default: (use ./manage.py migrate to migrate these)
==> default: Running migrations for taggit:
==> default:  - Migrating forwards to 0002_unique_tagnames.
==> default:  > taggit:0001_initial
==> default:  > taggit:0002_unique_tagnames
==> default:  - Loading initial data for taggit.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailcore:
==> default:  - Migrating forwards to 0011_remove_page_revision_created_at_auto_
now__nullify_page_owner_on_delete.
==> default:  > wagtailcore:0001_initial
==> default:  > wagtailcore:0002_initial_data
==> default:  > wagtailcore:0003_auto__del_unique_site_hostname__add_unique_site
_hostname_port
==> default:  > wagtailcore:0004_fields_for_scheduled_publishing
==> default:  > wagtailcore:0005_create_page_view_restriction
==> default:  > wagtailcore:0006_add_uniqueness_constraint_on_group_page_permiss
ion
==> default:  > wagtailcore:0007_auto__add_field_page_locked
==> default:  > wagtailcore:0008_add_page_lock_permission_to_moderators
==> default:  > wagtailcore:0009_auto__add_field_page_latest_revision_created_at

==> default:  > wagtailcore:0010_populate_latest_revision_created_at
==> default:  > wagtailcore:0011_remove_page_revision_created_at_auto_now__nulli
fy_page_owner_on_delete
==> default:  - Loading initial data for wagtailcore.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailadmin:
==> default:  - Migrating forwards to 0001_create_admin_access_permissions.
==> default:  > wagtailadmin:0001_create_admin_access_permissions
==> default:  - Loading initial data for wagtailadmin.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtaildocs:
==> default:  - Migrating forwards to 0002_initial_data.
==> default:  > wagtaildocs:0001_initial
==> default:  > wagtaildocs:0002_initial_data
==> default:  - Loading initial data for wagtaildocs.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailusers:
==> default:  - Migrating forwards to 0002_add_user_profile_model.
==> default:  > wagtailusers:0001_initial
==> default:  > wagtailusers:0002_add_user_profile_model
==> default:  - Loading initial data for wagtailusers.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailimages:
==> default:  - Migrating forwards to 0005_make_filter_spec_unique.
==> default:  > wagtailimages:0001_initial
==> default:  > wagtailimages:0002_initial_data
==> default:  > wagtailimages:0003_focal_point_fields
==> default:  > wagtailimages:0004_auto__chg_field_rendition_focal_point_key
==> default:  > wagtailimages:0005_make_filter_spec_unique
==> default:  - Loading initial data for wagtailimages.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailembeds:
==> default:  - Migrating forwards to 0002_auto__add_field_embed_author_name__ad
d_field_embed_provider_name.
==> default:  > wagtailembeds:0001_initial
==> default:  > wagtailembeds:0002_auto__add_field_embed_author_name__add_field_
embed_provider_name
==> default:  - Loading initial data for wagtailembeds.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailsearch:
==> default:  - Migrating forwards to 0003_auto__del_searchtestchild__del_search
test.
==> default:  > wagtailsearch:0001_initial
==> default:  > wagtailsearch:0002_auto__add_field_searchtest_live
==> default:  > wagtailsearch:0003_auto__del_searchtestchild__del_searchtest
==> default:  - Loading initial data for wagtailsearch.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailredirects:
==> default:  - Migrating forwards to 0001_initial.
==> default:  > wagtailredirects:0001_initial
==> default:  - Loading initial data for wagtailredirects.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for wagtailforms:
==> default:  - Migrating forwards to 0001_initial.
==> default:  > wagtailforms:0001_initial
==> default:  - Loading initial data for wagtailforms.
==> default: Installed 0 object(s) from 0 fixture(s)
==> default: Running migrations for demo:
==> default:  - Migrating forwards to 0004_create_form_page.
==> default:  > demo:0001_initial
==> default:  > demo:0002_auto__add_field_standardpage_postcode
==> default:  > demo:0003_auto__del_field_standardpage_postcode
==> default:  > demo:0004_create_form_page
==> default:  - Loading initial data for demo.
==> default: Installed 0 object(s) from 0 fixture(s)

C:\HashiCorp\Vagrant\wagtaildemo>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: VirtualBox VM is already running.

C:\HashiCorp\Vagrant\wagtaildemo>vagrant ssh

Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-35-generic i686)

 * Documentation:  https://help.ubuntu.com/

 System information disabled due to load higher than 1.0

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud


-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found

: invalid shell option name
-bash: $'\r': command not found
-bash: /etc/bash.bashrc: line 51: syntax error near unexpected token `$'{\r''
'bash: /etc/bash.bashrc: line 51: `     function command_not_found_handle {
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
: invalid shell option name
-bash: $'\r': command not found
-bash: $'\r': command not found
: invalid shell option name
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: $'\r': command not found
-bash: /home/vagrant/.bashrc: line 32: syntax error near unexpected token `$'in\
r''
'bash: /home/vagrant/.bashrc: line 32: `case "$TERM" in
-bash-4.3$ ls
wagtaildemo
-bash-4.3$ cd wagtaildemo/
-bash-4.3$ ./manage.py createsuperuser

: No such file or directory
-bash-4.3$
You received this message because you are subscribed to a topic in the Google Groups "Wagtail" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wagtail/R3OpkW-Mcqw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wagtail+u...@googlegroups.com.
To post to this group, send an email to wag...@googlegroups.com.

Matthew Westcott

unread,
Dec 20, 2014, 7:28:31 AM12/20/14
to wag...@googlegroups.com
Hi Jeff,

I think what's happening here is that Git for Windows is 'helpfully' translating line breaks to Windows format when you clone the repository, which is counter-productive because it's ultimately getting run by a Linux VM. It looks like Python can handle it fine, but it's breaking the Bash script (the files in etc/install) that we use for installation.

It looks like this is something we can fix by adding a .gitattributes file to the repo <https://help.github.com/articles/dealing-with-line-endings/> - I'll give this a go later today.

Cheers,
- Matt
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/CAGrpuyVYUO%2BnJ0F_SjTtfAo%2BpQysyJB4RFo1-hThWxsVGBLMgA%40mail.gmail.com.

Matthew Westcott

unread,
Dec 20, 2014, 5:14:44 PM12/20/14
to wag...@googlegroups.com
I've now added a .gitattributes file so that it hopefully won't mangle the line breaks on those scripts - please can you give it another go and let me know how you get on?

Cheers,
- Matt

Jeffrey Knorr

unread,
Dec 22, 2014, 10:58:46 AM12/22/14
to wag...@googlegroups.com
Hi Matt,

Thank you for the quick responses and turn around.  Your change seems to have resolved the bash errors.  The only other thing that I had to do was use:
python manage.py createsuperuser instead of ./manage.py createsuperuser  AND
python manage.py runserver 0.0.0.0:8000 instead of ./manage.py runserver 0.0.0.0:8000

The demo is now up and running!

Thanks again for your help!!

Jeff

Scot Hacker

unread,
Aug 12, 2015, 8:03:16 PM8/12/15
to Wagtail support


On Monday, December 22, 2014 at 7:58:46 AM UTC-8, Jeffrey Knorr wrote:
Hi Matt,

Thank you for the quick responses and turn around.  Your change seems to have resolved the bash errors.  The only other thing that I had to do was use:
python manage.py createsuperuser instead of ./manage.py createsuperuser  AND

This is really a python/shell problem, not a wagtail or django issue. For reference: If `manage.py` is executable for the current user, you can run it directly. If not, you need to use `python manage.py` or else make it executable with  e.g. `chmod 744 ./manage.py`.

./s

Reply all
Reply to author
Forward
0 new messages