hagsteel / swampdragon

swampdragon
Other
557 stars 73 forks source link

tutorial not working #134

Closed CedricRaison closed 9 years ago

CedricRaison commented 9 years ago

I just try the tutorial http://swampdragon.net/tutorial/part-1-here-be-dragons-and-thats-a-good-thing/. I found two different problem. One in the migration, on django > 1.7 you have to do ./manage.py makemigrations and ./manage.py migrate. You've done the makemigrations first. And here DRAGON_URL = 'http://localhost:9999/ , you have forgot the "'" after the '/' so the server beak.

And then the biggest problem is the javascript file, i've made a post on stackoverflow http://stackoverflow.com/questions/31361857/swampdragon-how-to-import-js-file. I've got this error in the javascript console. It cannot find all the javascript file including the swamdragon one.

GET http://localhost:8000/swampdragon/js/dist/datamapper.js GET http://localhost:8000/swampdragon/js/angular/services.js GET http://localhost:8000/controllers.js GET http://localhost:8000/app.js angular.js:36Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.21/$injector/modulerr?p0=TodoApp&p1=Error%3…gleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.2.21%2Fangular.min.js%3A18%3A277)

jassi5887 commented 9 years ago

I am also facing issue, please have a look at:

http://stackoverflow.com/questions/31413563/swampdragon-is-not-defined

gnzlo789 commented 9 years ago

Hello @BoumTAC,

You can change index.html like this and it should work:

...
{% swampdragon_settings %}
<script type="text/javascript" src="{% static 'swampdragon/js/dist/swampdragon.min.js' %}"></script>
<script type="text/javascript" src="{% static 'swampdragon/js/dist/datamapper.js' %}"></script>
<script type="text/javascript" src="{% static 'swampdragon/js/angular/services.js' %}"></script>

<!-- To-do app -->
<script type="text/javascript" src="{% static 'app.js' %}"></script>
<script type="text/javascript" src="{% static 'controllers.js' %}"></script>
...

If you have any trouble you can look https://github.com/gnzlo789/swampdragon-tutorial. Bye.

gnzlo789 commented 9 years ago

@jassi5887 Why did you create a context processor?

If you see here: http://swampdragon.net/blog/context-processor-for-dragon_url/ you only need to include {% swampdragon_settings %}. Make sure that all the files are being loaded and the swampdragon server is running.

jassi5887 commented 9 years ago

Thanks, I will try it and let tou know.

-----Original Message----- From: "gnzlo789" notifications@github.com Sent: ‎15-‎07-‎2015 05:24 AM To: "jonashagstedt/swampdragon" swampdragon@noreply.github.com Cc: "jassi5887" jatinder_0123@ymail.com Subject: Re: [swampdragon] tutorial not working (#134)

@jassi5887 Why did you create a context processor? If you see here: http://swampdragon.net/blog/context-processor-for-dragon_url/ you only need to include {% swampdragon_settings %}. Make sure that all the files are being loaded and the swampdragon server is running. — Reply to this email directly or view it on GitHub.

CedricRaison commented 9 years ago

Thanks that was this. I have to change all my STATIC_URL to static. The tutorial definitely need an update !

jassi5887 commented 9 years ago

hey !

Still getting the same error ! I am not using Angular though. So I have only included following libs:

. . . {% swampdragon_settings %} {% static 'swampdragon/js/legacy/swampdragon-vanilla.js' %} {% static 'swampdragon/js/dist/swampdragon.min.js' %} {% static 'swampdragon/js/dist/datamapper.js' %} . . .

And I have removed context processor.