Closed jackiekazil closed 10 years ago
I ran into the same thing when I installed this the first time also. I added some notes in badges/badges_notes.txt, but essentially what you need to do is comment out the last line in core/models.py ("from meta_badges import *"), do your db sync, then uncomment that line back.
Steve
Stephen Jones Lead Software Engineer The MITRE Corporation Phone: (781)271-2517 Email: srjones@mitre.org
On 11/19/2013 4:07 PM, Jackie Kazil wrote:
I updated, then...
pip install django-badges django-admin.py syncdb And it produced this error:
DatabaseError: relation "badges_badge" does not exist LINE 1:...badges_badge"."level", "badges_badge"."icon" FROM "badges_ba... Suggestions?
(P.S. -- django-badges was added to the reqs file.)
— Reply to this email directly or view it on GitHub https://github.com/jaycrossler/geoq-django/issues/46.
steve - ty for the explanation. I was trying to figure why it was set up this way. Maybe you can help me understand. I installed django-badges, but there was a badges folder checked in. Comparing the two -- they are similar.
Why is the "badges/" folder in the app?
Let me answer, since I'm the smuckhead who did it and failed to document. In a nutshell: I had to make some minor updates to django-badges to support the version of Django we were using (1.4+); there was some functionality django-badges used that was removed or at least significantly changed in (IIRC) Django 1.3 that supported popping up a message to announce a badge had been generated. The badges folder in the app has my fixes. I managed to mess up the namespacing at one point so you might need to call it r3.badges instead of just badges / django-badges.
Also, we found that the base.html that includes django badges probably needs a fix so it doesn't try to show bdge infoformation about a user if noones logged in.
On Tue, Nov 19, 2013 at 9:46 PM, Jackie Kazil notifications@github.comwrote:
steve - ty for the explanation. I was trying to figure why it was set up this way. Maybe you can help me understand. I installed django-badges, but there was a badges folder checked in. Comparing the two -- they are similar.
Why is the "badges/" folder in the app?
— Reply to this email directly or view it on GitHubhttps://github.com/jaycrossler/geoq-django/issues/46#issuecomment-28859596 .
Thank you for the explanation.
Just to confirm... django-badges should not be installed, because we are using the badge folder in the geoq folder instead? Yes?
I think I am at the state. Now I have the following error: Request URL: http://localhost:8000/badges/ Exception Value: The 'icon' attribute has no file associated with it.
Full stack trace: http://pastie.org/8495407
Suggestions on resolving?
That's correct -- I didn't install django-badges on my system, just used the badges module that was there.
As far as your error is concerned, I would check that your badges_badge table has entries in the 'icon' field -- for mine, I have 'badge_images/bronze.png' and 'badge_images/silver.png' for the 2 badge types. I did have to add those values in my db, so should also add a migration to do that (though wasn't sure if that might be different depending on how folks installed the system). Additionally, you'll probably want to check your settings.py and set MEDIA_ROOT to your installation location (I did it this way just to allow image additions to the system, but probably not the best way to do it -- might just add them to a static dir)
Steve
Stephen Jones Lead Software Engineer The MITRE Corporation Phone: (781)271-2517 Email: srjones@mitre.org
On 11/20/2013 9:19 AM, Jackie Kazil wrote:
Thank you for the explanation.
Just to confirm... django-badges should not be installed, because we are using the badge folder in the geoq folder instead? Yes?
I think I am at the state. Now I have the following error: Request URL: http://localhost:8000/badges/ Exception Value: The 'icon' attribute has no file associated with it.
Full stack trace: http://pastie.org/8495407
Suggestions on resolving?
— Reply to this email directly or view it on GitHub https://github.com/jaycrossler/geoq-django/issues/46#issuecomment-28892294.
@stephenrjones -- is this correct for what you have?
geoq_django=# select * from badges_badge;
id | level | icon
-------------------+-------+------
AOICompleter | 1 | 'badge_images/bronze.png'
MultiJobCompleter | 2 | 'badge_images/silver.png'
(2 rows)
Yup, that looks right.
Stephen Jones Lead Software Engineer The MITRE Corporation Phone: (781)271-2517 Email: srjones@mitre.org
On 11/20/2013 3:47 PM, Jackie Kazil wrote:
@stephenrjones https://github.com/stephenrjones -- is this correct for what you have? geoq_django=# select * from badges_badge; id | level | icon -------------------+-------+------ AOICompleter | 1 | 'badge_images/bronze.png' MultiJobCompleter | 2 | 'badge_images/silver.png' (2 rows)
— Reply to this email directly or view it on GitHub https://github.com/jaycrossler/geoq-django/issues/46#issuecomment-28929411.
Okay... so I added stuff to account for that. I also updated my media root. It is working now. Thank you for your help.
I also added a place holder ticket for this to be looked at for a better solution in the future -- Ticket #47 This isn't a priority, but I didn't want to forget about it.
I updated, then...
And it produced this error:
Suggestions?
(P.S. -- django-badges was added to the reqs file.)