Jquery Calendar with Django

2014-05-01 Thread coded kid
Hello,

I would like to know where I can get a jquery calendar that's similar to 
airbnb's own. Kindly help me out. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dbd74360-2c8d-44a6-b97f-d350aef5bf8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Libraries for Facebook login

2013-11-22 Thread coded kid
Use django_social_auth by Arneb. It rocks!

On Friday, 22 November 2013 06:02:30 UTC+1, sk wrote:
>
> I have seen few posts on various Facebook libraries that can be used with 
> Django to allow a user to login using Facebook credentials. Having tried a 
> few of them, I did not find any examples that worked. Does anyone know of 
> any such libraries they have recently used and worked fine? Any code 
> samples would be greatly appreciated.
>
>
> Thanks,
> spk265
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3c1fc0be-9533-4494-bdf4-dcd89018c9a1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Django Files Not Downloading Properly

2013-11-22 Thread coded kid
I want users to be able to download file from my django web app. I wrote 
the below codes, but when I download a file, the file will turn into an 
error file. It won't open and the total size of the file would be 0 bytes. 

Models:

class Emov(models.Model):
User=models.ForeignKey(User)
mov_file=models.FileField(upload_to='miiv')
mov_name=models.CharField(max_length=50)
email=models.EmailField()   #email of the uploader
download_count=models.PositiveIntegerField(default=0)
#other fields follows

   @property
def pretty_name(self):
 return "{0}.{1}".format(slugify(self.title),
os.path.splitext(self.mov_name.name)[1])

Views:

  def document_view(request,emov_id):
  fileload=Emovl.objects.get(id=emov_id)
 response=HttpResponse()
 response["Content-Disposition"]= "attachment; 
filename={0}".format(
 fileload.pretty_name)
 
response['X-Accel-Redirect']="/protected/{0}".format(fileload.mov_name.name)
return response


Nginx

 location /protected/ {
internal;
root /C:/Python27/Scripts/env/Scripts/digi/media/miiv/;

}

What am I missing?


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b47b6cb3-f3d5-4ffd-b02e-45dd008fb92e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: django deploy structure

2013-06-28 Thread coded kid
Man, use GIT. Push to your git repo. Clone from git through your production 
server. It's easy to do. Hope this helps? :)

On Thursday, 27 June 2013 09:08:13 UTC+1, Mulianto wrote:
>
> Hi,
>
> If cannot use git, for copy the source you can use rsync or use fabric to 
> selective upload the file and reload the app.
>
> But easier using GIT
>
> Sent from my iPhone
>
> On 27 Jun 2013, at 08:15, Nick Apostolakis  
> wrote:
>
> You could use a code versioning  system like git or bazaar.when you want 
> to deploy just pull from your repository 
> Στις 26 Ιουν 2013 8:46 μ.μ., ο χρήστης "fred" 
>  
> έγραψε:
>
>> I've got django 1.5 deploying successfully to a Linux Apache system with 
>> mod_wsgi.  This system is still being developed and changes are frequent.  
>>
>> I currently just copy the Eclipse project directory over, which gives me 
>> the site/settings as well as the app.  This works, but has the disadvantage 
>> of also copying unnecessary stuff like my docs subdirectory and test data 
>> directory, etc. I cannot use tools like git to solve this for various 
>> internal reasons.
>>
>> I'm the only one using django in my organization and I would appreciate 
>> some insight from the more experienced developers in the community.  
>>
>> Thanks,
>>
>> Fred.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Advanced Search in django

2013-06-28 Thread coded kid
Try django watson https://github.com/etianen/django-watson/

On Thursday, 27 June 2013 09:33:22 UTC+1, Harjot Mann wrote:
>
> On Thu, Jun 27, 2013 at 1:16 PM, Peith Vergil 
>  
> wrote: 
> > Try using django-haystack. It's a nice Django app, very easy to use, and 
> > with good documentation: 
> http://django-haystack.readthedocs.org/en/latest/. 
> > It provides a QuerySet like API for several search engine backends. It 
> works 
> > with  Solr, ElasticSearch, Whoosh, Xapian, etc. 
>
>
> Look I have a project called Automation software in which search is 
> already working but when we are searching for a name like hardeep it 
> shows only that clients which have this name but hardeep can also be 
> as hardip so i want that it displays all the clients with both the 
> names. 
>
> -- 
> Harjot Kaur Mann 
> Blog: http://harjotmann.wordpress.com/ 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Error Using ModelForm Wizard For Editing in Django

2013-06-27 Thread coded kid
You can check the code properly here: http://pastebin.com/1Ygq9RZs



   1. I have two seperate forms and I used Django ModelForm wizard to 
   create the form. I can create and save the form.Also I created a 
   seperate view for editing of the form, but When I wanted to edit the 
   same form, a field called'name' with 'Unique=True' in the models is always 
   popping out validation error "name already exist"
   2.  
   3. This shouldn't be happening because I just want to edit one field in 
   the form.
   4. #models excerpt
   5. class Finhall(models.Model):
   6.user=models.ForeignKey(User)
   7.name=models.CharField(max_length=250, unique=True)
   8.address=models.CharField(max_length=200)
   9.city=models.CharField(max_length=200)
   10.
   11.def __unicode__(self):
   12.  return self.name
   13.  
   14. #editing form views.py
   15. @login_required
   16. def edit_finhall(request,finhall_id=None,slug=None):
   17.if id:
   18.post=get_object_or_404(Finhall,id=finhall_id,slug=slug)
   19.initial={'0':{'who':post.who,'name':post.name,'main_view
   ':post.main_view,
   20.  
   21. },
   22. '1':{'price':post.price,'details':post.details,
   23.  },
   24. }
   25.if post.user !=request.user:
   26.return HttpResponseForbidden()
   27.else:
   28.  initial={'0':{'who':post.who,'name':post.name,'main_view
   ':post.main_view,
   29.  
   30. },
   31. '1':{'price':post.price,'details':post.details,
   32.  },
   33. }
   34.
   35.form=FindventWizard.as_view([FinhallForm1, 
   FinhallForm2],initial_dict=initial)
   36.return form(context=RequestContext(request), request=request)
   

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Point System in django

2013-06-13 Thread coded kid
Thanks for the reply.

On Thursday, 13 June 2013 02:02:03 UTC+1, MattDale wrote:
>
> A quick google didn't turn up any packages for your specific case, but you 
> may not want to use a pre-built solution. 
> Amirouche wanted some more information about how you plan on implementing 
> the project.  
>
> Here's a simple concept:
> It seems that you would want to customize the standard User model and add 
> an integer field "Points" to it with default value=0.  When the User 
> purchases these fictitious points, you would increment their associated 
> Points value by whatever they paid for.  
> Then when the User is on the site and logged in, you can use Javascript to 
> send an asynchronous request to the server when the Play button is pressed 
> on the page.  Since the user is logged in, it's instance is available in 
> the context that was sent through in the AJAX request. You would then be 
> able to subtract the corresponding point value from that User's Points 
> field.  
>
> Obviously my description has flaws: you need to be careful with the 
> Javascript so the User doesn't click the Play button multiple times, you 
> need to set rules in the User model to not allow negative Point values, 
>  not allow the user to press the Play the button if they don't have enough 
> Points, etc. 
>
>
>
> On Wednesday, June 12, 2013 1:38:45 PM UTC-4, coded kid wrote:
>>
>> How do you mean? Please explain further.
>>
>> On Monday, 10 June 2013 14:05:56 UTC+1, Amirouche wrote:
>>>
>>>
>>>
>>> Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>>>>
>>>> what is the best way to implement this? Users will pay a certain fee 
>>>> and get some amount of points (100points) and for every video the user 
>>>> watch, like 30points will be deducted. How can I go about this? is 
>>>> there a package for point system in django?
>>>>
>>>
>>> This is simple transaction scheme what is specific to your usecase ? 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Point System in django

2013-06-13 Thread coded kid
Thanks so much for the reply. Will try it out and let you know incase I 
come across any problem! 

On Thursday, 13 June 2013 11:49:43 UTC+1, Amirouche wrote:
>
> 2013/6/13 MattDale <mattda...@gmail.com >
>
>> A quick google didn't turn up any packages for your specific case, but 
>> you may not want to use a pre-built solution. 
>> Amirouche wanted some more information about how you plan on implementing 
>> the project.  
>>  
>> Here's a simple concept:
>> It seems that you would want to customize the standard User model and add 
>> an integer field "Points" to it with default value=0.  When the User 
>> purchases these fictitious points, you would increment their associated 
>> Points value by whatever they paid for.  
>> Then when the User is on the site and logged in, you can use Javascript 
>> to send an asynchronous request to the server when the Play button is 
>> pressed on the page.  Since the user is logged in, it's instance is 
>> available in the context that was sent through in the AJAX request. You 
>> would then be able to subtract the corresponding point value from that 
>> User's Points field.  
>>
>> Obviously my description has flaws: you need to be careful with the 
>> Javascript so the User doesn't click the Play button multiple times, you 
>> need to set rules in the User model to not allow negative Point values, 
>>  not allow the user to press the Play the button if they don't have enough 
>> Points, etc. 
>>
>
> You don't have to use Javascript, you can come with a solutions that 
> doesn't involve javascript. 
>
> On Wednesday, June 12, 2013 1:38:45 PM UTC-4, coded kid wrote:
>>
>>> How do you mean? Please explain further.
>>>
>>> On Monday, 10 June 2013 14:05:56 UTC+1, Amirouche wrote:
>>>>
>>>>
>>>>
>>>> Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>>>>>
>>>>> what is the best way to implement this? Users will pay a certain fee 
>>>>> and get some amount of points (100points) and for every video the user 
>>>>> watch, like 30points will be deducted. How can I go about this? is 
>>>>> there a package for point system in django?
>>>>
>>>>
> The point thing, make me think about badge applications but it's not, I 
> think, what you need [1]
>
>  
>
>>
>>>> This is simple transaction scheme what is specific to your usecase ?
>>>>
>>>
>
> Custom user class [2] has a field points that can be increased using some 
> form. Then there is another table that we can call Subscription that looks 
> like the following:
>
> class Subscription(models.Model):
>
> user = models.ForeignKey(User)
> video = models.ForeignKey(Video)
> end_date = models.DateTimeField()
>
>
> When the user tries to play a video you check for a valid subscription 
> something like Subscription.filter(end_data__gt=current_date, 
> user=request.current_user) depending on the result you show a pay wall or 
> the video.
>
> HTH,
>
>
> Amirouche
>
>
> [1] https://www.djangopackages.com/grids/g/awards-badges/
> [2] 
> https://docs.djangoproject.com/en/dev/topics/auth/customizing/#specifying-a-custom-user-model
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Point System in django

2013-06-12 Thread coded kid
How do you mean? Please explain further.

On Monday, 10 June 2013 14:05:56 UTC+1, Amirouche wrote:
>
>
>
> Le lundi 10 juin 2013 12:59:05 UTC+2, coded kid a écrit :
>>
>> what is the best way to implement this? Users will pay a certain fee 
>> and get some amount of points (100points) and for every video the user 
>> watch, like 30points will be deducted. How can I go about this? is 
>> there a package for point system in django?
>>
>
> This is simple transaction scheme what is specific to your usecase ? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Point System in django

2013-06-10 Thread coded kid
what is the best way to implement this? Users will pay a certain fee
and get some amount of points (100points) and for every video the user
watch, like 30points will be deducted. How can I go about this? is
there a package for point system in django?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Best Pratice To Implement User Types

2013-06-05 Thread coded kid
Thanks! do you think Django group is the best for this? should I leave 
asssign a group to every user who signed up through django registration? 

On Tuesday, 4 June 2013 12:12:24 UTC+1, Frank Bieniek wrote:
>
> Hi, 
> the user stays the same, but he becomes member of the PaidMember Group, 
> (Access handling) 
> and he gets a monthly payment record history entry. 
>
> Think about role changes, becomes PaidMember, leaves PaidMember, becomes 
> FreeUser, leaves FreeUser. 
>
> So you have to think about the role change transitions 
> and the access limitations every usergroup has. 
>
> A user has a PaymentHistory, with several PaymentEntries. And the last 
> PaymentEntry knows the related group Membership. 
>
> Just my 2 cents. 
> Frank 
>
>
>
>
> Am 04.06.2013 08:51, schrieb coded kid: 
> > I'm building a django project and I want to have free users and 
> > premium users. I've been hitting my head on the best way to implement 
> > this. Users will be able to login through the same login page and 
> > redirect to different pages after logging in based on their user type. 
> > 
> > My main challenge is the best way to implement paid subscription for 
> > users so after paying, expiration date and redirection of users. 
> > Should I make use of the Userprofile model to implement premium users 
> > or write a standalone  model for handling premium users? Kindly 
> > explain on the best way to go about this. Thanks! 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Best Pratice To Implement User Types

2013-06-04 Thread coded kid
I'm building a django project and I want to have free users and premium 
users. I've been hitting my head on the best way to implement this. Users 
will be able to login through the same login page and redirect to different 
pages after logging in based on their user type. 

My main challenge is the best way to implement paid subscription for users 
so after paying, expiration date and redirection of users. Should I make 
use of the Userprofile model to implement premium users or write a 
standalone  model for handling premium users? Kindly explain on the best 
way to go about this. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Intergrating on Interswitch Webpay

2013-06-04 Thread coded kid
Hello, has anyone intergrate interswitch webpay on his or her django
website before? I'm kinda confused on the doc, because in the docs,
the tutorials is centered around ecommerce sites and I'm building an
enterprise product and things like product_id, product_type don't
exist. So I would like to know how I can implement the interswitch
payment and supply my own key to it.

Any good tutorial or link to a post or explanation on how to go about
it will be helpful!

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Django South- Push to repo or not?

2013-02-04 Thread coded kid
Please I would like to know if it's advisable to push South migration
folder in development environment to git repo before cloning it from
repo to production server.  Or one should delete the South migration
folder and push to git repo.  Hope you get my point?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Unable to get an object value using get method in Django

2012-12-30 Thread coded kid
Yeah, its a name of a field in my form.  I want to the value
automatically since I don't know the name of the place the user will
choose. I tried adding your correction but i'm getting error.

On Dec 31, 2:33 am, Bill Freeman <ke1g...@gmail.com> wrote:
> On Sun, Dec 30, 2012 at 7:11 PM, coded kid <duffleboi...@gmail.com> wrote:
> > I want to get an object value from a model. After trying the get()
> > method, I've been unable to make it work.And I'm getting the below
> > error. I have a page that display the name of a place to users, so if
> > a user see a place he likes, he will go ahead and fill the form.And in
> > the form, I want to get the name of the place automatically from
> > another model, I don't want users to fill the name of the place. Below
> > are my codes
>
> > NameError at /welcome/
>
> >        global name 'name' is not defined
>
> > Models
>
> >  class Fin(models.Model):
> >       user=models.ForeignKey(User)
> >       name=models.CharField(max_length=100)
>
> >       def __unicode__(self):
> >           return self.user
>
> >  class Place(models.Model):
> >       user=models.ForeignKey(User)
> >       mall=models.ForeignKey(Fin)
> >       full_name=models.CharField(max_length=100)
> >       e_mail=models.EmailField(max_length=100)
> >       phone_no=models.CharField(max_length=100)
> >       pub_date=models.DateTimeField()
>
> >       def __unicode__(self):
> >           return self.full_name
> >       class Meta:
> >          ordering=['-pub_date']
>
> >   class PlaceForm(ModelForm):
> >        class Meta:
> >          model=Place
> >          fields=('full_name','e_mail','phone_no')
> >          exclude=('user','pub_date','mall')
>
> > Views:
>
> >    def place_me(request):
> >        if request.method=="POST":
> >           form=PlaceForm(request.POST)
> >           if form.is_valid():
> >              data=form.cleaned_data
> >              newbooks=Place(
> >                  user=request.user,
> >                  pub_date=datetime.datetime.now(),
> >                  mall=Fin.objects.get(name),
> >                  full_name=data['full_name'],
> >                  e_mail=data['e_mail'],
> >                  phone_no=data['phone_no'])
> >              newbooks.save()
> >              return HttpResponse('Thanks for choosing themall, we will
> > contact you as soon as possible.')
> >          else:
> >             return HttpResponse('Some fields are not filled
> > correctly')
> >      else:
> >         return render_to_response('buuk.html',
> > {'PlaceForm':PlaceForm},context_instance=RequestContext(request))
>
> > Perhaps you want:
>
>    mail=Fin.objects.get(name="something")
>
> Where I'm not sure what "something" is.  A field from your form, perhaps?
>
> Bill

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Star Rating System In Django

2012-12-30 Thread coded kid
Thanks! Agon works perfectly!

On Sunday, 30 December 2012 14:46:24 UTC+1, coded kid wrote:
>
> The developer for agon rating is no more working on it and I guess it 
> won't work nice .
>
> Simple ratings is not working out for me. Don't know if there's a 
> JavaScript plugin for rating?
>
> On Sunday, 30 December 2012 14:08:10 UTC+1, Alec Taylor wrote:
>>
>> Agon (probably easiest): 
>> http://agon-ratings.readthedocs.org/en/latest/usage.html 
>>
>> -or- 
>>
>> https://github.com/dcramer/django-ratings 
>>
>> -or- 
>>
>> https://github.com/coleifer/django-simple-ratings 
>>
>> On Mon, Dec 31, 2012 at 12:03 AM, coded kid <duffle...@gmail.com> wrote: 
>> > Anyone know about any good package or tutorial or plugin for building 
>> > a star rating system in django? I tried using dcramer/django rating 
>> > but It's not working perfectly. 
>> > 
>> > If you know of any plugin, package on how to build a star rating 
>> > system, kindly post it below. 
>> > 
>> > Thanks! 
>> > 
>> > -- 
>> > You received this message because you are subscribed to the Google 
>> Groups "Django users" group. 
>> > To post to this group, send email to django...@googlegroups.com. 
>> > To unsubscribe from this group, send email to 
>> django-users...@googlegroups.com. 
>> > For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en. 
>> > 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/fTgXj2iqSf0J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Unable to get an object value using get method in Django

2012-12-30 Thread coded kid
I want to get an object value from a model. After trying the get()
method, I've been unable to make it work.And I'm getting the below
error. I have a page that display the name of a place to users, so if
a user see a place he likes, he will go ahead and fill the form.And in
the form, I want to get the name of the place automatically from
another model, I don't want users to fill the name of the place. Below
are my codes

NameError at /welcome/

   global name 'name' is not defined

Models

 class Fin(models.Model):
  user=models.ForeignKey(User)
  name=models.CharField(max_length=100)

  def __unicode__(self):
  return self.user


 class Place(models.Model):
  user=models.ForeignKey(User)
  mall=models.ForeignKey(Fin)
  full_name=models.CharField(max_length=100)
  e_mail=models.EmailField(max_length=100)
  phone_no=models.CharField(max_length=100)
  pub_date=models.DateTimeField()

  def __unicode__(self):
  return self.full_name
  class Meta:
 ordering=['-pub_date']

  class PlaceForm(ModelForm):
   class Meta:
 model=Place
 fields=('full_name','e_mail','phone_no')
 exclude=('user','pub_date','mall')

Views:

   def place_me(request):
   if request.method=="POST":
  form=PlaceForm(request.POST)
  if form.is_valid():
 data=form.cleaned_data
 newbooks=Place(
 user=request.user,
 pub_date=datetime.datetime.now(),
 mall=Fin.objects.get(name),
 full_name=data['full_name'],
 e_mail=data['e_mail'],
 phone_no=data['phone_no'])
 newbooks.save()
 return HttpResponse('Thanks for choosing themall, we will
contact you as soon as possible.')
 else:
return HttpResponse('Some fields are not filled
correctly')
 else:
return render_to_response('buuk.html',
{'PlaceForm':PlaceForm},context_instance=RequestContext(request))

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Star Rating System In Django

2012-12-30 Thread coded kid
The developer for agon rating is no more working on it and I guess it won't 
work nice .

Simple ratings is not working out for me. Don't know if there's a 
JavaScript plugin for rating?

On Sunday, 30 December 2012 14:08:10 UTC+1, Alec Taylor wrote:
>
> Agon (probably easiest): 
> http://agon-ratings.readthedocs.org/en/latest/usage.html 
>
> -or- 
>
> https://github.com/dcramer/django-ratings 
>
> -or- 
>
> https://github.com/coleifer/django-simple-ratings 
>
> On Mon, Dec 31, 2012 at 12:03 AM, coded kid 
> <duffle...@gmail.com> 
> wrote: 
> > Anyone know about any good package or tutorial or plugin for building 
> > a star rating system in django? I tried using dcramer/django rating 
> > but It's not working perfectly. 
> > 
> > If you know of any plugin, package on how to build a star rating 
> > system, kindly post it below. 
> > 
> > Thanks! 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Django users" group. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> django-users...@googlegroups.com . 
> > For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en. 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/T60zmdo25g8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Star Rating System In Django

2012-12-30 Thread coded kid
Anyone know about any good package or tutorial or plugin for building
a star rating system in django? I tried using dcramer/django rating
but It's not working perfectly.

If you know of any plugin, package on how to build a star rating
system, kindly post it below.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django web app pages not displaying

2012-11-20 Thread coded kid
I set Debug=False. It didn't bring any errors. Also django didn't send an 
error mail to me. The page is just blank.

On Tuesday, 20 November 2012 22:23:14 UTC+1, Tundebabzy wrote:
>
> Hi coded, 
> What error is your browser complaining of? "Connection timed out" or 
> "Server Not Found"?? 
>
> On 11/20/12, coded kid <duffle...@gmail.com > wrote: 
> > I just deployed my django website, I tried visiting some pages on the 
> > site and it's not displaying. I have three web browsers on my PC, I 
> > tried visiting those pages through the other two web browsers but the 
> > pages are not displaying. I asked a friend of mine in Poland to check 
> > those pages out, he said the pages are displaying. 
> > 
> > Before I deploy, everything is running fine on my local server. But 
> > after I deployed some pages are not showing. and django didn't send me 
> > any error mail concerning the site. 
> > 
> > How can I go about solving this problem? Would be glad to hear your 
> > opinion on this. 
> > 
> > Thanks. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > To unsubscribe from this group, send email to 
> > django-users...@googlegroups.com . 
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en. 
> > 
> > 
>
> -- 
> Sent from my mobile device 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/iKuraHwC36EJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django web app pages not displaying

2012-11-20 Thread coded kid
I just deployed my django website, I tried visiting some pages on the
site and it's not displaying. I have three web browsers on my PC, I
tried visiting those pages through the other two web browsers but the
pages are not displaying. I asked a friend of mine in Poland to check
those pages out, he said the pages are displaying.

Before I deploy, everything is running fine on my local server. But
after I deployed some pages are not showing. and django didn't send me
any error mail concerning the site.

How can I go about solving this problem? Would be glad to hear your
opinion on this.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Javascript Image Hollover In Django

2012-08-31 Thread coded kid
When I followed your tutorial, the images were reshaped only and when I 
place my mouse on any of the thumbnail images it won't display the large 
image.  How can I go about it? 

On Friday, 31 August 2012 15:40:56 UTC+1, Amyth wrote:
>
> Hey,
>
> dun think this is really Django related, but still i created a jquery 
> example for you, check it http://jsfiddle.net/TjUtq/
>
> -- 
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras@gmail.com , ad...@techstricks.com
> Twitter - @a_myth_
> http://techstricks.com/
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/5IGvhvxkSUsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Javascript Image Hollover In Django

2012-08-31 Thread coded kid
When a user place his mouse or click on any image thumbnails, I want
the particular thumbnail image to display in large size above the set
of thumbnails images on the same page in my django template. I tried
the below Javascript code but it's not working. I'm a noob in
javascript. If there's any way I can do it in jquery please let me
know.

  {% block content %}
  
  $(function() {
  $('.slideshow').hover(
function() { $('.slides').cycle('resume'); },
function() { $('.slides').cycle('pause'); }
 );

 $('.slides').cycle({
 fx: 'fade',
 speed:   .3,
 timeout: 280,
 next:   '#next',
 prev:   '#prev'
}).cycle("pause");
});
 



 

   


  

   

   {% if Meekme.thumbnail_5 %} {% endif %}

   {% if Meekme.thumbnail_6 %}{% endif %}


{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Haystack with Whoosh Not Redirecting.

2012-06-25 Thread coded kid
Yes the form is expecting data from users and it will filtered on the
same page. will it still work?

Nikolas Stevenson-Molnar wrote:
> See the examples given for the permalink decorator:
> https://docs.djangoproject.com/en/1.4/ref/models/instances/#the-permalink-decorator
>
> Also, review URLs in Django:
> https://docs.djangoproject.com/en/1.4/topics/http/urls/
>
> In your case, you don't specify any arguments in your URL (or your view
> function), but you are trying to generate a URL with arguments. Your
> view function itself seems to be expecting data from a submitted form,
> which doesn't make sense for a detail view.
>
> _Nik
>
> On 6/25/2012 10:32 AM, coded kid wrote:
> > (r'^find/$', findme),
> >
> > So how will i input the arguments? any example? thanks.
> >
> > Nikolas Stevenson-Molnar wrote:
> >> Take another look at your get_absolute_url method. As written, it
> >> specifies several keyword arguments to the view, but the "findme" view
> >> does not take any arguments. Also, what does your urls.py file look like?
> >>
> >> _Nik
> >>
> >> On 6/25/2012 10:14 AM, coded kid wrote:
> >>> I successfully installed whoosh and made it work with Haystack. Things
> >>> are working fine but I'm facing one problem which is; after searching
> >>> for a keyword and it print out the results, when I click on the
> >>> result(title), It won't redirect me to the page of the keyword I
> >>> clicked on, it's just static. I tried adding a get_absolute_url
> >>> method. Yet it's not working.
> >>>
> >>> What I want is this: when a user search for a keyword and it return
> >>> the result, so if the user click on the result, the user should be
> >>> redirected to a page where it will display every properties of the
> >>> result.
> >>>
> >>> Models
> >>>
> >>>   class Meek(models.Model):
> >>>  user=models.ForeignKey(User)
> >>>  title=models.CharField(max_length=250, unique=True)
> >>>  address=models.CharField(max_length=200)
> >>>  city=models.CharField(max_length=200)
> >>>  state=models.CharField(max_length=200)
> >>>
> >>> main_view=models.ImageField(upload_to="photos",blank=True, null=True)
> >>>
> >>> side_view=models.ImageField(upload_to="photos",blank=True, null=True)
> >>>  pub_date=models.DateTimeField()
> >>>
> >>>  def __unicode__(self):
> >>>  return self.title
> >>>
> >>>
> >>>  @models.permalink
> >>>  def get_absolute_url(self):
> >>>  return ('findme', (), {
> >>> 'main_view': self.main_view,
> >>> 'side_view': self.side_view,
> >>> 'address': self.address,
> >>> 'city': self.city,
> >>> 'state': self.state})
> >>>
> >>> Search/search.html
> >>>
> >>>{% block content %}
> >>>
> >>>  Search
> >>>
> >>>
> >>>
> >>>
> >>> 
> >>>   {{ form.as_table }}
> >>> 
> >>> 
> >>>  
> >>> 
> >>> 
> >>>  
> >>>{% if query %}
> >>>  Results
> >>>   {% for result in page.object_list %}
> >>>
> >>>  >>>> {{ result.object.title }}
> >>>
> >>>  {% empty %}
> >>> No results found.
> >>>  {% endfor %}
> >>>
> >>>{% if page.has_previous or page.has_next %}
> >>>  
> >>>{% if page.has_previous %}{% endif %}
> >>>  Previous{% if page.has_previous %}
> >>>{% endif%}
> >>>
> >>>{% if page.has_next %}{% endif %}Next {% if
>

Re: Haystack with Whoosh Not Redirecting.

2012-06-25 Thread coded kid
(r'^find/$', findme),

So how will i input the arguments? any example? thanks.

Nikolas Stevenson-Molnar wrote:
> Take another look at your get_absolute_url method. As written, it
> specifies several keyword arguments to the view, but the "findme" view
> does not take any arguments. Also, what does your urls.py file look like?
>
> _Nik
>
> On 6/25/2012 10:14 AM, coded kid wrote:
> > I successfully installed whoosh and made it work with Haystack. Things
> > are working fine but I'm facing one problem which is; after searching
> > for a keyword and it print out the results, when I click on the
> > result(title), It won't redirect me to the page of the keyword I
> > clicked on, it's just static. I tried adding a get_absolute_url
> > method. Yet it's not working.
> >
> > What I want is this: when a user search for a keyword and it return
> > the result, so if the user click on the result, the user should be
> > redirected to a page where it will display every properties of the
> > result.
> >
> > Models
> >
> >   class Meek(models.Model):
> >  user=models.ForeignKey(User)
> >  title=models.CharField(max_length=250, unique=True)
> >  address=models.CharField(max_length=200)
> >  city=models.CharField(max_length=200)
> >  state=models.CharField(max_length=200)
> >
> > main_view=models.ImageField(upload_to="photos",blank=True, null=True)
> >
> > side_view=models.ImageField(upload_to="photos",blank=True, null=True)
> >  pub_date=models.DateTimeField()
> >
> >  def __unicode__(self):
> >  return self.title
> >
> >
> >  @models.permalink
> >  def get_absolute_url(self):
> >  return ('findme', (), {
> > 'main_view': self.main_view,
> > 'side_view': self.side_view,
> > 'address': self.address,
> > 'city': self.city,
> > 'state': self.state})
> >
> > Search/search.html
> >
> >{% block content %}
> >
> >  Search
> >
> >
> >
> >
> > 
> >   {{ form.as_table }}
> > 
> > 
> >  
> > 
> > 
> >  
> >{% if query %}
> >  Results
> >   {% for result in page.object_list %}
> >
> >  >> {{ result.object.title }}
> >
> >  {% empty %}
> > No results found.
> >  {% endfor %}
> >
> >{% if page.has_previous or page.has_next %}
> >  
> >{% if page.has_previous %}{% endif %}
> >  Previous{% if page.has_previous %}
> >{% endif%}
> >
> >{% if page.has_next %}{% endif %}Next {% if
> > page.has_next %}{% endif %}
> >{% endif %}
> >
> >  {% else %}
> >
> > {# Show some example queries to run, maybe
> > query syntax, something else? #}
> >
> > {% endif %}
> >  
> >
> >{% endblock %}
> >
> >
> > Urlconf
> >
> >   #url where the objects are posted.
> >   (r'^find/$', findme),
> >
> >  #haystack url where you can search
> >  (r'^search/', include('haystack.urls')),
> >
> > Views:
> >
> >def findme(request):
> >extra_data_context={}
> >#if there's nothing in the field do nothing.
> >if request.method=="POST":
> >   form=MeekForm(request.POST, request.FILES)
> >   if form.is_valid():
> >  data=form.cleaned_data
> >  newmeeks=Meek(
> >  user=request.user,
> >  pub_date=datetime.datetime.now(),
> >  title=data['title'],
> >  main_view=request.FILES['ma

Haystack with Whoosh Not Redirecting.

2012-06-25 Thread coded kid
I successfully installed whoosh and made it work with Haystack. Things
are working fine but I'm facing one problem which is; after searching
for a keyword and it print out the results, when I click on the
result(title), It won't redirect me to the page of the keyword I
clicked on, it's just static. I tried adding a get_absolute_url
method. Yet it's not working.

What I want is this: when a user search for a keyword and it return
the result, so if the user click on the result, the user should be
redirected to a page where it will display every properties of the
result.

Models

  class Meek(models.Model):
 user=models.ForeignKey(User)
 title=models.CharField(max_length=250, unique=True)
 address=models.CharField(max_length=200)
 city=models.CharField(max_length=200)
 state=models.CharField(max_length=200)
 
main_view=models.ImageField(upload_to="photos",blank=True, null=True)
 
side_view=models.ImageField(upload_to="photos",blank=True, null=True)
 pub_date=models.DateTimeField()

 def __unicode__(self):
 return self.title


 @models.permalink
 def get_absolute_url(self):
 return ('findme', (), {
'main_view': self.main_view,
'side_view': self.side_view,
'address': self.address,
'city': self.city,
'state': self.state})

Search/search.html

   {% block content %}

 Search


   


  {{ form.as_table }}


 


 
   {% if query %}
 Results
  {% for result in page.object_list %}
   
{{ result.object.title }}
   
 {% empty %}
No results found.
 {% endfor %}

   {% if page.has_previous or page.has_next %}
 
   {% if page.has_previous %}{% endif %}
 Previous{% if page.has_previous %}
   {% endif%}

   {% if page.has_next %}{% endif %}Next {% if
page.has_next %}{% endif %}
   {% endif %}

 {% else %}

{# Show some example queries to run, maybe
query syntax, something else? #}

{% endif %}
 

   {% endblock %}


Urlconf

  #url where the objects are posted.
  (r'^find/$', findme),

 #haystack url where you can search
 (r'^search/', include('haystack.urls')),

Views:

   def findme(request):
   extra_data_context={}
   #if there's nothing in the field do nothing.
   if request.method=="POST":
  form=MeekForm(request.POST, request.FILES)
  if form.is_valid():
 data=form.cleaned_data
 newmeeks=Meek(
 user=request.user,
 pub_date=datetime.datetime.now(),
 title=data['title'],
 main_view=request.FILES['main_view'],
 side_view=request.FILES['side_view'],
 address=data['address'],
 city=data['city'],
 state=data['state'])
newmeeks.save()
extra_data_context.update({'MeekForm':form})
 else:
 form = MeekForm()
 extra_data_context.update({'MeekForm':form})
 
extra_data_context.update({'Meeks':Meek.objects.filter(user=request.user)})
 return
render_to_response('postme.html',extra_data_context,context_instance=RequestContext(request))

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Haystack with Solr- Schema Parsing Failed

2012-06-23 Thread coded kid
I'm trying to rebuild_index, but after building the schema ( manage.py
build_solr_schema ) I copy and paste the output in the schema.xml
file. After restarting the server and rebuild_index ( manage.py
rebuild_index ) I'm getting the below error. I've been trying to get
the problem, yet no success! What I'm I missing? Should I first delete
the XML codes in the schema file before pasting the new one?


Error:

HTTP Status 500 - Severe errors in solr configuration. Check your log
files for more detailed information on what may be wrong. If you want
solr to continue after configuration errors, change:
false in
solr.xml -
org.xml.sax.SAXParseException: Attribute name "omitN" associated with
an element type "fieldtype" must be followed by the ' = ' character.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source) at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl
$FragmentContentDriver.next(Unknown Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
Source) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown
Source) at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown
Source) at org.apache.solr.core.Config.(Config.java:159) at
org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:418) at
org.apache.solr.schema.IndexSchema.(IndexSchema.java:123) at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:481) at
org.apache.solr.core.CoreContainer.load(CoreContainer.java:335) at
org.apache.solr.core.CoreContainer.load(CoreContainer.java:219) at
org.apache.solr.core.CoreContainer
$Initializer.initialize(CoreContainer.java:161) at
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:
96) at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:
277) at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:
258) at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:
382) at
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:
103) at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:
4649) at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5305) at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
899) at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
875) at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:
650) at org.apache.catalina.startup.HostConfig
$DeployDescriptor.run(HostConfig.java:1582) at
java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at
java.util.concurrent.FutureTask.run(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
-
org.apache.solr.common.SolrException: Schema Parsing Failed: Attribute
name "omitN" associated with an element type "fieldtype" must be
followed by the ' = ' character. at
org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:688) at
org.apache.solr.schema.IndexSchema.(IndexSchema.java:123) at
org.apache.solr.core.CoreContainer.create(CoreContainer.java:481)


Schema output:





  
























  




  
  




  




  







  
  








  




  

Python IDLE

2012-05-28 Thread coded kid
I'm in a big mess now, I've lost my projects due to this errror. I'm
on windows, This is how I encounter the problem; I try to edit my
settings.py in IDLE. After right clicking on the files, I choose open
program with these default file. I choose idle window bat file, and I
clicked Ok. It didn't open, I try to run manage.py runserver on my
DOS. Not working, it will pop up the IDLE Shell and mange.py script by
displaying it in IDLE. It didn't run the server. The logo of my python
files have changed. How can I revert it back to open with IDLE? And
use it as default for my python script?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Save Tweepy tweets in database

2012-05-08 Thread coded kid
creating the model is not a problem but the problem is how to make use of 
it in views.py. You have any idea?

On Tuesday, 8 May 2012 11:19:27 UTC+1, coded kid wrote:
>
> I want to save users tweets in my db (MySQL) But I'm finding it 
> difficult to get how I will go about it. The main problem is that, I 
> didn't create any models for it, I just input the below codes in my 
> views,since I'm getting users tweets through tweepy api. 
>
> The question now is, how will I save users tweets in my Database? 
>
> Kindly give me a reply if you know how I will solve this problem! 
> Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xhk_1kmqwVwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Save Tweepy tweets in database

2012-05-08 Thread coded kid
I want to save users tweets in my db (MySQL) But I'm finding it
difficult to get how I will go about it. The main problem is that, I
didn't create any models for it, I just input the below codes in my
views,since I'm getting users tweets through tweepy api.

The question now is, how will I save users tweets in my Database?

Kindly give me a reply if you know how I will solve this problem!
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Pagination Not Working!

2012-05-06 Thread coded kid
I'm trying to paginate a page in order to display five statuses per
page. After inputting these codes, it fails to paginate. Below are the
codes for pagination and updating of status in my django app.


Views:

 def qask(request):
  extra_data_context={}
 #if there's nothing in the field do nothing.
  if request. method=="POST":
  form =AskForm(request.POST)
  if form.is_valid():
  data=form.cleaned_data
  newask=Ask(
 user= request.user,
 status=data['status'],
 pub_date=datetime.datetime.now())
 newask.save()
  extra_data_context.update({'AskForm':form})
else:
form = AskForm()
extra_data_context.update({'AskForm':form})
 
extra_data_context.update({'Asks':Ask.objects.filter(user=request.user)})

   plan=Ask.objects.all()
   paginator=Paginator(plan, 5)

   try:
   page=int(request.GET.get('page','1'))
   except ValueError:
   page=1

   try:
  fp=paginator.page(page)
  except (EmptyPage, InvalidPage):
  fp=paginator.page(paginator.num_pages)
  return render_to_response
('quik_ask.html',extra_data_context,context_instance=RequestContext(request))

Template:
  {% block content %}



  {% for Ask in Asks %}
   
 {{Ask.user}}  
 {{Ask.status}}
   {{Ask.state}} | {{Ask.pub_date|timesince }} ago 

  
{% endfor %}


   
{% if Asks.has_previous %}
previous
{% endif %}


Page {{ Asks.number }} of {{ Asks.paginator.num_pages }}.


{% if Asks.has_next %}
next
{% endif %}
 




 {% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ModelForm Validation Error

2012-04-17 Thread coded kid
I want to make sure users fill all the fields before they are
redirected to the next page. And if they don’t fill the fields it
should raise an error telling them to fill the fields before they
proceed. So to do that, I wrote the codes below. But the problem I’m
facing is that when I didn’t fill the fields, it took me to the next
page, instead of it to return me to the same page, and it didn’t raise
any error.

How can I make it validate those fields before taking users to the
next page?

Model:

from django.core.exceptions import ValidationError

class Memb(models.Model):
slug=models.CharField(max_length=100)
member=models.CharField(max_length=100)

def __unicode__(self):
return self.member, self.slug

def clean_slug(self):
data=self.cleaned_data['slug']
if "Testy" not in data:
raise ValidationError("Enter the correct name for this
field")

class MembForm(ModelForm):
class Meta:
model=Memb
fields=('slug','member')

Views:

def my_memb(request):
if request.method=="POST":
form=MembForm(request.POST)
if form.is_valid():
data=form.cleaned_data
form.save()
return HttpResponseRedirect('/good/')
else:
form=MembForm()
return render_to_response('member.html',{'MembForm':MembForm},
context_instance=RequestContext(request))

Template:

{% block content %}

  {{MembForm.as_p}}


{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Form Validation

2012-04-15 Thread coded kid
I want my form to validate the fields so that only users who fill the
form field should be redirected to the next page. If a user fails to
fill any of the form field, the user should be taken to the same page
where it will output validation error so that the user can fill the
fields.

I tried writing these codes but it’s not working! Even if the user
didn’t fill the form field it will still redirect the user to the next
page which is not meant to be so.

Models.

class Memb(models.Model):
slug=models.CharField(max_length=100)
member=models.CharField(max_length=100)

def __unicode__(self):
return u"%s" % self.member

class MembForm(ModelForm):
class Meta:
model=Memb
fields=('slug','member')

Views:

def my_memb(request):
if request.method=="POST":
form=MembForm(request.POST)
if form.is_valid():
data=form.cleaned_data
form.save()
return HttpResponseRedirect('/test/')
else:
form=MembForm()
return render_to_response('member.html',
{'MembForm':MembForm}, context_instance=RequestContext(request))

Template:

{% extends "base.html" %}
{% block title %} Add Member {% endblock %}
{% block content %}

  {{MembForm.as_p}}


{% endblock %}

How can I make sure the form validate before taking the user to the
next page? Kindly put me through. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



List Users

2012-04-05 Thread coded kid
I’m trying to iterate through user list member in tweepy. When I tried
it out, it’s not displaying any user objects! The webpage is just
blank. Below are my codes:

Views:

def listmem(request):
consumer_key="XXX"
consumer_secret="XXX"
access_token="XXX"
access_token_secret="XXX"
auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api=tweepy.API(auth)
Users= tweepy.Cursor(api.list_members, owner=request.user,
slug='slug').items()
for User in Users:
User.__getstate__()
return render_to_response('listmember.html',{'Users':
Users},context_instance=RequestContext(request))

Template:

{% block content %}
   {% for User in Users %}
  {{ User.author.screen_name}} 
  {% endfor %}

 {% endblock %}
How can I make it display user objects?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Users Tweepy

2012-04-05 Thread coded kid
Hi guys, please how can I get a user username in tweepy? I hope you
get my point? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tweepy Image and Link display

2012-03-30 Thread coded kid
Hi guys, how can I get users twitter handle with link and display
their image in my django app. What I mean is this, I want the users
username should be clickable (so that when I click on it it will
direct me to the user profile), and display the user profile image by
their update. I hope you get my point?

Below are mu codes:

Views:

def tweetstream(request):
consumer_key=""
consumer_secret=""
access_token=""
access_token_secret=""
auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api=tweepy.API(auth)
statuses=api.friends_timeline(count=30)
for status in statuses:
status.__getstate__()
return render_to_response('tweets.html',{'statuses':
statuses}, context_instance=RequestContext(request))

Templates:

{% extends "base.html" %}


 {% block content %}


 {% for status in statuses %}
{{ status.author.screen_name}} :
   {{ status.text|safe }}  
  {{ status.created_at }}  Via: {{status.source}} 
{{ status.profile_image_url }}

 {% endfor %}



{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django With Tweepy

2012-03-28 Thread coded kid
Thanks guys!  @Pachnis How do you mean by Django API queries? 

On Tuesday, 27 March 2012 08:59:28 UTC+1, coded kid wrote:
>
> Hi guys, I’m confused on how to make this work. I want to stream 
> user’s tweets in my django app using tweepy. I’ve written the 
> streaming code but the problem I’m facing is: should I paste the code 
> in views.py and input- return 
> render_to_response('tweet.html',context_instance=RequestContext(request)) 
> after writing the code. Just like this: 
>
>
> Q= sys.argv[1:] 
>
> db=MySQLdb.connect("localhost","","","Juzme") 
>
> auth=tweepy.OAuthHandler(consumer_key, consumer_secret) 
> auth.set_access_token(access_token, access_token_secret) 
>
> cur=db.cursor() 
>
> class CustomStreamListener(tweepy.StreamListener): 
> def on_status(self, status): 
> try: 
> print "%s\t%s\t%s\t%s" % (status.text, 
>   status.author.screen_name, 
>   status.created_at, 
>   status.source,) 
> cur.execute("INSERT INTO tweets VALUES (%s, %s, %s, %s)", 
> (status.text, 
>   
> status.author.screen_name, 
>   
> status.created_at, 
>   
> status.source)) 
> except Exception, e: 
> print >> sys.stderr, 'Encountered Exception:', e 
> pass 
> def on_error(self, status_code): 
> print >> sys.stderr, 'Encountered error with status code:', 
> status_code 
> return True 
> def on_timeout(self): 
> print >> sys.stderr, 'Timeout...' 
> return True 
> streaming_api=tweepy.streaming.Stream(auth, CustomStreamListener(), 
> timeout=60) 
> print >> sys.stderr, 'Filtering the public timeline for "%s"' % (' 
> '.join(sys.argv[1:]),) 
> streaming_api.filter(follow=[], track=Q) 
> return 
> render_to_response('tweet.html',context_instance=RequestContext(request)) 
>
> If I can do it like this, won’t there be any code in template? Or 
> what’s the best way I can carry out this operation. I hope you get my 
> point? Thanks! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/eTmXh1EiYNwJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tweepy Not Displaying

2012-03-28 Thread coded kid
Hi guys, I want to display user’s timeline in my django app but it’s
not working. It only display a white blank page! I’m using Tweepy.
Below are my codes:

Views.py

import tweepy

def tweetstream(request):
consumer_key=""
consumer_secret="XXX"
access_token="XXX"
access_token_secret=""
auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api=tweepy.API(auth)
status=api.user_timeline()
for status in status:
if status:
status.__getstate__()
return render_to_response('tweet.html',
context_instance=RequestContext(request))

Template:
{% extends "base.html" %}

 {% block content %}

 {% for status in status %}
   {% if status %}
{{ status.author.screen_name}} {{status.text}}
{{status.source}}

{% endif %}
 {% endfor %}


{% endblock %}

What I’m I missing? How can I make it return user’s timeline?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django With Tweepy

2012-03-27 Thread coded kid
Hi guys, I’m confused on how to make this work. I want to stream
user’s tweets in my django app using tweepy. I’ve written the
streaming code but the problem I’m facing is: should I paste the code
in views.py and input- return
render_to_response('tweet.html',context_instance=RequestContext(request))
after writing the code. Just like this:


Q= sys.argv[1:]

db=MySQLdb.connect("localhost","","","Juzme")

auth=tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)

cur=db.cursor()

class CustomStreamListener(tweepy.StreamListener):
def on_status(self, status):
try:
print "%s\t%s\t%s\t%s" % (status.text,
  status.author.screen_name,
  status.created_at,
  status.source,)
cur.execute("INSERT INTO tweets VALUES (%s, %s, %s, %s)",
(status.text,
 
status.author.screen_name,
 
status.created_at,
 
status.source))
except Exception, e:
print >> sys.stderr, 'Encountered Exception:', e
pass
def on_error(self, status_code):
print >> sys.stderr, 'Encountered error with status code:',
status_code
return True
def on_timeout(self):
print >> sys.stderr, 'Timeout...'
return True
streaming_api=tweepy.streaming.Stream(auth, CustomStreamListener(),
timeout=60)
print >> sys.stderr, 'Filtering the public timeline for "%s"' % ('
'.join(sys.argv[1:]),)
streaming_api.filter(follow=[], track=Q)
return
render_to_response('tweet.html',context_instance=RequestContext(request))

If I can do it like this, won’t there be any code in template? Or
what’s the best way I can carry out this operation. I hope you get my
point? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Tweepy Status Error

2012-03-25 Thread coded kid
Hi guys, I been trying to iterate over status, but I’m getting this
error:

Traceback :
 File “”, line 2, in 
NameError: name ‘process_status’ is not defined.

Below is the codes:

from tweepy import Cursor
for status in Cursor(api.user_timeline).items():
process_status(status)

What I’m I doing wrong? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Loading Of Tweets

2012-03-23 Thread coded kid
Hi guys, I;ve been facing some problem with loading of tweets in my
django project. The question now is; how can I load users tweets in my
django site. I'm using omab/django social auth to authenticate users.
Anyone have the idea?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



A good Twitter Package

2012-03-16 Thread coded kid
Hi guys, does anyone know about a good django package for twitter
authorization? I tried using omab/django social auth, but the twitter
authorization is not working for me.

Would love to hear your opinion! Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TypeError

2012-03-14 Thread coded kid
Hi guys, I want this code to display list of friends of a user, list
of friends to add, after writing the codes and testing it out, I’m
getting this error:

TypeError at /userpage/
user_page() takes exactly 2 arguments (1 given)
Request Method: GET
Request URL:http://127.0.0.1:8000/userpage/
Django Version: 1.3.1
Exception Type: TypeError
Exception Value:user_page() takes exactly 2 arguments (1 given)
Exception Location: C:\Python27\lib\site-packages\django\core\handlers
\base.py in get_response, line 111
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.2

Below are my codes:

Views:

def user_page(request, username):
user=get_object_or_404(User, username=username)
if request.user.is_authenticated():
is_friend=Friendship.objects.filter(
from_friend=request.user,
to_friend=user
)
else:
is_friend=False
return render_to_response('user_page.html',
context_instance=RequestContext(request))

Template:

{% extends "base.html" %}

{% block content %}
  {% ifequal user.username username %}
view your friends
  {% else %}
{% if is_friend %}
  
{{ username }} is a friend of yours
{% else %}
  
add {{ username }} to your friends
{% endif %}
- 
view {{username }}'s friends
  {% endifequal %}
  {% endblock %}
Please help me out!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Displaying Updates

2012-03-14 Thread coded kid

1. User will be able to find each other
2. follow each other if they feel like (it's not necessary the second user 
follow back)
3. followers will be able to see the users they are following updates on 
their own wall.


On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>
> What's your algorithm?
>
> On 3/13/12, coded kid <duffleboi...@gmail.com> wrote:
> > Hi Guys, how can I make users who are following each other view their
> > status update on their walls? In my project, users can follow and
> > unfollow each other but the problem I’m facing is that, both of them
> > can’t see each other statuses on their wall.
> >
> > I’m using a caffinehit/django follow package that handles following of
> > users.
> >
> > I would be glad if you can try and answer this question!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> -- 
> Sent from my mobile device
>
>
On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>
> What's your algorithm?
>
> On 3/13/12, coded kid <duffleboi...@gmail.com> wrote:
> > Hi Guys, how can I make users who are following each other view their
> > status update on their walls? In my project, users can follow and
> > unfollow each other but the problem I’m facing is that, both of them
> > can’t see each other statuses on their wall.
> >
> > I’m using a caffinehit/django follow package that handles following of
> > users.
> >
> > I would be glad if you can try and answer this question!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> -- 
> Sent from my mobile device
>
>
On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>
> What's your algorithm?
>
> On 3/13/12, coded kid <duffleboi...@gmail.com> wrote:
> > Hi Guys, how can I make users who are following each other view their
> > status update on their walls? In my project, users can follow and
> > unfollow each other but the problem I’m facing is that, both of them
> > can’t see each other statuses on their wall.
> >
> > I’m using a caffinehit/django follow package that handles following of
> > users.
> >
> > I would be glad if you can try and answer this question!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> -- 
> Sent from my mobile device
>
>
On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>
> What's your algorithm?
>
> On 3/13/12, coded kid <duffleboi...@gmail.com> wrote:
> > Hi Guys, how can I make users who are following each other view their
> > status update on their walls? In my project, users can follow and
> > unfollow each other but the problem I’m facing is that, both of them
> > can’t see each other statuses on their wall.
> >
> > I’m using a caffinehit/django follow package that handles following of
> > users.
> >
> > I would be glad if you can try and answer this question!
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
> >
>
> -- 
> Sent from my mobile device
>
>
On Wednesday, 14 March 2012 10:58:57 UTC+1, Tundebabzy wrote:
>
> What's your algorithm?
>
> On 3/13/12, coded kid

Displaying Updates

2012-03-13 Thread coded kid
Hi Guys, how can I make users who are following each other view their
status update on their walls? In my project, users can follow and
unfollow each other but the problem I’m facing is that, both of them
can’t see each other statuses on their wall.

I’m using a caffinehit/django follow package that handles following of
users.

I would be glad if you can try and answer this question!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Haystack Solr Error

2012-03-04 Thread coded kid
I'm trying to rebuild_index, so after inputting manage.py rebuild-
index , I'm getting:

Removing all documents in your index because you said so.
fail to clear Solr index: [Errno 10061] No connection could be made
because the target
machine actively refused it.

What I'm I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Haystack and Xapian

2012-03-01 Thread coded kid
Hi guys, I want to use Django Haystack with Xapian on my django site
for search function. After setting all the necessary settings. I went
ahead to input: manage.py rebuild_index , after inputting 'y' I'm
getting an error saying: No module named xapian_backend.

I can see the xapian backend module in site-packages, but I don't know
why Django is not seeing it. How Can I make it work?

Below is my settings:

import os
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.xapian_backend.XapianEngine',
'PATH': 'C:/Python27/Scripts/myweb/xapian_index',
'INCLUDE_SPELLING': True,
'BATCH_SIZE': 100,
},
}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django TypeError-/SEARCH/

2012-03-01 Thread coded kid
Hi guys, I want to create a search form for my django site. So after
creating it, I input the keyword I want to search, after clicking on
“Search” I’m getting:

TypeError at /search/
Related Field has invalid lookup: icontains
Request Method: GET
Request URL:http://127.0.0.1:8000/search/?q=lordme
Django Version: 1.3.1
Exception Type: TypeError
Exception Value:Related Field has invalid lookup: icontains
Exception Location: C:\Python27\lib\site-packages\django\db\models
\fields\related.py in get_prep_lookup, line 141
Python Executable:  C:\Python27\python.exe
Python Version: 2.7.2

Below are my codes:

Models:
#I just paste this in models.

def normalize_query(query_string,
findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
normspace=re.compile(r'\s{2,}').sub):
''' Splits the query string in invidual keywords, getting rid of
unecessary spaces
and grouping quoted words together.
Example:

>>> normalize_query('  some random  words "with   quotes  "
and   spaces')
['some', 'random', 'words', 'with quotes', 'and', 'spaces']

'''
return [normspace(' ', (t[0] or t[1]).strip()) for t in
findterms(query_string)]

def get_query_set(query_string, search_fields):
''' Returns a query, that is a combination of Q objects. That
combination
aims to search keywords within a model by testing the given
search fields.

'''
query = None # Query to search for every search term
terms = normalize_query(query_string)
for term in terms:
or_query = None # Query to search for a given term in each
field
for field_name in search_fields:
q = Q(**{"%s__icontains" % field_name: term})
if or_query is None:
or_query = q
else:
or_query = or_query | q
if query is None:
query = or_query
else:
query = query & or_query
return query

Views:

from myweb.meekapp.models import get_query_set
def search(request):
query_string = ''
found_entries = None
if ('q' in request.GET) and request.GET['q'].strip():
query_string = request.GET['q']

entry_query = get_query_set(query_string, ['user'])

found_entries =
UserProfile.objects.filter(entry_query).order_by('-pub_date')


return render_to_response('search_form.html',
  { 'query_string': query_string,
'found_entries': found_entries },
  context_instance=RequestContext(request))
Template:



Search









What am I missing?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django ExtraField

2012-02-27 Thread coded kid
So you mean I will override the template? Since I will be making the
correction is the models.

On Feb 25, 3:12 pm, Carlos Leite <cadu...@gmail.com> wrote:
> On Fri, Feb 24, 2012 at 2:14 PM, coded kid <duffleboi...@gmail.com> wrote:
> > Sorry, How will I set that? is it from the template?
>
> no, its a widget ...
>
> you have to set the widget on your form class
>
> Class MyForm(model / form)
>    hide_field = forms.CharField(widget=forms.HiddenInput)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django ExtraField

2012-02-24 Thread coded kid
Sorry, How will I set that? is it from the template?

On Feb 24, 4:29 pm, Marcos Moyano <marcosmoy...@gmail.com> wrote:
> You can set a hidden input widget to the form field.
>
> Rgds,
> Marcos
>
>
>
>
>
>
>
>
>
> On Fri, Feb 24, 2012 at 11:26 AM, coded kid <duffleboi...@gmail.com> wrote:
> > Hi guys, How can I get rid of the field that's beside django comment
> > textarea? (the field, if users fill the field[honeypot]  the users
> > comment will be marked as spam) I hope you get my point? Below is my
> > code:
>
> > comments/form.html
>
> > {% if user.is_authenticated %}
> >   
> >        {% csrf_token %}
> >        {% if sol %} > value="{{request.path}}" />{% endif %}
> >        {% for field in form %}
> >            {% if field.is_hidden %}
> >                {{ field }}
> >            {% else %}
> >                {% if field.name != "name" and field.name != "email"
> > and field.name != "url" %}
> >                    {% if field.errors %}{{ field.errors }}{% endif
> > %}
> >                     {{ field }}
> >                {% endif %}
> >            {% endif %}
> >        {% endfor %}
> >        
> >   
> > {% else %}
> >    I'm sorry, but you must be logged in to submit comments.
> > {% endif %}
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Some people, when confronted with a problem, think “I know, I'll use
> regular expressions.” Now they have two problems.
>
> Jamie Zawinski, in comp.emacs.xemacs

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django ExtraField

2012-02-24 Thread coded kid
Hi guys, How can I get rid of the field that's beside django comment
textarea? (the field, if users fill the field[honeypot]  the users
comment will be marked as spam) I hope you get my point? Below is my
code:

comments/form.html

{% if user.is_authenticated %}
   
{% csrf_token %}
{% if sol %}{% endif %}
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field.name != "name" and field.name != "email"
and field.name != "url" %}
{% if field.errors %}{{ field.errors }}{% endif
%}
 {{ field }}
{% endif %}
{% endif %}
{% endfor %}

   
{% else %}
I'm sorry, but you must be logged in to submit comments.
{% endif %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Comments-Redirecting

2012-02-23 Thread coded kid
Thanks man! I've changed it to {{request.path}}.

Not thinking bout anything. Just might be tired then!

On Feb 23, 4:30 pm, Babatunde Akinyanmi <tundeba...@gmail.com> wrote:
> dude,
> change {% url
>  %}" /> to
> your own custom view like the view you used to load the page where you
> are collecting the comments.
>
> Don't mean to be harsh but what were you thinking?
>
> django.contrib.comments.views.comments.comment_done by default
> redirects to the "Thanks for your comment" page.
>
> On 2/23/12, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi guys, how can I get rid of users being directed to the “Thanks you
> > for your comment” page after commenting  in Django site? I users to be
> > redirected to the same page they commented.  I’m using Django
> > comments.
>
> > I’ve tried adding:
>
> >  > django.contrib.comments.views.comments.comment_done %}" />
>
> > But it’s not working. Below is codes in my comment/form.html
>
> > {% load comments %}
> > {% get_comment_count for sol as comment_count %}
> > {% get_comment_list for sol as comment_list %}
> > {% get_comment_form for sol as form %}
> > {% if user.is_authenticated %}
> >    
> >         {% csrf_token %}
> >         {% if next %}{% endif %}
> >         {% for field in form %}
> >             {% if field.is_hidden %}
> >                 {{ field }}
> >             {% else %}
> >                 {% if field.name != "name" and field.name != "email"
> > and field.name != "url" %}
> >                     {% if field.errors %}{{ field.errors }}{% endif %}
> >                     {{ field }}
> >                 {% endif %}
> >             {% endif %}
> >         {% endfor %}
> >    
> >    
> > {% else %}
> >     I'm sorry, but you must be logged in to submit comments.
> > {% endif %}
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django and social network

2012-02-23 Thread coded kid
I guess my idea can help you out! Install Django 1.3. After
installing, try and download packages like omab/social_auth that will
enable users to log in through facebook, twitter etc. Also download
agon_ratings that will enable users to rate. You can get those
packages from djangopackages.com. Use Django comments for making users
comments. You will have to write some views, models, templates codes
for somethings. I hope you know about django?

For me Pinax aint helping at all. You still have a long way to go
though. If you keep persisting, you will get there. I'm also a noob
though. Feel free to let me know what you think!

Cheers

On Feb 22, 6:53 pm, Alec Taylor  wrote:
> k
>
> If you have issues, read the docs.
>
> If you still have issues, ask on pinax-users mailing-list not django-users.
>
> On Thu, Feb 23, 2012 at 3:57 AM, Lewis Satini wrote:
>
>
>
>
>
>
>
> > and I can only install basic, I had problem getting the advance install
>
> > On Wed, Feb 22, 2012 at 11:57 AM, Lewis Satini 
> > wrote:
>
> >> How much experience do you have on pinax. Did you implemented before? do
> >> you have the sample site, that I might able to look at? it is difficult to
> >> install, because it have some requirement before you install it.
>
> >> On Wed, Feb 22, 2012 at 11:04 AM, Alec Taylor 
> >> wrote:
>
> >>> Pinax
>
> >>>http://pinaxproject.com/
>
> >>> On Thu, Feb 23, 2012 at 1:50 AM, Lewis  wrote:
> >>> > I am new in Django. I know it is a good platform.
> >>> > I want to know if there's any plug-ins or script that do social
> >>> > networking. I research on Pinax, but it seem very difficult to set it
> >>> > up. These are the feature that I want to implement:
> >>> > 1. Profile system that link to their facebook or google profile that
> >>> > they have.
> >>> > 2. Login with gmail account or facebook account
> >>> > 3. able to store they login and password to local database
> >>> > 4. able to do rating and comments
>
> >>> > Can someone suggest anything?
>
> >>> > Thanks for your help
>
> >>> > --
> >>> > You received this message because you are subscribed to the Google
> >>> Groups "Django users" group.
> >>> > To post to this group, send email to django-users@googlegroups.com.
> >>> > To unsubscribe from this group, send email to
> >>> django-users+unsubscr...@googlegroups.com.
> >>> > For more options, visit this group at
> >>>http://groups.google.com/group/django-users?hl=en.
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Django users" group.
> >>> To post to this group, send email to django-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> django-users+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/django-users?hl=en.
>
> >> --
>
> >> Artistbean.com 
> >> SMS at (646) 450-6756
>
> > --
>
> > Artistbean.com 
> > SMS at (646) 450-6756
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Comments-Redirecting

2012-02-23 Thread coded kid
Hi guys, how can I get rid of users being directed to the “Thanks you
for your comment” page after commenting  in Django site? I users to be
redirected to the same page they commented.  I’m using Django
comments.

I’ve tried adding:



But it’s not working. Below is codes in my comment/form.html

{% load comments %}
{% get_comment_count for sol as comment_count %}
{% get_comment_list for sol as comment_list %}
{% get_comment_form for sol as form %}
{% if user.is_authenticated %}
   
{% csrf_token %}
{% if next %}{% endif %}
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field.name != "name" and field.name != "email"
and field.name != "url" %}
{% if field.errors %}{{ field.errors }}{% endif %}
{{ field }}
{% endif %}
{% endif %}
{% endfor %}

   
{% else %}
I'm sorry, but you must be logged in to submit comments.
{% endif %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread coded kid
 (r'^comments/posted/$', 'myweb.meekapp.views.comment_posted' ),

On Feb 22, 3:37 pm, Ejah <ej.huijb...@gmail.com> wrote:
> How does your urls.py look?
>
> On 22 feb, 15:28, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I've changed it!
> > def get_absolute_url(self):
> >         #return u"%s" % (self.user)
> >         return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
> > self.date.day, self.id)
> > but I'm getting page not found,
>
> > Page not found (404)
> > Request Method:         GET
> > Request URL:    http://127.0.0.1:8000/2012/2/20/6/
>
> > Any idea?
>
> > On Feb 22, 3:15 pm, Thomas Rega <tho...@googlemail.com> wrote:
>
> > > Am 22.02.12 15:11, schrieb coded kid:
>
> > > >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > > > self.date.month, self.date.day, self.id)
>
> > > 5 != 4
>
> > > cheers ...
>
> > > --
>
> > >http://thoreg.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread coded kid
I've changed it!
def get_absolute_url(self):
#return u"%s" % (self.user)
return u"/%i/%i/%i/%s/" % (self.date.year, self.date.month,
self.date.day, self.id)
but I'm getting page not found,

Page not found (404)
Request Method: GET
Request URL:http://127.0.0.1:8000/2012/2/20/6/

Any idea?

On Feb 22, 3:15 pm, Thomas Rega <tho...@googlemail.com> wrote:
> Am 22.02.12 15:11, schrieb coded kid:
>
> >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > self.date.month, self.date.day, self.id)
>
> 5 != 4
>
> cheers ...
>
> --
>
> http://thoreg.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django TypeError

2012-02-22 Thread coded kid
Thanks for the reply! But it's still not working. Should I put 5 !=4
below the return in models.py?

On Feb 22, 3:15 pm, Thomas Rega <tho...@googlemail.com> wrote:
> Am 22.02.12 15:11, schrieb coded kid:
>
> >   return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
> > self.date.month, self.date.day, self.id)
>
> 5 != 4
>
> cheers ...
>
> --
>
> http://thoreg.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django TypeError

2012-02-22 Thread coded kid
Hi Guys, I’m trying to override django comments by not redirecting
users to “Thanks For The Comment” page. After inserting the codes, I’m
getting an Error:

TypeError at /comments/posted/
not enough arguments for format string
Request Method: GET
Request URL: http://127.0.0.1:8000/comments/posted/?c=23
Django Version: 1.3.1
Exception Type: TypeError Exception Value:
not enough arguments for format string
Exception Location: C:\Python27\Scripts\myweb\meekapp\models.py in
get_absolute_url, line40 Python Executable: C:\Python27\python.exe
Python Version: 2.7.2


In my Models:
class sol(models.Model):
body=models.TextField(max_length=1)
user=models.ForeignKey(User)
date=models.DateTimeField()
state_province=models.CharField(max_length=50)
avatar=models.ImageField("Profile Pic", upload_to="photologue/
photos/", blank=True, null=True)
 def __unicode__(self):
return u"%s" % (self.body)

def get_absolute_url(self):
#return u"%s" % (self.user)
return u"/%i/%i/%i/sol/%i/%s/" % (self.date.year,
self.date.month, self.date.day, self.id)  #this is where python is
pointing to concerning the error.

In Views:
def comment_posted(request):
if request.GET['c']:
comment_id = request.GET['c']
comment = Comment.objects.get( pk=comment_id )
Sol = sol.objects.get(id=comment.object_pk)
if Sol:
return HttpResponseRedirect( Sol.get_absolute_url() )
return HttpResponseRedirect( "/" )

How can I get rid of this?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Adding Of Users

2012-02-19 Thread coded kid
Hi guys, I'm trying to make the below script let users follow each
other. Just like adding friends up.So that users will be able to
follow each other.  When I click the 'follow' button in a user
profile, instead of it to take me to the users wall, it will only
redirect me to the same page(user profile page). and it won't add up
the user.

I just try this code, though. Please put me through.

Model:

class followme(models.Model):
user=models.ForeignKey(User)
userprofile=models.ForeignKey(UserProfile)

def __unicode__(self):
return u"%s" % self.user

class FollowForm(ModelForm):
class Meta:
model=followme
exclude=('user','userprofile')

View:

def followm(request):
if request.method=="POST":
form=FollowForm(request.POST)
if form.is_valid():
new_obj=form.save(commit=False)
new_obj.initiated_by=request.user
u=User.objects.get(request.POST['profile_id'])
new_obj.follow=u
new_obj.save()
return HttpResponseRedirect('/homi/')
else:
form=FollowForm()
return render_to_rensponse('follow.html',
{'FollowForm':form,},context_instance=RequestContext(request))

Template:









-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Anyone Tested this? Please Participate.

2012-02-17 Thread coded kid
Hello, I’m not getting the usage of the package (Django-Follow) in
template, because I keep getting error. What I did is this; I want to
use it for following of users. Just like how friends add each other up
or follow each other on sites like twitter.
So I registered it with UserProfile in models,py.

utils.register(UserProfile)

And UserProfile consists of fields like names, state, country, etc.

After registering it in models, I went on to profiles template and
‘include /follow/form.html’ so that if a user finds another users
profile, and both are not following each other, it will be easy for
one of them to make the request by following. But I keep getting
error.

My question now is this: How will I make use of it in the template?
What is the best way of doing this?

If you've used Django-Follow package before, kindly help me out with
this, Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Location- Does anyone know about this?

2012-02-15 Thread coded kid
Hi Guys, Does anyone knows about any good django package for maps? or
for locating of areas, states, streets? Please kindly answer if you
do. Thanks.

BTW: I've tried using Django easy_maps but it's not working. If you've
used easy_maps before, kindly comment below. Just want to ask you a
few questions.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Comments Not Displaying

2012-02-15 Thread coded kid
Thanks bro! Just got the logic! Cheers. @Daniel keep up the good work,
even if you once hit me in the ass on StackOverflow! :)

On Feb 14, 3:47 pm, Tom Evans <tevans...@googlemail.com> wrote:
> On Tue, Feb 14, 2012 at 2:45 PM, coded kid <duffleboi...@gmail.com> wrote:
> > Below the status. I'm not sure if I fixed this. How will I make it
> > display comment? Please.
>
> This page has some hints:
>
> https://docs.djangoproject.com/en/1.3/ref/contrib/comments/#displayin...
>
> Cheers
>
> Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Comments Not Displaying

2012-02-14 Thread coded kid
Below the status. I'm not sure if I fixed this. How will I make it
display comment? Please.

On Feb 14, 12:32 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Tuesday, 14 February 2012 12:02:58 UTC, coded kid wrote:
>
> > Hi guys, I'm using Django.contrib.comments in my Django web app. After
> > installing django comments and setting up all other things, I decided
> > to give it a try by commenting on my status.
>
> > I commented and I was redirected to /comment/posted/. But the problem
> > I'm facing is that, Django comments is not displaying my comments. I
> > can't find it anywhere but it will save it in the DB. What I'm I
> > missing?
>
> > {% load comments %}
> > {% get_comment_count for sol as comment_count %}
> > {% get_comment_list for sol as comment_list %}
> > {% get_comment_form for sol as form %}
>
> > {% if user.is_authenticated %}
> >    
> >         {% csrf_token %}
> >         {% if next %} > value="{{ next }}" />{% endif %}
> >         {% for field in form %}
> >             {% if field.is_hidden %}
> >                 {{ field }}
> >             {% else %}
> >                 {% if field.name != "name" and field.name != "email"
> > and field.name != "url" %}
> >                     {% if field.errors %}{{ field.errors }}{% endif %}
> >                     {{ field }}
> >                 {% endif %}
> >             {% endif %}
> >         {% endfor %}
> >          > value="Post" />
> >    
> > {% else %}
> >     I'm sorry, but you must be logged in to submit comments.
> > {% endif %}
>
> OK, so where in the template above are you actually asking it to display
> comment_list?
> --
> DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Comments Not Displaying

2012-02-14 Thread coded kid
Hi guys, I'm using Django.contrib.comments in my Django web app. After
installing django comments and setting up all other things, I decided
to give it a try by commenting on my status.

I commented and I was redirected to /comment/posted/. But the problem
I'm facing is that, Django comments is not displaying my comments. I
can't find it anywhere but it will save it in the DB. What I'm I
missing?

{% load comments %}
{% get_comment_count for sol as comment_count %}
{% get_comment_list for sol as comment_list %}
{% get_comment_form for sol as form %}



{% if user.is_authenticated %}
   
{% csrf_token %}
{% if next %}{% endif %}
{% for field in form %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field.name != "name" and field.name != "email"
and field.name != "url" %}
{% if field.errors %}{{ field.errors }}{% endif %}
{{ field }}
{% endif %}
{% endif %}
{% endfor %}

   
{% else %}
I'm sorry, but you must be logged in to submit comments.
{% endif %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Comments Link- How to?

2012-02-13 Thread coded kid
Okay. Just like this.  Comment
Link Name 

Where "Comment Link Name" is the name you want to give to your link.
So when a user click on it, it should show the comment form on the
same page.  I hope you now get my point?

On Feb 13, 1:26 pm, Babatunde Akinyanmi <tundeba...@gmail.com> wrote:
> Please Rephrase. I don't get the part of "comment link name"
>
> On 2/13/12, coded kid <duffleboi...@gmail.com> wrote:
>
> > Hi Guys, How can I link to “Django Comment form”, so that when a user
> > clicks on the “Comment Link Name” It will display the Comment Form on
> > the same page with the post. I hope you get my point? If you do please
> > answer and if you don’t ask me to explain further.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Sent from my mobile device

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Comments Link- How to?

2012-02-13 Thread coded kid
Hi Guys, How can I link to “Django Comment form”, so that when a user
clicks on the “Comment Link Name” It will display the Comment Form on
the same page with the post. I hope you get my point? If you do please
answer and if you don’t ask me to explain further.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Comments form customization

2012-02-13 Thread coded kid
Hey Fabio,
How do you get your comment form to display? Been fighting with this
for the past 5hrs. Please any idea? Thanks.

On Feb 13, 11:12 am, Fabio Natali  wrote:
> On 02/13/2012 10:52 AM, Vovk Donets wrote:
>
> > It's not really great solution, but maybe it will give you a hint: you
> > can add/remove fileds to the form on the fly. And for not logged in
> > users show all fields, but for authenticated only subset of the all form
> > fields.
>
> Ehi Vladimir, thank you for your quick reply!
>
> I found a couple of interesting links.
>
> http://mitchfournier.com/2010/08/12/customizing-django-comments-remov...http://stackoverflow.com/questions/1456267/django-comments-want-to-re...
>
> The first deals with writing your own comment templates, so to remove
> unnecessary fields (name, url, email).
>
> The latter deals with writing your own custom comment form, no need to
> hack template stuff. This looks nicer to me, I think I'll try it first.
>
> Vladimir, is that the approach you meant?
>
> I am still not sure this is the best solution for me. So, those of you
> who are listening, if you have any further advice/hint, don't hesitate
> to email me! :-)
>
> Cheers, Fabio.
>
> --
> Fabio Natali

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Comment post not allowed (400)

2012-02-13 Thread coded kid
Hey guys, when I include the django comments form in the template I
want to use it, After visting the page, I can only see "POST" and
"PREVIEW" button and the form itself is not showing. So I clicked on
the 'POST" button to see what's next.

After clicking it, I get this:

Comment post not allowed (400)
Why:Missing content_type or object_pk field.

The comment you tried to post to this view wasn't saved because
something tampered with the security information in the comment form.
The message above should explain the problem, or you can check the
comment documentation for more help.

You're seeing this error because you have DEBUG = True in your Django
settings file. Change that to False, and Django will display a
standard 400 error page.

Django Documents aint helping in this case. Please What I'm I missing?
below is the codes in my form.html

{% load comments i18n %}
{% csrf_token
%}
  {% if next %}{% endif %}
  {% for field in form %}
{% if field.is_hidden %}
  {{ field }}
{% else %}
  {% if field.errors %}{{ field.errors }}{% endif %}
  
{{ field.label_tag }} {{ field }}
  
{% endif %}
  {% endfor %}
  

{#  #}
  


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Comments Form not Displaying

2012-02-12 Thread coded kid
Thanks guys. @matias I tried your solution, and the post button
appeared. After clicking on it, I get 'COMMENT POST NOT ALLOWED (404)'
Please whats wrong?



On Feb 12, 4:37 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> Excerpts from Michael P. Soulier's message of 2012-02-12 14:16:26 -0200:
>
>
>
>
>
> > On 12/02/12 coded kid said:
>
> > > Below is the codes in my comments/form.html
> > > {% load comments i18n %}
> > > {% csrf_token
> > > %}
> > >   {% if next %} > > value="{{ next }}" />{% endif %}
> > >   {% for field in form %}
> > >     {% if field.is_hidden %}
> > >       {{ field }}
> > >     {% else %}
> > >       {% if field.errors %}{{ field.errors }}{% endif %}
> > >        > >         {% if field.errors %} class="error"{% endif %}
> > >         {% ifequal field.name "honeypot" %} style="display:none;"{%
> > > endifequal %}>
> > >         {{ field.label_tag }} {{ field }}
> > >       
> > >     {% endif %}
> > >   {% endfor %}
> > >   
> > >     
> > >      > > value="{% trans "Preview" %}" />
> > >   
> > > 
>
> > You have conditionals on all output. If you're seeing a blank page, perhaps
> > those conditionals are all false. Put in some unconditional content and see 
> > if
> > it renders, and then start testing your conditionals.
>
> "/comments/post" is decorated by require_POST, that means that POST is the 
> only
> method allowed to access that view, check your response, you should be getting
> a 405 response.
>
> You should include the form in the page you want it to display, let's say
> a blog post page, but if you want the form on a single page, then you need to
> define a different URL and view to render the template.
>
> Regards,
> Matías
> --
> Matías Aguirre (matiasagui...@gmail.com)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Comments Form not Displaying

2012-02-12 Thread coded kid
Hi guys, please help me out with django-comments form. I added :
'django.contrib.comments',  to INSTALLED APPS

(r'^comments/', include('django.contrib.comments.urls')), to urls.py
and I copied the default templates from
django.contrib.comments.templates.comments to my app templates
directory.

 After doing that, I visit localhost:8000/comments/posts and the page
is not showing me any comments form, it just showing me a white blank
page. What I'm I doing wrong?

Below is the codes in my comments/form.html
{% load comments i18n %}
{% csrf_token
%}
  {% if next %}{% endif %}
  {% for field in form %}
{% if field.is_hidden %}
  {{ field }}
{% else %}
  {% if field.errors %}{{ field.errors }}{% endif %}
  
{{ field.label_tag }} {{ field }}
  
{% endif %}
  {% endfor %}
  


  

Hope to hear from you soon.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



What Can I use?

2012-02-11 Thread coded kid
Hey guys, anyone know about a django package I can use for comment in
django site? The one I see is Django-comment but it's not maintained
anymore. What other one do you know about? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Finding It Hard To Make It Work!

2012-02-08 Thread coded kid
Thanks bro. Will do. But do you know about a specific Topic I should
learn?

On Feb 8, 10:18 am, Thomas Weholt <thomas.weh...@gmail.com> wrote:
> Google "ajax tutorial" or even better just google jquery and take it
> from there. There are several tutorials on how to integrate jquery and
> django as well.
>
> Thomas
>
>
>
>
>
>
>
>
>
> On Wed, Feb 8, 2012 at 10:11 AM, coded kid <duffleboi...@gmail.com> wrote:
> > How bro? Don't know Ajax. Can you please put me through? I'm a
> > Nigerian bro!
>
> > On Feb 8, 10:02 am, Babatunde Akinyanmi <tundeba...@gmail.com> wrote:
> >> Use AJAX or asynchronous programming
>
> >> On 2/8/12, coded kid <duffleboi...@gmail.com> wrote:
>
> >> > Hello, I want to make the below codes let users update their status in
> >> > the Django . And their update should display on the same template. But
> >> > it’s not working.  E.g when a user type in “To be a hacker is not a
> >> > day’s job” in the status textarea and click on update button below the
> >> > form. The update should display on the same template for his or her
> >> > friends to see. Just like how we post status update on fb.
>
> >> > In models.py
> >> > from django.contrib.auth.models import User
> >> > from django.forms import ModelForm, Textarea, HiddenInput
> >> > from django.db import models
>
> >> >     class mob (models.Model):
> >> >     username=models.ForeignKey(User, unique=True)
> >> >     state_province=models.CharField(max_length=50)
> >> >     body=models.TextField(max_length=1)
> >> >     date=models.DateTimeField()
>
> >> >     def __unicode__(self):
> >> >         return u"%s - %s - %s - %s" % (self.username,
> >> > self.state_province, self.body,   self.date)
>
> >> >     def get_absolute_url(self):
> >> >         return "/post/%s/" % unicode(self.id)
> >> >     def get_author_url(self):
> >> >         return "/u/%s/p/0" % (self.username)
>
> >> >     class mobForm(ModelForm):
> >> >     class Meta:
> >> >         model=mob
> >> >         fields=('body','username','state_province','date')
> >> >         widgets={
> >> >             'body':Textarea(attrs={"rows":2, "cols":40}),
> >> >             'username': (HiddenInput),
> >> >             'state_province': (HiddenInput),
> >> >             'date':(HiddenInput),
> >> >         }
>
> >> > In views.py
> >> > from myweb.meekapp.models import mobForm, mob
> >> > from django.shortcuts import render_to_response
> >> > from django.contrib.auth.models import User
> >> > from django.http import HttpResponse, Http404
> >> > from django.template import RequestContext
> >> > from django.http import HttpResponseRedirect
>
> >> >     def homey(request):
> >> >  #if there’s nothing in the field do nothing.
> >> >     if request. method != "":
> >> >         return HttpResponseRedirect('/homi/')
>
> >> >     newmob=mob()
> >> >     newmob.username=request.user
> >> >     newmob.date=datetime.datetime.now()
> >> >     newmob.body=request.POST['body']
> >> >     if request.POST['body'] <> '':
> >> >         newmob.body=body.objects.get(id=request.POST['body'])
> >> >         newmob.save()
> >> >         return HttpResponseRedirect('/homi/')
> >> >     else:
> >> >         return render_to_response('meek_home.html', {'mobForm':
> >> > mobForm },context_instance=RequestContext(request))
>
> >> > in template
>
> >> >     {% extends "base_meek.html" %}
> >> >           {% block body %}
> >> >        
> >> >    
> >> >      
> >> >            {{ mobForm }}
> >> >      
> >> >      
> >> >    
> >> >        {% endblock %}
>
> >> > What am I doing wrong? Would love to hear your opinion.
>
> >> > --
> >> > You received this message because you are subscribed to the Google Groups
> >> > "Django users" group.
> >> > To post to this group, send email to django-users@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> > django-users+unsubscr...@googlegroups.com.
> >> > For more options, visit this group at
> >> >http://groups.google.com/group/django-users?hl=en.
>
> >> --
> >> Sent from my mobile device
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Mvh/Best regards,
> Thomas Weholthttp://www.weholt.org

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Finding It Hard To Make It Work!

2012-02-08 Thread coded kid
How bro? Don't know Ajax. Can you please put me through? I'm a
Nigerian bro!

On Feb 8, 10:02 am, Babatunde Akinyanmi <tundeba...@gmail.com> wrote:
> Use AJAX or asynchronous programming
>
> On 2/8/12, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hello, I want to make the below codes let users update their status in
> > the Django . And their update should display on the same template. But
> > it’s not working.  E.g when a user type in “To be a hacker is not a
> > day’s job” in the status textarea and click on update button below the
> > form. The update should display on the same template for his or her
> > friends to see. Just like how we post status update on fb.
>
> > In models.py
> > from django.contrib.auth.models import User
> > from django.forms import ModelForm, Textarea, HiddenInput
> > from django.db import models
>
> >     class mob (models.Model):
> >     username=models.ForeignKey(User, unique=True)
> >     state_province=models.CharField(max_length=50)
> >     body=models.TextField(max_length=1)
> >     date=models.DateTimeField()
>
> >     def __unicode__(self):
> >         return u"%s - %s - %s - %s" % (self.username,
> > self.state_province, self.body,   self.date)
>
> >     def get_absolute_url(self):
> >         return "/post/%s/" % unicode(self.id)
> >     def get_author_url(self):
> >         return "/u/%s/p/0" % (self.username)
>
> >     class mobForm(ModelForm):
> >     class Meta:
> >         model=mob
> >         fields=('body','username','state_province','date')
> >         widgets={
> >             'body':Textarea(attrs={"rows":2, "cols":40}),
> >             'username': (HiddenInput),
> >             'state_province': (HiddenInput),
> >             'date':(HiddenInput),
> >         }
>
> > In views.py
> > from myweb.meekapp.models import mobForm, mob
> > from django.shortcuts import render_to_response
> > from django.contrib.auth.models import User
> > from django.http import HttpResponse, Http404
> > from django.template import RequestContext
> > from django.http import HttpResponseRedirect
>
> >     def homey(request):
> >  #if there’s nothing in the field do nothing.
> >     if request. method != "":
> >         return HttpResponseRedirect('/homi/')
>
> >     newmob=mob()
> >     newmob.username=request.user
> >     newmob.date=datetime.datetime.now()
> >     newmob.body=request.POST['body']
> >     if request.POST['body'] <> '':
> >         newmob.body=body.objects.get(id=request.POST['body'])
> >         newmob.save()
> >         return HttpResponseRedirect('/homi/')
> >     else:
> >         return render_to_response('meek_home.html', {'mobForm':
> > mobForm },context_instance=RequestContext(request))
>
> > in template
>
> >     {% extends "base_meek.html" %}
> >           {% block body %}
> >        
> >    
> >      
> >            {{ mobForm }}
> >      
> >      
> >    
> >        {% endblock %}
>
> > What am I doing wrong? Would love to hear your opinion.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Sent from my mobile device

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Somebody please attend to me

2012-02-07 Thread coded kid
What I really mean is that I want users to post update and make other
users comment on them in django site. Not to Facebook.

On Feb 7, 12:24 pm, coded kid <duffleboi...@gmail.com> wrote:
> The first link take me to google page. Is that the post?
>
> On Feb 7, 11:22 am, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Thanks so much kelly! You rock. Will give it a try!
>
> > On Feb 7, 4:18 am, Kelly Nicholes <kelbolici...@gmail.com> wrote:
>
> > > This is link holds the PERFECT answer for you:http://bit.ly/wc0psc
>
> > > If you want to do it differently, try:
>
> > > First you'll have to send an XMLHttpRequest (jQuery post() or get())
> > > to your server to post a form (create a modelform with a "Comment"
> > > model with all of the required fields.  You might want to look into
> > > generic content types for django models).  Save the comment out
> > > (associate it with the user from the request) in your view.  Then add
> > > a link to do a comment (if you want you can do fancy html5 stuff with
> > > the "editable" property on some div).  The click the link, dynamically
> > > (use jquery) to show another form (or create it if you'd like).  When
> > > they submit the friend comment, associate that friend comment with the
> > > original comment (you could parse this out of the ID attribute that
> > > you could set on the original comment) and save it just as you did the
> > > first...  Or just look for premade things...
>
> > > You could look into django's built-in comment 
> > > systemhttps://docs.djangoproject.com/en/1.2/ref/contrib/comments/example/
> > > Here's one called 
> > > django-facebook-commentshttps://bitbucket.org/sirpengi/django-facebook-comments
>
> > > On Jan 23, 4:38 am, coded kid <duffleboi...@gmail.com> wrote:
>
> > > >  Please how can I get user post update, make their friends comment and
> > > > share the update in django? Just like the way FB update is. I hope you
> > > > get my point?  Thanks so much

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: No Module named URLS

2012-02-07 Thread coded kid
Thank so much! I've figured it out. Have fun :)

On Feb 6, 8:55 pm, Sandro Dutra <hexo...@gmail.com> wrote:
> If I understand you're writing a template for admin, and this is not
> required 'cause the admin template is called by the contrib
> 'django.contrib.admin', in INSTALLED_APPS (settings file), only if you
> want to customize admin, you can override the admin files, putting
> them o 'yourtemplatesdir/admin/', and I think this is not the case.
>
> The only required steps to see the admin page is:
> 1. Check if 'django.contrib.admin' is uncommented in 'settings.py';
> 2. Uncomment the required lines in file 'urls.py';
> 3. Launch the dev server and acess localhost/admin/.
>
> Only this, nothing more...
>
> Templates.py? Templates can have any extension, this is true, but
> usually we put .html or .htm...
>
> 2012/2/6 akaariai <akaar...@gmail.com>:
>
>
>
>
>
>
>
> > On Feb 6, 5:09 pm, coded kid <duffleboi...@gmail.com> wrote:
> >> Hey guys, I’m getting an error when trying to visit my admin page:
> >> TemplateSyntaxError at /admin/
> >> Caught ImportError while rendering: No module named urls
>
> >> In urls.py
> >> from django.conf.urls.defaults import patterns, include, url
> >> from django.contrib import admin
> >> admin.autodiscover()
>
> >> urlpatterns = patterns('',
> >> (r'^admin/',include(admin.site.urls)),
> >> )
>
> >> In Template.py
>
> >>    
> >> {% block branding %}{% endblock %}
> >>   {% if user.is_active and user.is_staff %}
> >>    {% trans 'Welcome,' %}  {% filter
> >> force_escape %}{% firstof user.first_name user.username %}{% endfilter
> >> %}.
> >>  {% block userlinks %} {% url 'django-admindocs-docroot' as docsroot
> >> %}  {% if docsroot %}  {% trans
> >> 'Documentation' %} {% endif %}  {% url 'admin:password_change' as
> >> password_change_url %}  {% if password_change_url %} 37  >> href="{{ password_change_url }}">  {% else %}   40 {% endif %} 41 {% trans 'Change password' %} >> a> /
>
> >> What do you think is the problem! I’ve been fighting with this for the
> >> pas 15hrs yet no success. Kindly help me out!
>
> > I don't spot any immediate reason for your problem. Some more
> > information is needed. A full stacktrace is always really good if you
> > happen to get one. Maybe the problem is in your admin.py. As said, it
> > is hard to say without more information.
>
> >  - Anssi
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Somebody please attend to me

2012-02-07 Thread coded kid
The first link take me to google page. Is that the post?

On Feb 7, 11:22 am, coded kid <duffleboi...@gmail.com> wrote:
> Thanks so much kelly! You rock. Will give it a try!
>
> On Feb 7, 4:18 am, Kelly Nicholes <kelbolici...@gmail.com> wrote:
>
>
>
> > This is link holds the PERFECT answer for you:http://bit.ly/wc0psc
>
> > If you want to do it differently, try:
>
> > First you'll have to send an XMLHttpRequest (jQuery post() or get())
> > to your server to post a form (create a modelform with a "Comment"
> > model with all of the required fields.  You might want to look into
> > generic content types for django models).  Save the comment out
> > (associate it with the user from the request) in your view.  Then add
> > a link to do a comment (if you want you can do fancy html5 stuff with
> > the "editable" property on some div).  The click the link, dynamically
> > (use jquery) to show another form (or create it if you'd like).  When
> > they submit the friend comment, associate that friend comment with the
> > original comment (you could parse this out of the ID attribute that
> > you could set on the original comment) and save it just as you did the
> > first...  Or just look for premade things...
>
> > You could look into django's built-in comment 
> > systemhttps://docs.djangoproject.com/en/1.2/ref/contrib/comments/example/
> > Here's one called 
> > django-facebook-commentshttps://bitbucket.org/sirpengi/django-facebook-comments
>
> > On Jan 23, 4:38 am, coded kid <duffleboi...@gmail.com> wrote:
>
> > >  Please how can I get user post update, make their friends comment and
> > > share the update in django? Just like the way FB update is. I hope you
> > > get my point?  Thanks so much

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Somebody please attend to me

2012-02-07 Thread coded kid

Thanks so much kelly! You rock. Will give it a try!

On Feb 7, 4:18 am, Kelly Nicholes <kelbolici...@gmail.com> wrote:
> This is link holds the PERFECT answer for you:http://bit.ly/wc0psc
>
> If you want to do it differently, try:
>
> First you'll have to send an XMLHttpRequest (jQuery post() or get())
> to your server to post a form (create a modelform with a "Comment"
> model with all of the required fields.  You might want to look into
> generic content types for django models).  Save the comment out
> (associate it with the user from the request) in your view.  Then add
> a link to do a comment (if you want you can do fancy html5 stuff with
> the "editable" property on some div).  The click the link, dynamically
> (use jquery) to show another form (or create it if you'd like).  When
> they submit the friend comment, associate that friend comment with the
> original comment (you could parse this out of the ID attribute that
> you could set on the original comment) and save it just as you did the
> first...  Or just look for premade things...
>
> You could look into django's built-in comment 
> systemhttps://docs.djangoproject.com/en/1.2/ref/contrib/comments/example/
> Here's one called 
> django-facebook-commentshttps://bitbucket.org/sirpengi/django-facebook-comments
>
> On Jan 23, 4:38 am, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
> >  Please how can I get user post update, make their friends comment and
> > share the update in django? Just like the way FB update is. I hope you
> > get my point?  Thanks so much

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django-Simple-Friends

2012-02-05 Thread coded kid
Hey guys, please how can I go about creating templates for django
simple friends? I've been trying my best, yet no success. Really need
your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help Me With omab/django-socialauth

2012-02-05 Thread coded kid
Okay, will try it. Thanks man!

Matías Aguirre wrote:
> I was just talking about the hyphen in the app name.
>
> Now you need a view on that URL, try a view that renders a template similar to
> this one 
> https://github.com/omab/django-social-auth/blob/master/example/templates/error.html
> that should show the error you have, possible an app misconfiguration.
>
> Regards,
> Matías
>
> Excerpts from coded kid's message of 2012-02-04 20:12:01 -0200:
> > What hypen are you talking about? I've set all the three logins again.
> > And after trying it, I was redirected to '/login-error/' Any
> > suggestion? Thanks.
> >
> > On Feb 4, 2:55 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> > > Don't use /login/twitter/ as your LOGIN_URL, the reason behind LOGIN_URL 
> > > is to
> > > provide a user with a page where it can trigger the login process using a 
> > > login
> > > form on links in the case of django-social-auth.
> > >
> > > But if you define its value to /login/twitter/ that will trigger the login
> > > process automatically, and if there's an error in the process
> > > django-social-auth will redirect to LOGIN_URL too (unless LOGIN_ERROR_URL 
> > > is
> > > defined), and that will trigger the login process again and that might be 
> > > the
> > > reason for your loop.
> > >
> > > Regards,
> > > Matías
> > >
> > > Excerpts from coded kid's message of 2012-02-04 12:35:23 -0200:
> > >
> > >
> > >
> > > > I've added it, yet no success! I changed my LOGIN_URL to '/login/
> > > > twitter/' I'm getting "redirect loop" it means it can't redirect to
> > > > the url properly! any help with that?
> > >
> > > > On Feb 3, 4:14 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> > > > > Django-social-auth (note the hyphen ;)) uses LOGIN_URL as the URL to 
> > > > > redirect
> > > > > in case of errors if LOGIN_ERROR_URL is not defined, you might be 
> > > > > getting an
> > > > > error and being redirected to your LOGIN_URL and as your value is
> > > > > /login/twitter/ you are restarting the process again.
> > >
> > > > > Another possible flaw is your SOCIAL_AUTH_ENABLED_BACKENDS = 
> > > > > ('twitter')
> > > > > you should add a comma after the value or it won't be a valid tuple, 
> > > > > like this:
> > >
> > > > >     SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter',)
> > >
> > > > > Regards,
> > > > > Matías
> > >
> > > > > Excerpts from coded kid's message of 2012-02-03 12:57:57 -0200:
> > >
> > > > > > Yes, I've tried it. What's the main url you guys put in your
> > > > > > LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
> > > > > > is.
> > >
> > > > > > On Feb 3, 10:46 am, Kevin <kveron...@gmail.com> wrote:
> > > > > > > Did you take a look at the example project?
> > >
> > > > > > >https://github.com/omab/django-social-auth/tree/master/example
> > >
> > > > > > > Compare it with your own project, or even use this example 
> > > > > > > project as
> > > > > > > a base for your own project.
> > >
> > > > > > > If all your urls.py contains is "url(r'',
> > > > > > > include('social_auth.urls')), " and no other definitions, this 
> > > > > > > could
> > > > > > > be why it redirecting, as it cannot find the URL it's suppose to 
> > > > > > > land
> > > > > > > on.  Check the output in the Windows command window and see what 
> > > > > > > URLs
> > > > > > > are being requested and see if there's anything odd.
> > >
> > > > > > > On Feb 3, 2:12 am, coded kid <duffleboi...@gmail.com> wrote:
> > >
> > > > > > > > Just keep getting redirect error. My Api keys are correct. Do 
> > > > > > > > you use
> > > > > > > > the same LOGIN URL with the one above? Whats the main login url 
> > > > > > > > to
> > > > > > > > twitter auth form?
> > >
> > > > > > > > On Feb 2, 5:23 pm, Thorsten Sanders <thorsten.sand...

Re: Django Friends

2012-02-05 Thread coded kid
The app is not well maintained. And no docs in it. Do you know how I
can go about it?

On Feb 5, 9:56 am, Anoop Thomas Mathew <atm...@gmail.com> wrote:
> Hi,
> Pinax is a collection of reusable django apps, and you an use individual
> projects as django apps.https://github.com/pinax/django-friends
> Another issue I found is, it is not maintained well and make sure that it
> suits your purpose and works well with latest version of django. Then you
> can directly use it as an app adding it to your settings.py
>
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.
>
> On 5 February 2012 15:18, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
> > Thanks bro. I'm not using pinax, so how can I go about it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Friends

2012-02-05 Thread coded kid
Thanks bro. I'm not using pinax, so how can I go about it?

On Feb 5, 8:47 am, Anoop Thomas Mathew <atm...@gmail.com> wrote:
> Hi,
>
> Check pinax project. There are some apps in 
> it,http://pinaxproject.com/ecosystem/
> ,  especially, django-friends app, which should be helpful for you.
> Thanks,
> Anoop Thomas Mathew
>
> atm
> ___
> Life is short, Live it hard.
>
> On 5 February 2012 14:12, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
> > Hey guys, please do you know of any django package that can be used by
> > users to add friends in django site? Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Django Friends

2012-02-05 Thread coded kid
Hey guys, please do you know of any django package that can be used by
users to add friends in django site? Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: I need a package.

2012-02-04 Thread coded kid
Thanks so much! Any idea on how I can make user_messages/
thread_detail.html work? Just give me an idea on how to go about the
template.

On Feb 3, 8:17 am, Donald Stufft <donald.stu...@gmail.com> wrote:
> https://github.com/eldarion/user_messages
>
>
>
> On Friday, February 3, 2012 at 3:16 AM, coded kid wrote:
> > Anyone knows about a django package that can be use by users to send
> > private messages to each other?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help Me With omab/django-socialauth

2012-02-04 Thread coded kid
What hypen are you talking about? I've set all the three logins again.
And after trying it, I was redirected to '/login-error/' Any
suggestion? Thanks.

On Feb 4, 2:55 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> Don't use /login/twitter/ as your LOGIN_URL, the reason behind LOGIN_URL is to
> provide a user with a page where it can trigger the login process using a 
> login
> form on links in the case of django-social-auth.
>
> But if you define its value to /login/twitter/ that will trigger the login
> process automatically, and if there's an error in the process
> django-social-auth will redirect to LOGIN_URL too (unless LOGIN_ERROR_URL is
> defined), and that will trigger the login process again and that might be the
> reason for your loop.
>
> Regards,
> Matías
>
> Excerpts from coded kid's message of 2012-02-04 12:35:23 -0200:
>
>
>
> > I've added it, yet no success! I changed my LOGIN_URL to '/login/
> > twitter/' I'm getting "redirect loop" it means it can't redirect to
> > the url properly! any help with that?
>
> > On Feb 3, 4:14 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> > > Django-social-auth (note the hyphen ;)) uses LOGIN_URL as the URL to 
> > > redirect
> > > in case of errors if LOGIN_ERROR_URL is not defined, you might be getting 
> > > an
> > > error and being redirected to your LOGIN_URL and as your value is
> > > /login/twitter/ you are restarting the process again.
>
> > > Another possible flaw is your SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > you should add a comma after the value or it won't be a valid tuple, like 
> > > this:
>
> > >     SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter',)
>
> > > Regards,
> > > Matías
>
> > > Excerpts from coded kid's message of 2012-02-03 12:57:57 -0200:
>
> > > > Yes, I've tried it. What's the main url you guys put in your
> > > > LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
> > > > is.
>
> > > > On Feb 3, 10:46 am, Kevin <kveron...@gmail.com> wrote:
> > > > > Did you take a look at the example project?
>
> > > > >https://github.com/omab/django-social-auth/tree/master/example
>
> > > > > Compare it with your own project, or even use this example project as
> > > > > a base for your own project.
>
> > > > > If all your urls.py contains is "url(r'',
> > > > > include('social_auth.urls')), " and no other definitions, this could
> > > > > be why it redirecting, as it cannot find the URL it's suppose to land
> > > > > on.  Check the output in the Windows command window and see what URLs
> > > > > are being requested and see if there's anything odd.
>
> > > > > On Feb 3, 2:12 am, coded kid <duffleboi...@gmail.com> wrote:
>
> > > > > > Just keep getting redirect error. My Api keys are correct. Do you 
> > > > > > use
> > > > > > the same LOGIN URL with the one above? Whats the main login url to
> > > > > > twitter auth form?
>
> > > > > > On Feb 2, 5:23 pm, Thorsten Sanders <thorsten.sand...@gmx.net> 
> > > > > > wrote:
>
> > > > > > > I took your config and its working fine, maybe your twitter api 
> > > > > > > key is
> > > > > > > wrong?
>
> > > > > > > On 02.02.2012 11:22, coded kid wrote:
>
> > > > > > > > I'm getting a redirect loop error. Whats the probs?
>
> > > > > > > > On Feb 1, 1:22 pm, Thorsten Sanders<thorsten.sand...@gmx.net>  
> > > > > > > > wrote:
> > > > > > > >> Some sort of error traceback/description would be helpful, 
> > > > > > > >> from a quick
> > > > > > > >> look it seems all right.
>
> > > > > > > >> On 01.02.2012 13:23, coded kid wrote:
>
> > > > > > > >>> Hey guys, I'm facing a huge  problem with 
> > > > > > > >>> omab/django/socialauth.
> > > > > > > >>> After setting all the necessary settings, I clicked on the 
> > > > > > > >>> Enter
> > > > > > > >>> using Twitter link on my homepage, it couldn t redirect me to 
> > > > > > > >>> where I
> > > > > > > >>> will enter m

Re: Help Me With omab/django-socialauth

2012-02-04 Thread coded kid
I've added it, yet no success! I changed my LOGIN_URL to '/login/
twitter/' I'm getting "redirect loop" it means it can't redirect to
the url properly! any help with that?

On Feb 3, 4:14 pm, Matías Aguirre <matiasagui...@gmail.com> wrote:
> Django-social-auth (note the hyphen ;)) uses LOGIN_URL as the URL to redirect
> in case of errors if LOGIN_ERROR_URL is not defined, you might be getting an
> error and being redirected to your LOGIN_URL and as your value is
> /login/twitter/ you are restarting the process again.
>
> Another possible flaw is your SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> you should add a comma after the value or it won't be a valid tuple, like 
> this:
>
>     SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter',)
>
> Regards,
> Matías
>
> Excerpts from coded kid's message of 2012-02-03 12:57:57 -0200:
>
>
>
>
>
>
>
> > Yes, I've tried it. What's the main url you guys put in your
> > LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
> > is.
>
> > On Feb 3, 10:46 am, Kevin <kveron...@gmail.com> wrote:
> > > Did you take a look at the example project?
>
> > >https://github.com/omab/django-social-auth/tree/master/example
>
> > > Compare it with your own project, or even use this example project as
> > > a base for your own project.
>
> > > If all your urls.py contains is "url(r'',
> > > include('social_auth.urls')), " and no other definitions, this could
> > > be why it redirecting, as it cannot find the URL it's suppose to land
> > > on.  Check the output in the Windows command window and see what URLs
> > > are being requested and see if there's anything odd.
>
> > > On Feb 3, 2:12 am, coded kid <duffleboi...@gmail.com> wrote:
>
> > > > Just keep getting redirect error. My Api keys are correct. Do you use
> > > > the same LOGIN URL with the one above? Whats the main login url to
> > > > twitter auth form?
>
> > > > On Feb 2, 5:23 pm, Thorsten Sanders <thorsten.sand...@gmx.net> wrote:
>
> > > > > I took your config and its working fine, maybe your twitter api key is
> > > > > wrong?
>
> > > > > On 02.02.2012 11:22, coded kid wrote:
>
> > > > > > I'm getting a redirect loop error. Whats the probs?
>
> > > > > > On Feb 1, 1:22 pm, Thorsten Sanders<thorsten.sand...@gmx.net>  
> > > > > > wrote:
> > > > > >> Some sort of error traceback/description would be helpful, from a 
> > > > > >> quick
> > > > > >> look it seems all right.
>
> > > > > >> On 01.02.2012 13:23, coded kid wrote:
>
> > > > > >>> Hey guys, I'm facing a huge  problem with omab/django/socialauth.
> > > > > >>> After setting all the necessary settings, I clicked on the Enter
> > > > > >>> using Twitter link on my homepage, it couldn t redirect me to 
> > > > > >>> where I
> > > > > >>> will enter my twitter username and password. Below are my 
> > > > > >>> settings.
> > > > > >>> In settings.py
> > > > > >>> INSTALLED_APPS = (
> > > > > >>> 'social_auth',
> > > > > >>> }
> > > > > >>> TEMPLATE_CONTEXT_PROCESSORS = (
> > > > > >>>      "django.core.context_processors.auth",
> > > > > >>>      "django.core.context_processors.debug",
> > > > > >>>      "django.core.context_processors.i18n",
> > > > > >>>      "django.core.context_processors.media",
> > > > > >>>      "django.core.context_processors.static",
> > > > > >>>     "django.contrib.messages.context_processors.messages",
> > > > > >>>     "django.core.context_processors.request",
> > > > > >>>      social_auth.context_processors.social_auth_by_type_backends ,
> > > > > >>> )
> > > > > >>> AUTHENTICATION_BACKENDS = (
> > > > > >>>      'social_auth.backends.twitter.TwitterBackend',
> > > > > >>>     'django.contrib.auth.backends.ModelBackend',
> > > > > >>> )
> > > > > >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > > > >>> TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> 

Re: Help Me With omab/django-socialauth

2012-02-03 Thread coded kid
Yes, I've tried it. What's the main url you guys put in your
LOGIN_URL? Because mine is '/login/twitter/' thats where the problem
is.

On Feb 3, 10:46 am, Kevin <kveron...@gmail.com> wrote:
> Did you take a look at the example project?
>
> https://github.com/omab/django-social-auth/tree/master/example
>
> Compare it with your own project, or even use this example project as
> a base for your own project.
>
> If all your urls.py contains is "url(r'',
> include('social_auth.urls')), " and no other definitions, this could
> be why it redirecting, as it cannot find the URL it's suppose to land
> on.  Check the output in the Windows command window and see what URLs
> are being requested and see if there's anything odd.
>
> On Feb 3, 2:12 am, coded kid <duffleboi...@gmail.com> wrote:
>
>
>
> > Just keep getting redirect error. My Api keys are correct. Do you use
> > the same LOGIN URL with the one above? Whats the main login url to
> > twitter auth form?
>
> > On Feb 2, 5:23 pm, Thorsten Sanders <thorsten.sand...@gmx.net> wrote:
>
> > > I took your config and its working fine, maybe your twitter api key is
> > > wrong?
>
> > > On 02.02.2012 11:22, coded kid wrote:
>
> > > > I'm getting a redirect loop error. Whats the probs?
>
> > > > On Feb 1, 1:22 pm, Thorsten Sanders<thorsten.sand...@gmx.net>  wrote:
> > > >> Some sort of error traceback/description would be helpful, from a quick
> > > >> look it seems all right.
>
> > > >> On 01.02.2012 13:23, coded kid wrote:
>
> > > >>> Hey guys, I'm facing a huge  problem with omab/django/socialauth.
> > > >>> After setting all the necessary settings, I clicked on the Enter
> > > >>> using Twitter link on my homepage, it couldn t redirect me to where I
> > > >>> will enter my twitter username and password. Below are my settings.
> > > >>> In settings.py
> > > >>> INSTALLED_APPS = (
> > > >>> 'social_auth',
> > > >>> }
> > > >>> TEMPLATE_CONTEXT_PROCESSORS = (
> > > >>>      "django.core.context_processors.auth",
> > > >>>      "django.core.context_processors.debug",
> > > >>>      "django.core.context_processors.i18n",
> > > >>>      "django.core.context_processors.media",
> > > >>>      "django.core.context_processors.static",
> > > >>>     "django.contrib.messages.context_processors.messages",
> > > >>>     "django.core.context_processors.request",
> > > >>>      social_auth.context_processors.social_auth_by_type_backends ,
> > > >>> )
> > > >>> AUTHENTICATION_BACKENDS = (
> > > >>>      'social_auth.backends.twitter.TwitterBackend',
> > > >>>     'django.contrib.auth.backends.ModelBackend',
> > > >>> )
> > > >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> > > >>> TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> > > >>> TWITTER_CONSUMER_SECRET      = 'YyNngsgw[1jw lcllcleleedfejewjuw'
> > > >>> LOGIN_URL = '/accounts/login/' #login form for users to log in with
> > > >>> their username and password!
> > > >>> SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
> > > >>> authenticated
> > > >>> SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/homi/'   '  #page after
> > > >>> user get authenticated
> > > >>> SOCIAL_AUTH_ERROR_KEY='social_errors'
> > > >>> SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
> > > >>> SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
> > > >>> from django.template.defaultfilters import slugify
> > > >>> SOCIAL_AUTH_USERNAME_FIXER = lambda u: slugify(u)
> > > >>> SOCIAL_AUTH_UUID_LENGTH = 16
> > > >>> SOCIAL_AUTH_EXTRA_DATA = False
> > > >>> In urls.py
> > > >>> url(r'', include('social_auth.urls')),
> > > >>> In my template:
> > > >>> 
> > > >>>    Enter using 
> > > >>> Twitter > > >>> a>
> > > >>>    
> > > >>> 
> > > >>> What do you think I m doing wrong? Hope to hear from you soon. Thanks
> > > >>> so much!
> > > >>> N:B : I m coding on windows machine. And in the development
> > > >>> environment using localhost:8000.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



I need a package.

2012-02-03 Thread coded kid
Anyone knows about a django package that can be use by users to send
private messages to each other?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help Me With omab/django-socialauth

2012-02-03 Thread coded kid
Just keep getting redirect error. My Api keys are correct. Do you use
the same LOGIN URL with the one above? Whats the main login url to
twitter auth form?

On Feb 2, 5:23 pm, Thorsten Sanders <thorsten.sand...@gmx.net> wrote:
> I took your config and its working fine, maybe your twitter api key is
> wrong?
>
> On 02.02.2012 11:22, coded kid wrote:
>
>
>
> > I'm getting a redirect loop error. Whats the probs?
>
> > On Feb 1, 1:22 pm, Thorsten Sanders<thorsten.sand...@gmx.net>  wrote:
> >> Some sort of error traceback/description would be helpful, from a quick
> >> look it seems all right.
>
> >> On 01.02.2012 13:23, coded kid wrote:
>
> >>> Hey guys, I'm facing a huge  problem with omab/django/socialauth.
> >>> After setting all the necessary settings, I clicked on the Enter
> >>> using Twitter link on my homepage, it couldn t redirect me to where I
> >>> will enter my twitter username and password. Below are my settings.
> >>> In settings.py
> >>> INSTALLED_APPS = (
> >>> 'social_auth',
> >>> }
> >>> TEMPLATE_CONTEXT_PROCESSORS = (
> >>>      "django.core.context_processors.auth",
> >>>      "django.core.context_processors.debug",
> >>>      "django.core.context_processors.i18n",
> >>>      "django.core.context_processors.media",
> >>>      "django.core.context_processors.static",
> >>>     "django.contrib.messages.context_processors.messages",
> >>>     "django.core.context_processors.request",
> >>>      social_auth.context_processors.social_auth_by_type_backends ,
> >>> )
> >>> AUTHENTICATION_BACKENDS = (
> >>>      'social_auth.backends.twitter.TwitterBackend',
> >>>     'django.contrib.auth.backends.ModelBackend',
> >>> )
> >>> SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
> >>> TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> >>> TWITTER_CONSUMER_SECRET      = 'YyNngsgw[1jw lcllcleleedfejewjuw'
> >>> LOGIN_URL = '/accounts/login/' #login form for users to log in with
> >>> their username and password!
> >>> SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
> >>> authenticated
> >>> SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/homi/'   '  #page after
> >>> user get authenticated
> >>> SOCIAL_AUTH_ERROR_KEY='social_errors'
> >>> SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
> >>> SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
> >>> from django.template.defaultfilters import slugify
> >>> SOCIAL_AUTH_USERNAME_FIXER = lambda u: slugify(u)
> >>> SOCIAL_AUTH_UUID_LENGTH = 16
> >>> SOCIAL_AUTH_EXTRA_DATA = False
> >>> In urls.py
> >>> url(r'', include('social_auth.urls')),
> >>> In my template:
> >>> 
> >>>    Enter using Twitter >>> a>
> >>>    
> >>> 
> >>> What do you think I m doing wrong? Hope to hear from you soon. Thanks
> >>> so much!
> >>> N:B : I m coding on windows machine. And in the development
> >>> environment using localhost:8000.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Help Me With omab/django-socialauth

2012-02-02 Thread coded kid
I'm getting a redirect loop error. Whats the probs?

On Feb 1, 1:22 pm, Thorsten Sanders <thorsten.sand...@gmx.net> wrote:
> Some sort of error traceback/description would be helpful, from a quick
> look it seems all right.
>
> On 01.02.2012 13:23, coded kid wrote:
>
>
>
> > Hey guys, I'm facing a huge  problem with omab/django/socialauth.
>
> > After setting all the necessary settings, I clicked on the Enter
> > using Twitter link on my homepage, it couldn t redirect me to where I
> > will enter my twitter username and password. Below are my settings.
> > In settings.py
>
> > INSTALLED_APPS = (
> > 'social_auth',
> > }
>
> > TEMPLATE_CONTEXT_PROCESSORS = (
> >     "django.core.context_processors.auth",
> >     "django.core.context_processors.debug",
> >     "django.core.context_processors.i18n",
> >     "django.core.context_processors.media",
> >     "django.core.context_processors.static",
> >    "django.contrib.messages.context_processors.messages",
> >    "django.core.context_processors.request",
> >     social_auth.context_processors.social_auth_by_type_backends ,
>
> > )
> > AUTHENTICATION_BACKENDS = (
> >     'social_auth.backends.twitter.TwitterBackend',
> >    'django.contrib.auth.backends.ModelBackend',
> > )
>
> > SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')
>
> > TWITTER_CONSUMER_KEY         = '0hdgdhsnmzHDGDK'
> > TWITTER_CONSUMER_SECRET      = 'YyNngsgw[1jw lcllcleleedfejewjuw'
>
> > LOGIN_URL = '/accounts/login/' #login form for users to log in with
> > their username and password!
> > SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
> > authenticated
> > SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/homi/'   '  #page after
> > user get authenticated
> > SOCIAL_AUTH_ERROR_KEY='social_errors'
>
> > SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
> > SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
>
> > from django.template.defaultfilters import slugify
> > SOCIAL_AUTH_USERNAME_FIXER = lambda u: slugify(u)
> > SOCIAL_AUTH_UUID_LENGTH = 16
> > SOCIAL_AUTH_EXTRA_DATA = False
>
> > In urls.py
> > url(r'', include('social_auth.urls')),
>
> > In my template:
> > 
> >   Enter using Twitter > a>
> >   
> > 
> > What do you think I m doing wrong? Hope to hear from you soon. Thanks
> > so much!
> > N:B : I m coding on windows machine. And in the development
> > environment using localhost:8000.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help Me With omab/django-socialauth

2012-02-01 Thread coded kid
Hey guys, I'm facing a huge  problem with omab/django/socialauth.

After setting all the necessary settings, I clicked on the “Enter
using Twitter” link on my homepage, it couldn’t redirect me to where I
will enter my twitter username and password. Below are my settings.
In settings.py

INSTALLED_APPS = (
'social_auth',
}

TEMPLATE_CONTEXT_PROCESSORS = (
   "django.core.context_processors.auth",
   "django.core.context_processors.debug",
   "django.core.context_processors.i18n",
   "django.core.context_processors.media",
   "django.core.context_processors.static",
  "django.contrib.messages.context_processors.messages",
  "django.core.context_processors.request",
  “social_auth.context_processors.social_auth_by_type_backends”,

)
AUTHENTICATION_BACKENDS = (
   'social_auth.backends.twitter.TwitterBackend',
  'django.contrib.auth.backends.ModelBackend',
)

SOCIAL_AUTH_ENABLED_BACKENDS = ('twitter')

TWITTER_CONSUMER_KEY = '0hdgdhsnmzHDGDK'
TWITTER_CONSUMER_SECRET  = 'YyNngsgw[1jw lcllcleleedfejewjuw'

LOGIN_URL = '/accounts/login/' #login form for users to log in with
their username and password!
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/homi/'  #page after user get
authenticated
SOCIAL_AUTH_NEW_ASSOCIATION_REDIRECT_URL = '/homi/'   '  #page after
user get authenticated
SOCIAL_AUTH_ERROR_KEY='social_errors'

SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'

from django.template.defaultfilters import slugify
SOCIAL_AUTH_USERNAME_FIXER = lambda u: slugify(u)
SOCIAL_AUTH_UUID_LENGTH = 16
SOCIAL_AUTH_EXTRA_DATA = False

In urls.py
url(r'', include('social_auth.urls')),

In my template:

 Enter using Twitter
 

What do you think I’m doing wrong? Hope to hear from you soon. Thanks
so much!
N:B : I’m coding on windows machine. And in the development
environment using localhost:8000.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django docs __unicode__ return u'%s %s

2012-01-27 Thread coded kid
Hey Petr, thats what I'm trying to say. Just that I didnt construct my
sentences well. Thanks.

JohnA wrote:
> Just to fill in some more info,  __unicode__  methods are also part of
> core python and just happen to appear a lot in django code because of
> its preference for 16-bit unicode strings (though I think the methods
> are actually mostly invoked in the admin).  There is also a __str__
> function for “ordinary” (8 bit potentially mbcs) strings.  (This is
> Python 2.x; Python 3.x is somewhat different.)
>
> User-defined __unicode__ methods are overrides of builtin methods that
> all objects are guaranteed to have.  As the __...__ in the name
> suggests, these methods are called implicitly in certain kinds of
> expressions.  Two cases I know of in Python 2.7 are expressions of
> form unicode(obj) and expressions of form u’...%s...’ % obj (and I
> assume other format expression tyopes where the format string is
> unicode).  In both, obj is converted to a unicode string using
> whatever __unicode__ method is defined for the object.
>
>
> On Jan 24, 6:04 pm, Krondaj  wrote:
> > Hi,
> >
> > in the django docs about __unicode__  it says the following:
> >
> > class Person(models.Model):
> >     first_name = models.CharField(max_length=50)
> >     last_name = models.CharField(max_length=50)
> >
> >     def __unicode__(self):
> >         return u'%s %s' % (self.first_name, self.last_name)
> >
> > what does the u'%s %s' % mean... I cannot find any exaplanation of
> > this in the docs?
> >
> > i've seen this in someones code that was kindly lent to me by one of
> > the RC chat room people:
> >
> > return u'ID%s: %s - %s - %s - %s' % (self.id, self.user,
> > self.question, self.answer, self.get_status_display())
> >
> > but all this u' %s  %s'   %%%sss or what ever is most confusing
> >
> > is there a document or help guide some where that explains this
> > nomenclature, or method, system???
> >
> > as I believe if you take the top example you should be able to do:
> >  def __unicode__(self):
> >         return(self.first_name, self.last_name)
> >
> > If there is no documentation (for dummies) can anyone explain it to
> > me??
> >
> > Thanks
> >
> > Krondaj

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django docs __unicode__ return u'%s %s

2012-01-24 Thread coded kid
If I may say, 'u' makes it easy to return variable with any hassle.
And %s rep each string in your script. I think there should be other
ways to go about this. Hope you get my point?

kenneth gonsalves wrote:
> On Tue, 2012-01-24 at 18:33 -0600, James Bennett wrote:
> > On Tue, Jan 24, 2012 at 5:04 PM, Krondaj  wrote:
> > > what does the u'%s %s' % mean... I cannot find any exaplanation of
> > > this in the docs?
> >
> > It's not covered in Django's documentation because it's a standard
> > feature of the Python programming language -- this is basic Python
> > string formatting, which follows similar conventions to printf()-style
> > formatting in other languages.
>
> soon to be deprecated in favour of using format.
> --
> regards
> Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Help Me With This Form

2012-01-24 Thread coded kid
Hi guys, I’m trying to let this form display but it’s not displaying
in my browser. When I open up the browser, only a blank page shows up.
How can I go about it? Below are my codes:

In models.py
from django.db import models
from django.forms import ModelForm, Textarea, HiddenInput
from django.contrib.auth.models import User
from string import join
from settings import MEDIA_ROOT
class group(models.Model):
desc=models.TextField(max_length=25)

def __unicode__(self):
return unicode(self.id)

def get_absolute_url(self):
return "/g/%s" % unicode(self.id)

class Admin:
list_display=('id','desc')
class Meta:
ordering=['-id']

class mob (models.Model):
author=models.ForeignKey(User,blank=True, null=True)
state_province=models.CharField(max_length=50)
body=models.TextField(max_length=1)
date=models.DateTimeField('Date')
group=models.ForeignKey(group)


def __unicode__(self):
return u"%s - %s - %s - %s" % (self.author,
self.state_province, self.body, self.date)

def get_absolute_url(self):
return "/post/%s/" % unicode(self.id)
def get_author_url(self):
return "/u/%s/p/0" % (self.author)

class Admin:
list_display=('author','body','date')
date_hierarchy='date'
class Meta:
ordering=['-date']


class mobForm(ModelForm):
class Meta:
model=mob
fields=('body','author','state_province','date','group')
widgets={
'body':Textarea(attrs={"rows":2, "cols":40}),
'author': (HiddenInput),
'state_province': (HiddenInput),
'date':(HiddenInput),
'group': (HiddenInput),
}
class grpForm(ModelForm):
class Meta:
model=group
field=('desc')

In views.py

from myweb.meekapp.models import mobForm
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.views.decorators.csrf import csrf_exempt
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import login, logout


def home(request):
return render_to_response('home.html')

in my template:

{% extends "base.html" %}

{% load pagination_tags %}


{% autopaginate object_list %}
{% block newsol %}
{% if user.is_authenticated %}


  
{{ mobForm }}
  
  


{% endif %}
{% paginate %}
{% endblock newsol%}
How can I make the mobForm display? Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Somebody please attend to me

2012-01-23 Thread coded kid
 Please how can I get user post update, make their friends comment and
share the update in django? Just like the way FB update is. I hope you
get my point?  Thanks so much

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How can I go about this?

2012-01-22 Thread coded kid
Thanks for the reply. I don't really mean twitter clone, just want
want users to post update, so their friends can comment, and reshare
the post. And it will be build in django.

Donald Casson wrote:
> This is a very open ended question.  There are many different ways in which 
> you could achieve the same thing.
>
>
> Just offering a suggestion here:
>
> I would take a read through the retwis docs, although it is php and redis it 
> should give you enough of an understanding on how to implement some of the 
> ideas in django.
>
> http://redis.io/topics/twitter-clone
>
> Cheers
> Don
>
>
>
> On 22/01/2012, at 6:11 PM, coded kid wrote:
>
> > Hey guys, please I want you to give me a brief on how I can go about
> > making users post status update for their friends to see. Just like
> > how its been done on twitter. Where you tweet whats happening and
> > after tweeting its will display your status with reply, retweet and
> > favourite button below. Hope you get my point?
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at 
> > http://groups.google.com/group/django-users?hl=en.
> >

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How can I go about this?

2012-01-22 Thread coded kid
Hey guys, please I want you to give me a brief on how I can go about
making users post status update for their friends to see. Just like
how its been done on twitter. Where you tweet whats happening and
after tweeting its will display your status with reply, retweet and
favourite button below. Hope you get my point?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Having Headache With LoginForm

2012-01-21 Thread coded kid


On Jan 21, 2:35 pm, coded kid <duffleboi...@gmail.com> wrote:
> Thanks for the help bro.
>
> How can I make the form verify users name and password before login
> in. So that if the user wants to login in with wrong data, the form
> will tell the user to login in with the correct data. Any idea?
>
> Can this code be put in the views.py?
> def get_user(self, user_id):
>     try:
>         return User.objects.get(pk=user_id)
>     except User.DoesNotExist:
>         return None
> So that it can verify users data before they loggin in?
>
> On Jan 19, 6:03 pm, Mark Furbee <markfur...@gmail.com> wrote:
>
>
>
>
>
>
>
> > No problem. You will likely use the form objects in your template, I just
> > chose to create my own form in HTML.
>
> > Since the 'views.Login' is a string, you don't need to import it. It just
> > tells Django which view to pass the request to when that url pattern is
> > found. The ^ means the beginning of the url after the slash
> > (www.mysite.com/ > here>). The $ means the string ends. I found this useful, because without
> > it, multiple urls will match. For example: with `url(r'^login',
> > 'views.Login')`, the following will all match and go to views.Login: 
> > 1)www.mysite.com/login, 2)www.mysite.com/login_page, 
> > 3)www.mysite.com/login?no_login=1. So I specify the $ to make it more exact,
> > more out of habit than requirement. If you add the slash to the end like
> > `url(r'^login/$', 'views.Login')`, it will require the slash, 
> > sowww.mysite.com/loginwillnot match. If you want to have both urls work, I
> > think this will work (although untested): `url(r'^login/?$',
> > 'views.Login')`, where the /? means that there could be no / or one slash.
> > With this, the following would not match: www,mysite.com/login///. If you
> > wanted to allow multiple slashes, change the ? with *, like
> > `url(r'^login/*', 'views.Login')`. Again, that's not tested, but it should
> > work, I think.
>
> > Happy Coding!
>
> > Mark
>
> > On Wed, Jan 18, 2012 at 6:09 PM, coded kid <duffleboi...@gmail.com> wrote:
> > > Thanks bro. Don't you think I should import Login in urls.py? What
> > > about / in before the $ in urls.py? Or I should just place it like
> > > that?
>
> > > Mark Furbee wrote:
> > > > This is my login process.
>
> > > > urls.py:
> > > > url(r'^login$', 'views.Login'),
> > > > url(r'^logout$', 'views.Logout'),
>
> > > > views.py:
> > > > def Login(request, next=None):
> > > >     """
> > > >         Used to log into the application.
> > > >     """
>
> > > >     #  If the user is authenticated pass them through to the homepage.
> > > >     if request.user.is_authenticated():
> > > >         return HttpResponseRedirect('/')
>
> > > >     # If the user is not authenticated, but the method is POST, they 
> > > > have
> > > > posted their username and password.
> > > >     if request.method == "POST":
>
> > > >         # Get Username and Password.
> > > >         username = request.POST['username']
> > > >         password = request.POST['password']
>
> > > >         # Authenticate.
> > > >         user = authenticate(username=username, password=password)
>
> > > >         # If the User is not None, they have a valid account and
> > > password.
> > > >         if user is not None:
>
> > > >             # If the user isactive, we can log them in.
> > > >             if user.is_active:
> > > >                 # Log them in, and redirect to the homepage.
> > > >                 login(request, user)
> > > >                 return HttpResponseRedirect('/')
>
> > > >             # If the user is not active, pass them back to the login
> > > page,
> > > > with a message that the account is inactive.
> > > >             else:
> > > >                 return render_to_response('login.htm', {'error': 
> > > > 'Account
> > > > Disabled - contact I.T. for assistance'},
> > > > context_instance=RequestContext(request))
>
> > > >         # The user with those credentials did not exist, pass them back
> > > to
> > > > the login page, with a message that the account was invalid.
> > > >         else:
> > > >             return re

Re: Having Headache With LoginForm

2012-01-21 Thread coded kid
Thanks for the help bro.

How can I make the form verify users name and password before login
in. So that if the user wants to login in with wrong data, the form
will tell the user to login in with the correct data. Any idea?

Can this code be put in the views.py?
def get_user(self, user_id):
try:
return User.objects.get(pk=user_id)
except User.DoesNotExist:
return None
So that it can verify users data before they loggin in?

On Jan 19, 6:03 pm, Mark Furbee <markfur...@gmail.com> wrote:
> No problem. You will likely use the form objects in your template, I just
> chose to create my own form in HTML.
>
> Since the 'views.Login' is a string, you don't need to import it. It just
> tells Django which view to pass the request to when that url pattern is
> found. The ^ means the beginning of the url after the slash
> (www.mysite.com/ here>). The $ means the string ends. I found this useful, because without
> it, multiple urls will match. For example: with `url(r'^login',
> 'views.Login')`, the following will all match and go to views.Login: 
> 1)www.mysite.com/login, 2)www.mysite.com/login_page, 
> 3)www.mysite.com/login?no_login=1. So I specify the $ to make it more exact,
> more out of habit than requirement. If you add the slash to the end like
> `url(r'^login/$', 'views.Login')`, it will require the slash, 
> sowww.mysite.com/loginwill not match. If you want to have both urls work, I
> think this will work (although untested): `url(r'^login/?$',
> 'views.Login')`, where the /? means that there could be no / or one slash.
> With this, the following would not match: www,mysite.com/login///. If you
> wanted to allow multiple slashes, change the ? with *, like
> `url(r'^login/*', 'views.Login')`. Again, that's not tested, but it should
> work, I think.
>
> Happy Coding!
>
> Mark
>
>
>
>
>
>
>
> On Wed, Jan 18, 2012 at 6:09 PM, coded kid <duffleboi...@gmail.com> wrote:
> > Thanks bro. Don't you think I should import Login in urls.py? What
> > about / in before the $ in urls.py? Or I should just place it like
> > that?
>
> > Mark Furbee wrote:
> > > This is my login process.
>
> > > urls.py:
> > > url(r'^login$', 'views.Login'),
> > > url(r'^logout$', 'views.Logout'),
>
> > > views.py:
> > > def Login(request, next=None):
> > >     """
> > >         Used to log into the application.
> > >     """
>
> > >     #  If the user is authenticated pass them through to the homepage.
> > >     if request.user.is_authenticated():
> > >         return HttpResponseRedirect('/')
>
> > >     # If the user is not authenticated, but the method is POST, they have
> > > posted their username and password.
> > >     if request.method == "POST":
>
> > >         # Get Username and Password.
> > >         username = request.POST['username']
> > >         password = request.POST['password']
>
> > >         # Authenticate.
> > >         user = authenticate(username=username, password=password)
>
> > >         # If the User is not None, they have a valid account and
> > password.
> > >         if user is not None:
>
> > >             # If the user isactive, we can log them in.
> > >             if user.is_active:
> > >                 # Log them in, and redirect to the homepage.
> > >                 login(request, user)
> > >                 return HttpResponseRedirect('/')
>
> > >             # If the user is not active, pass them back to the login
> > page,
> > > with a message that the account is inactive.
> > >             else:
> > >                 return render_to_response('login.htm', {'error': 'Account
> > > Disabled - contact I.T. for assistance'},
> > > context_instance=RequestContext(request))
>
> > >         # The user with those credentials did not exist, pass them back
> > to
> > > the login page, with a message that the account was invalid.
> > >         else:
> > >             return render_to_response('login.htm', {'error': 'Invalid
> > > Username/Password - contact I.T. for assistance'},
> > > context_instance=RequestContext(request))
>
> > >     # They have not yet attempted a login, pass them to the login page,
> > > without any error messages..
> > >     else:
>
> > >         return render_to_response('login.htm', {'NoSessionTimeout':
> > 'True',
> > > 'next': next}, context_instance=RequestContext(request))
>
> > > def Logout(request):
>

Re: Having Headache With LoginForm

2012-01-18 Thread coded kid
Thanks bro. Don't you think I should import Login in urls.py? What
about / in before the $ in urls.py? Or I should just place it like
that?

Mark Furbee wrote:
> This is my login process.
>
> urls.py:
> url(r'^login$', 'views.Login'),
> url(r'^logout$', 'views.Logout'),
>
>
> views.py:
> def Login(request, next=None):
> """
> Used to log into the application.
> """
>
> #  If the user is authenticated pass them through to the homepage.
> if request.user.is_authenticated():
> return HttpResponseRedirect('/')
>
> # If the user is not authenticated, but the method is POST, they have
> posted their username and password.
> if request.method == "POST":
>
> # Get Username and Password.
> username = request.POST['username']
> password = request.POST['password']
>
> # Authenticate.
> user = authenticate(username=username, password=password)
>
> # If the User is not None, they have a valid account and password.
> if user is not None:
>
> # If the user isactive, we can log them in.
> if user.is_active:
> # Log them in, and redirect to the homepage.
> login(request, user)
> return HttpResponseRedirect('/')
>
> # If the user is not active, pass them back to the login page,
> with a message that the account is inactive.
> else:
> return render_to_response('login.htm', {'error': 'Account
> Disabled - contact I.T. for assistance'},
> context_instance=RequestContext(request))
>
> # The user with those credentials did not exist, pass them back to
> the login page, with a message that the account was invalid.
> else:
> return render_to_response('login.htm', {'error': 'Invalid
> Username/Password - contact I.T. for assistance'},
> context_instance=RequestContext(request))
>
> # They have not yet attempted a login, pass them to the login page,
> without any error messages..
> else:
>
> return render_to_response('login.htm', {'NoSessionTimeout': 'True',
> 'next': next}, context_instance=RequestContext(request))
>
>
> def Logout(request):
> logout(request)
>
> # Render the logout.htm page, which will display they are logging out
> and redirect them to the login page.
> return render_to_response('login.htm', {'notice': 'You have been logged
> out successfully.'}, context_instance=RequestContext(request))
>
>
>
> template login.htm:
>
> .
> .
> .
>  method="post" name="login">
>  {% csrf_token %}
>  
>  
>  Login
>  
> 
>  
> {% if error %}
>  
> 
>  {% FatalImage %}
> {{ error }}
> 
>  
> 
>  {% endif %}
> {% if warning %}
> 
>  
> {% WarnImage %}
>  {{ warning }}
> 
> 
>  
> {% endif %}
>  {% if notice %}
> 
> 
>  {% NoticeImage %}
> {{ notice }}
> 
>  
> 
>  {% endif %}
> 
> Email address:  
>  
>  maxlength="64" />
>  
> 
> 
>  Password:  
> 
>   maxlength="255" />
>  
> 
> 
>  
> 
> 
>  
> 
>  
> 
> 
>  
> 
>
>
>
> On Wed, Jan 18, 2012 at 8:09 AM, Mark Furbee <markfur...@gmail.com> wrote:
>
> > Is that template mainpage.html?
> >
> > I'm not sure exactly what you mean is happening. When you open the login
> > page it takes you back to the home page? Also, I would add in the my_login
> > view that if they are already logged in to redirect them to another page
> > besides the login page. As your view is now, when they go to the login
> > page, while they are already logged in, it will allow them to log in again
> > as a different user. Perhaps that is intended, I just thought I'd point it
> > out.
> >
> > Mark
> >
> > On Tue, Jan 17, 2012 at 10:57 PM, coded kid <duffleboi...@gmail.com>wrote:
> >
> >> Yeah, I've done that, but its not working! Any help?
> >>
> >> On Jan 17, 10:37 pm, Mark Furbee <markfur...@gmail.com> wrote:
> >> > It means, don't use the "decorator" @login_required above your login
> >> view.
> >> > Your login view cannot require a login, because you'd never get to log
> >> in.
> >> > Chicken and egg.
> >> >
> >> >
> >> >
> >> > On Tue, Jan 17, 2012 at 2:34 PM, coded kid <duffleboi...@gmail.com>
> >> wrote:
> >> >
> >> > > Thorsten Sanders wrote:
> >> > > 

Re: Having Headache With LoginForm

2012-01-17 Thread coded kid
Yeah, I've done that, but its not working! Any help?

On Jan 17, 10:37 pm, Mark Furbee <markfur...@gmail.com> wrote:
> It means, don't use the "decorator" @login_required above your login view.
> Your login view cannot require a login, because you'd never get to log in.
> Chicken and egg.
>
>
>
> On Tue, Jan 17, 2012 at 2:34 PM, coded kid <duffleboi...@gmail.com> wrote:
>
> > Thorsten Sanders wrote:
> > > With using
>
> > > @login_required decorator the user needs to be logged in to allow
> > execution, don't makes much sense for a login :P
>
> > > Am 17.01.2012 22:23, schrieb coded kid:
> > > > Hi guys, I�m having problem with my login form. The login form will
> > > > redirect me to the next page even if I didn�t input anything in the
> > > > username and password field. Also it can�t get the username of the
> > > > registered users to verify if the user data is wrong or right. How can
> > > > I get rid of this problem?
> > > > Below are my code:
> > > > In views.py
> > > > from django.db import models
> > > > from mymeek.meekme.models import RegisterForm
> > > > from django.shortcuts import render_to_response
> > > > from django.http import HttpResponse
> > > > from django.template import RequestContext
> > > > from django.http import HttpResponseRedirect
> > > > from django.contrib.auth import authenticate, login
> > > > from django.contrib.auth.decorators import login_required
>
> > > > @login_required
> > > > def mylogin(request):
> > > >      if request.method=='POST':
> > > >          username= request.POST['username']
> > > >          password= request.POST['password']
> > > >          user=authenticate (username=username, password=password)
> > > >          if user is not None:
> > > >              if user.is_active:
> > > >                  login(request, user)
> > > >                  return HttpResponseRedirect('/logpage/')
> > > >              else:
> > > >                  return direct_to_template(request,'q_error.html')
> > > >      else:
> > > >          return render_to_response('mainpage.html')
> > > > In my template:
> > > > 
> > > > 
> > > > 
> > > > 
> > > >    {{form.username.label_tag}}
> > > >    {{form.username}}
> > > > 
> > > > 
> > > >    {{form.password.label_tag}}
> > > >    {{form.password}}
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Please help me out! Thanks.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



  1   2   >