Re: Locating the Django admin Page

2013-02-10 Thread vikalp sahni
I hope you have settled up admin contrib app properly on your settings.py

https://docs.djangoproject.com/en/dev/ref/contrib/admin/


On Sunday, February 10, 2013, Thota Madhu Sudhan Rao wrote:

> I am running apache tomcat server in Amazon EC2 and running django
> application
> The admin page of Django is not here
> http://ipaddress:8080/admin
>
> Where do I find it
>
> --
> 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  'cvml', 'django-users%2bunsubscr...@googlegroups.com');>.
> To post to this group, send email to 
> django-users@googlegroups.com '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.
>
>
>

-- 
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: dropping ForeignKey not reflected in admin

2012-06-15 Thread vikalp sahni
strange, I hope you are checking the right model and right admin.

Can you check you have traces for that field on your admin.py

Regards,
//Vikalp

On Fri, Jun 15, 2012 at 11:37 PM, Larry Martell wrote:

> I have a table that had a ForeignKey reference. In the admin screen
> for adding to this table there was a dropdown for that column. I want
> to get rid of that ForeignKey. I changed models.py and removed the
> ForeignKey column, bounced apache and altered the table and removed
> that column. In the admin screen it still has the dropdown for that
> column. If I try and add a row it silently fails. If I try and display
> the rows from the table it says there are none, even thought there
> are. I even tried dropping the table and running syncdb. It created
> the table without the ForeignKey column, but yet the admin screen
> still has the dropdown for that column. What am I doing wrong here?
>
> --
> 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 admin login

2012-03-15 Thread vikalp sahni
ITS in settigns.py file.

if its not there just write.

SESSION_COOKIE_DOMAIN = "localhost" and then try.

Regards,
//Vikalp

On Wed, Mar 14, 2012 at 11:48 PM, dummyman dummyman <tempo...@gmail.com>wrote:

> Wer is the SESSION_COOKIE_DOMAIN ?
>
>
> On Wed, Mar 14, 2012 at 11:32 PM, dummyman dummyman <tempo...@gmail.com>wrote:
>
>> hi
>>
>> i got this error msg
>>
>> Please enter a correct username and password. Note that both fields are
>> case-sensitive.
>>
>>
>> On Wed, Mar 14, 2012 at 11:21 PM, vikalp sahni <vikalpsa...@gmail.com>wrote:
>>
>>> Can you share your SESSION_COOKIE_DOMAIN setting. In your settings.py
>>> file.
>>>
>>> Also, is there any error message which is displayed on top of login form
>>> when you try to login?
>>>
>>> Regards,
>>> //Vikalp
>>>
>>>
>>> On Wed, Mar 14, 2012 at 11:06 PM, dummyman dummyman 
>>> <tempo...@gmail.com>wrote:
>>>
>>>> hi ..
>>>>
>>>> I created a superuser but still getting the same error
>>>>
>>>> @vikalp: But it works for other projects with the same superuser name
>>>> and password
>>>>
>>>>
>>>> On Wed, Mar 14, 2012 at 10:57 PM, Denis Darii <denis.da...@gmail.com>wrote:
>>>>
>>>>> Try to create your superuser again:
>>>>>
>>>>> ./manage.py createsuperuser
>>>>>
>>>>>
>>>>> On Wed, Mar 14, 2012 at 6:25 PM, vikalp sahni 
>>>>> <vikalpsa...@gmail.com>wrote:
>>>>>
>>>>>> You have to check your
>>>>>>
>>>>>> SESSION_COOKIE_DOMAIN in settings file if i.e pointing to "localhost"
>>>>>> (if not cookies will not properly set and hence login will not be 
>>>>>> allowed)
>>>>>>
>>>>>> the best would be to use some host entry like example.com 127.0.0.1
>>>>>> and then use that in SESSION_COOKIE_DOMAIN and for accessing project on
>>>>>> browser.
>>>>>>
>>>>>> Regards,
>>>>>> //Vikalp
>>>>>>
>>>>>>
>>>>>> On Wed, Mar 14, 2012 at 10:51 PM, dummyman dummyman <
>>>>>> tempo...@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>> I created a new project in django
>>>>>>>
>>>>>>> 1.I created a new database
>>>>>>> 2. I created a new user
>>>>>>> 3.python manage syncdb
>>>>>>> 4.python manae.py runserver
>>>>>>>
>>>>>>> when i visit localhost:8080/admin -> it asks for username n passwd.
>>>>>>> but the login fails inspite of entering correct one
>>>>>>>
>>>>>>> But it works for a different project
>>>>>>>
>>>>>>> --
>>>>>>> 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.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> This e-mail and any file transmitted with it is intended only for the
>>>>> person or entity to which is addressed and may contain information that is
>>>>> privileged, confidential or otherwise protected from disclosure. Copying,
>>>>> disseminatio

Re: django admin login

2012-03-14 Thread vikalp sahni
Can you share your SESSION_COOKIE_DOMAIN setting. In your settings.py file.

Also, is there any error message which is displayed on top of login form
when you try to login?

Regards,
//Vikalp

On Wed, Mar 14, 2012 at 11:06 PM, dummyman dummyman <tempo...@gmail.com>wrote:

> hi ..
>
> I created a superuser but still getting the same error
>
> @vikalp: But it works for other projects with the same superuser name and
> password
>
>
> On Wed, Mar 14, 2012 at 10:57 PM, Denis Darii <denis.da...@gmail.com>wrote:
>
>> Try to create your superuser again:
>>
>> ./manage.py createsuperuser
>>
>>
>> On Wed, Mar 14, 2012 at 6:25 PM, vikalp sahni <vikalpsa...@gmail.com>wrote:
>>
>>> You have to check your
>>>
>>> SESSION_COOKIE_DOMAIN in settings file if i.e pointing to "localhost"
>>> (if not cookies will not properly set and hence login will not be allowed)
>>>
>>> the best would be to use some host entry like example.com 127.0.0.1 and
>>> then use that in SESSION_COOKIE_DOMAIN and for accessing project on browser.
>>>
>>> Regards,
>>> //Vikalp
>>>
>>>
>>> On Wed, Mar 14, 2012 at 10:51 PM, dummyman dummyman 
>>> <tempo...@gmail.com>wrote:
>>>
>>>>
>>>> Hi,
>>>> I created a new project in django
>>>>
>>>> 1.I created a new database
>>>> 2. I created a new user
>>>> 3.python manage syncdb
>>>> 4.python manae.py runserver
>>>>
>>>> when i visit localhost:8080/admin -> it asks for username n passwd. but
>>>> the login fails inspite of entering correct one
>>>>
>>>> But it works for a different project
>>>>
>>>> --
>>>> 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.
>>>
>>
>>
>>
>> --
>> This e-mail and any file transmitted with it is intended only for the
>> person or entity to which is addressed and may contain information that is
>> privileged, confidential or otherwise protected from disclosure. Copying,
>> dissemination or use of this e-mail or the information herein by anyone
>> other than the intended recipient is prohibited. If you are not the
>> intended recipient, please notify the sender immediately by return e-mail,
>> delete this communication and destroy all copies.
>>
>>  --
>> 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.
>

-- 
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 admin login

2012-03-14 Thread vikalp sahni
You have to check your

SESSION_COOKIE_DOMAIN in settings file if i.e pointing to "localhost" (if
not cookies will not properly set and hence login will not be allowed)

the best would be to use some host entry like example.com 127.0.0.1 and
then use that in SESSION_COOKIE_DOMAIN and for accessing project on browser.

Regards,
//Vikalp


On Wed, Mar 14, 2012 at 10:51 PM, dummyman dummyman wrote:

>
> Hi,
> I created a new project in django
>
> 1.I created a new database
> 2. I created a new user
> 3.python manage syncdb
> 4.python manae.py runserver
>
> when i visit localhost:8080/admin -> it asks for username n passwd. but
> the login fails inspite of entering correct one
>
> But it works for a different project
>
> --
> 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: urls.py and login forms

2012-03-08 Thread vikalp sahni
Hi,

Here what i can see is you have added a prefix in your pattern,

urlpatterns = patterns(*'myapp.views'*,
url(r'^login/$','django.contrib.auth.views.login'),)

This ideally should be.

urlpatterns = patterns(*''*,
url(r'^login/$','django.contrib.auth.views.login'),)

As the prefix is applied to all the url resolver views which are part of
that pattern.

https://docs.djangoproject.com/en/dev/topics/http/urls/#the-view-prefix

Hope this helped.


Regards,
//Vikalp

On Fri, Mar 9, 2012 at 7:23 AM, Scott Macri  wrote:

> How am I supposed to configure access to the built in django login and
> password forms after changing my urls.py settings?
> I've setup the main project urls.py file like so:
> url(r'^myapp/',include('myapp.urls')),
>
> I now have a urls.py file under myapp/urls.py setup similar to the
> following:
> urlpatterns = patterns('myapp.views',
> url(r'^login/$','django.contrib.auth.views.login'),)
>
> Whenever I try to access the /myapp/login/ page I just get
> ViewDoesNotExist blah, blah, blah.
>
> I've tried configuring it in a different manner and still get the same
> issue.  I've created a login.html in registration/login.html in my
> template directory, and tried in myapp/registration/login.html, and
> still nothing.  This is getting frustrating because its supposed to be
> saving me time, but has taken more time than writing it myself so far.
>
> Does anyone have any suggestions as to what I can try to fix this?  Thanks.
>
> --
> Scott
>
> --
> 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: reqquest.user is not defined

2011-07-21 Thread vikalp sahni
If There is no user request.user holds. AnonymousUser Object.

if you user request.user.is_authenticated() it should give False in case
user if not logged_in, and you can load your page accordingly.

Regards,
//Vikalp


On Thu, Jul 21, 2011 at 11:52 AM, bahare hoseini wrote:

> hi there,
> i've installed *AuthenticationMiddleWare *& *SessionMidleWare *in
> MIDDLEWARE_CLASSES in setting.py,
> but wherever i use (request.user) my web page such as log_in page,is loaded
> as if it doesn't know request.user => there is no limit to access pages!!
>
> could you please tell me why?
>
> 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.



Re: Problem in accepting values from a form in a template . How to debug this ?

2011-06-14 Thread vikalp sahni
Page Not Found or 404, basically doesn't have any relation with template of
form.

Just check if you have the URL that you are trying to hit in urls.py, as 404
happens when the URL you are trying to access is not configured or not
available on your webapp.

Regards
//Vikalp

On Tue, Jun 14, 2011 at 3:43 PM, Satyajit Sarangi  wrote:

> My forms.py is this
>
>
> from django import forms
> from django.forms.widgets import RadioSelect
> import floppyforms as forms
> class PermForm(forms.Form):
>user = forms.CharField(max_length=100)
>RADIO_CHOICES1 = [['1','Radio 1'],['2','Radio 2']]
>RADIO_CHOICES2 = [['3','Radio 2'],['4','Radio 2']]
>radio = forms.ChoiceField( widget=RadioSelect(),
> choices=RADIO_CHOICES1)
>radio = forms.ChoiceField( widget=RadioSelect(),
> choices=RADIO_CHOICES2)
>
>
> My views.py is this
>
> from django.conf import settings
> from django.shortcuts import render_to_response
> from django.template import RequestContext, loader
> from django import forms
> from django.core import validators
> from django.contrib.auth.models import User
> from django.utils import simplejson
>
> def PermLayer(request):
>users = User.objects.all()
>if request.method == 'POST':
>form = PermForm(request.POST)
>if form.is_valid():
>data = form.cleaned_data
>rad1=form.cleaned_data['RADIO_CHOICES1']
>rad2=form.cleaned_data['RADIO_CHOICES2']
>User.objects.get(username = data['username'])
>print rad1
>perm = Permission()
>perm.user = User.objects.get('pk')
>perm.table =
> ContentType.objects.get_for_model(TableToAddPermissionFor)
>perm.permi = rad1 + rad2
>perm.save()
>return
> render_to_response('permission.html',{'user':users})
>else:
>form = PermForm()
>
>
>
>return render_to_response('permission.html', {'user':users})
>
>
> My template is this
>
>
>
>
>
>
>
> 
> 
> Permissions
>
> 
>
> These are the present users {{user}} 
>
>
>
>
> 
> 
> 
>
> User: >
>
> 
> 
> Who can view the data 
> 
> Any registered users label>
>  Only users that
> can edit
> 
> Who can edit the data 
> 
> Any registered
> user
>  Only the
> following users
> 
> 
> 
> 
> 
> 
> 
>
>
> When I click on the submit button . it shows an error showing that
> page not found PermForm 404 .
>
> How to debug ?
>
> --
> 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: poll problem

2011-06-13 Thread vikalp sahni
This is for Admin functionality of django.

It basically tells about how to replace 'Django Administration' or 'Django'
keyword from admin pages to '' to basically personalize the
look and feel of django admin pages.

Though this is just a UI related change which will not effect the
functionality of application.

Regards,
//Vikalp

On Mon, Jun 13, 2011 at 9:46 PM, jaspreet kaur  wrote:

> hii...
> i am new to django. I am doing poll application
> can anybody tell what is the meaning of following and how to do that
> "just edit the file and replace the generic Django text with your own
> site's name as you see fit."
>
> --
> 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: hidden rows common elements also visible on list filters

2011-05-05 Thread vikalp sahni
How have you made rows hidden??

if you talking about admin, You can control by overriding querset method for
that particular table admin.

Example:

class sometableAdmin:
 def queryset(self, request):
  if(whatevercond):
return super(, self).queryset(request)
  else:
return  self.model._default_manager.filter(id=1)



Regards,
//Vikalp

On Thu, May 5, 2011 at 5:45 AM, rahul jain  wrote:

> All,
>
> Hidden rows elements also visible on list filters ?
>
> ex:
>
> I have a list filter on one of the columns ,
>
> list filter for that column displays all the distinct values, but the
> problem is that few rows i have disabled.
> But list filter still displays those rows as well.
>
> How to fix this ?
>
> Thanks.
>
> RJ
>
> --
> 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: Allow only one record in admin.ModelAdmin !

2011-05-04 Thread vikalp sahni
sorry, didn't get you. << I need just only to limit to one record >>

is it something like you want one user to add only one record to certain
table from admin??



On Wed, May 4, 2011 at 10:41 AM, Toninho Nunes wrote:

> Hi,
>
> I have a table named Config, I need just only to limit to one record,
> are there a method or property to do this? any tip ou advice how to
> proceed? I use the admin.ModelAdmin.
>
> details:
> Django Version 1.3
> Ubuntu 10.10 - 64bits
> PostGresql 8.4
>
>
> Thanks,
>
> Toninho Nunes
>
> --
> 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: how to use jquery for date picker

2011-05-04 Thread vikalp sahni
are you planing to use that in place of django current date time picker
widget??

Which means are you looking to change the behaviour of Django Form,
DateTimeField to use Jquery??

I would suggest not to change default datepickerwidget, as it works like a
charm in admin forms.
You should though try implementing jquery datepicker on any other
application side form Thus not changing
the default behavior of date time widget of django.

Regards,
//Vikalp

On Wed, May 4, 2011 at 4:37 PM, GKR  wrote:

> sorry for that but I am going to use that for django
>
> 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.



Re: how to use jquery for date picker

2011-05-04 Thread vikalp sahni
http://jqueryui.com/demos/datepicker/

Furthermore i think, this is not the right list for Jquery related queries.

Regards,
//Vikalp

On Wed, May 4, 2011 at 4:15 PM, GKR  wrote:

> how to use jquery for date picker
>
> please 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.



Re: django admin site and debug

2011-05-03 Thread vikalp sahni
are you using it on any webserver or on django management server (manage.py
runserver) at some port??

it can happen if in any of your urls.py you have mentioned something
specefic to DEBUG variable. But its quite a strage behaviour.

more inputs on your installation or how you are running will be able to put
more light on it.

Also just check if its 404 or 500 error when you put debug false.

Regards,
//Vikalp

On Wed, May 4, 2011 at 7:30 AM, Yasmany Cubela Medina
wrote:

>  i have the django admin site enabled and it work at perfect with debug
> flag set to true, but when i change to false throwme the page not found
> template in the edit pages of any module in the admin interface.
>
>
> any help
>
>
>
> 
>
> El ayer es un recuerdo, el mañana es un misterio y el ahora es un
> regalo...por eso se llama presente.
>
>
> Ing. Yasmany Cubela Medina:
>
> Linux user 446757
>
> Ubuntu user 13464
>
> --
> 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: Error on django program with django-socialregistration....

2011-03-21 Thread vikalp sahni
https://github.com/facebook/python-sdk

You have to use this.  As the method giving error is implemented on Facebook
Python-SDK.

Regards
//Vikalp

On Mon, Mar 21, 2011 at 4:15 PM, Calvin Spealman wrote:

> Do you possibly have a module or package in your project named "facebook"?
> One of the requirements for django-socialauth is the facebook python
> library, but if you have another module by the same name, that could be
> imported instead.
>
>
> On Mon, Mar 21, 2011 at 4:23 AM, Nge Nge  wrote:
>
>> Hi All!
>>
>> I am already tried to login from my django form via facebook login.
>> I am testing with django-socialregistration from (
>> https://github.com/flashingpumpkin/django-socialregistration.git).
>> I am facing the following error when I run my program.
>> Please help  me.. How should I do??
>>
>> Nge
>>
>> AttributeError at /
>>
>> 'module' object has no attribute 'get_user_from_cookie'
>>
>> Request Method: GET
>> Request URL:http://127.0.0.1:8080/
>> Django Version: 1.2.5
>> Exception Type: AttributeError
>> Exception Value:
>>
>> 'module' object has no attribute 'get_user_from_cookie'
>>
>> Exception Location: /home/mya/FBWorkSpace/FacebookTest/FacebookTest/
>> django-socialregistration/socialregistration/middleware.py in
>> process_request, line 24
>> Python Executable:  /usr/bin/python
>> Python Version: 2.6.6
>> Python Path:['/home/mya/FBWorkSpace/FacebookTest/FacebookTest', '/
>> usr/local/lib/python2.6/dist-packages/pyfacebook-1.0a2-py2.6.egg', '/
>> usr/local/lib/python2.6/dist-packages/pip-0.8.3-py2.6.egg', '/usr/
>> local/lib/python2.6/dist-packages/virtualenv-1.5.2-py2.6.egg', '/usr/
>> local/lib/python2.6/dist-packages/django_social_auth-0.3.8-py2.6.egg',
>> '/usr/local/lib/python2.6/dist-packages/python_openid-2.2.5-
>> py2.6.egg', '/usr/local/lib/python2.6/dist-packages/oauth2-1.5.167-
>> py2.6.egg', '/usr/local/lib/python2.6/dist-packages/Django-1.2.5-
>> py2.6.egg', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/
>> usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/
>> python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/
>> usr/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages/
>> PIL', '/usr/lib/python2.6/dist-packages/gst-0.10', '/usr/lib/pymodules/
>> python2.6', '/usr/lib/python2.6/dist-packages/gtk-2.0', '/usr/lib/
>> pymodules/python2.6/gtk-2.0']
>> Server time:Mon, 21 Mar 2011 15:19:17 -0500
>>
>> --
>> 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.
>>
>>
>
>
> --
> Read my blog! I depend on your acceptance of my opinion! I am interesting!
> http://techblog.ironfroggy.com/
> Follow me if you're into that sort of thing:
> http://www.twitter.com/ironfroggy
>
>  --
> 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: When do we stop using Django admin?

2011-03-07 Thread vikalp sahni
Agree,

Admin should be considered as Admin for internal stuffs.

if there is lots of opening up required. you should treat it as a customized
app.

Opening up of a table or two might work good in admin itself, with not much
relations.

Regards,
//Vikalp

On Tue, Mar 8, 2011 at 11:46 AM, ajaishankar <ajai.shan...@gmail.com> wrote:

> Thanks Viklap
>
> We have been doing a lot of ModelAdmin & ModelForm tweaking as
> mentioned in those slides.
>
> But still kind of skeptical we should be opening up the admin to other
> companies; and go through the gymnastics of restricting say a foreign
> key lookup to just the data they are allowed to access etc.
>
> Ajai
>
> On Mar 7, 11:57 pm, vikalp sahni <vikalpsa...@gmail.com> wrote:
> > Hi,
> >
> > Django Admin is nicely structured to give you lot of flixibility.
> >
> > We have tweaked around admin using all possible features and with good
> > mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
> > achive a lot of integrations and customizations.
> >
> > have a look at these slides, it brings more amount of confidence to going
> > forward
> > with Django-Adminhttp://
> www.slideshare.net/lincolnloop/customizing-the-django-admin
> >
> > <http://www.slideshare.net/lincolnloop/customizing-the-django-admin
> >Regards,//Vikalp
> >
> >
> >
> > On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar <ajai.shan...@gmail.com>
> wrote:
> > > Hi
> >
> > > We have a app built on Django, and have been using the admin to good
> > > effect.
> >
> > > Right now we want to open up the app to other companies:
> >
> > > 1. They can log in, create *their* own users
> > > 2. They can only see data that belongs to their company etc.
> > > 3. Also in one part of the app, we expect a highly customized UI where
> > > there is a lot of ajaxy image upload etc going on.
> >
> > > I do know we can tweak the admin to restrict querysets etc. and also
> > > override admin templates - but is admin preferable in this situation?
> >
> > > Or is it better to treat all this as a front end web app, and start
> > > work on fresh pages.
> >
> > > Any pointers would be much appreciated.
> >
> > > Thanks
> >
> > > Ajai
> >
> > > --
> > > 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.
>
>

-- 
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: When do we stop using Django admin?

2011-03-07 Thread vikalp sahni
Hi,

Django Admin is nicely structured to give you lot of flixibility.

We have tweaked around admin using all possible features and with good
mingling of MIDDLEWARE, AUTH_BACKENDS  and STORAGE one can
achive a lot of integrations and customizations.

have a look at these slides, it brings more amount of confidence to going
forward
with Django-Admin
http://www.slideshare.net/lincolnloop/customizing-the-django-admin

Regards,
//Vikalp

On Tue, Mar 8, 2011 at 11:19 AM, ajaishankar  wrote:

> Hi
>
> We have a app built on Django, and have been using the admin to good
> effect.
>
> Right now we want to open up the app to other companies:
>
> 1. They can log in, create *their* own users
> 2. They can only see data that belongs to their company etc.
> 3. Also in one part of the app, we expect a highly customized UI where
> there is a lot of ajaxy image upload etc going on.
>
> I do know we can tweak the admin to restrict querysets etc. and also
> override admin templates - but is admin preferable in this situation?
>
> Or is it better to treat all this as a front end web app, and start
> work on fresh pages.
>
> Any pointers would be much appreciated.
>
> Thanks
>
> Ajai
>
> --
> 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: interface admin

2011-03-07 Thread vikalp sahni
check out.

django-admin-tools

https://bitbucket.org/izi/django-admin-tools/wiki/Home

it  might help you.

Regards,
//Vikalp

On Mon, Mar 7, 2011 at 6:44 PM, galbourn  wrote:

> I started in Django and I have a question.
> Is it possible to generate different admin interfaces that are
> accessible according to user profiles?
>
> What is the easiest solution to manage different interfaces according
> to user profiles?
>
> Thank you 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.



Re: Debugging Deeper Into Django

2011-01-09 Thread vikalp sahni
looks like django is incorporating tighter integration with python logging
library.

do check out.
http://docs.djangoproject.com/en/dev/topics/logging/

Though i think its only on development version as of now.

more details on logging module can be find out at.
http://docs.python.org/library/logging.html

Regards,
//Vikalp

On Sun, Jan 9, 2011 at 7:48 PM, octopusgrabbus <old_road_f...@verizon.net>wrote:

> Would you post more details on the python logging module, like how to
> configure it?
>
> On Jan 8, 2:26 pm, vikalp sahni <vikalpsa...@gmail.com> wrote:
> > for custom logging you can always your python logging module, which is
> just
> > like
> > log4j.
> >
> > Also if you need any specifics regarding db queries etc. you can try out.
> > Django Debug Toolbar:https://github.com/robhudson/django-debug-toolbar
> >
> > Hope it helps.
> >
> > Regards,
> > //Vikalp
> >
> > On Sun, Jan 9, 2011 at 12:21 AM, octopusgrabbus
> > <old_road_f...@verizon.net>wrote:> I would like to see more from Django
> on what it chooses to,
> > > specifically around the loading or not loading of pages. I am running
> > > Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
> > > despite the testimonies its replacement is better.
> >
> > > Are there switches I can set to get more granular (detailed) logging
> > > in Django, or will I have to tweak Apache's configuration to log more?
> >
> > > Thanks.
> > > cmn
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> <django-users%2bunsubscr...@googlegroups.com<django-users%252bunsubscr...@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-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@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-us...@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: Debugging Deeper Into Django

2011-01-08 Thread vikalp sahni
for custom logging you can always your python logging module, which is just
like
log4j.

Also if you need any specifics regarding db queries etc. you can try out.
Django Debug Toolbar:
https://github.com/robhudson/django-debug-toolbar

Hope it helps.

Regards,
//Vikalp


On Sun, Jan 9, 2011 at 12:21 AM, octopusgrabbus
wrote:

> I would like to see more from Django on what it chooses to,
> specifically around the loading or not loading of pages. I am running
> Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
> despite the testimonies its replacement is better.
>
> Are there switches I can set to get more granular (detailed) logging
> in Django, or will I have to tweak Apache's configuration to log more?
>
> Thanks.
> cmn
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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 set a flatpage to be my homepage?

2010-11-21 Thread vikalp sahni
Hi,

If i understood ur question properly

you need a URL rewrite. you can try either

Apache Rewrite (1st Preference) or
you can also import a django app "django.contrib.redirects"

which will help u in redirecting URL's

Regards
//Vikalp



On Sun, Nov 21, 2010 at 4:18 PM, mongoose  wrote:

> Hi there,
>
> I've created some flatpages and they work great. For example
> http://127.0.0.1:8000/home/ and http://127.0.0.1:8000/blog/
>
> I'm catching my flatpages with
> urlpatterns += patterns('',
>(r'', include('darren_web.flatpages.urls')),
> )
>
> What I want though is for http://127.0.0.1:8000/home/ to come up as
> http://127.0.0.1:8000/
> How can I do 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-us...@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-us...@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: Saving images in django

2010-11-10 Thread vikalp sahni
If you are using apache. you can simple disable the indexing of files.
in your apache conf directory directive.

This will give forbidden 403 if u try to access the directory from apache.
hence no files are seen.


Options -Indexes


I hope this helps.

Regards
//Vikalp

2010/11/11 Łukasz Rekucki 

> On 11 November 2010 03:19, andy  wrote:
> > Django recommends saving images to the file system since this gives
> > better performance than storing the files in a database. However I
> > don't seen any documentation on how to restrict access to those files
> > by user. If someone knows the url to your image directory they could
> > possibly view all the content of that directory. If you create a
> > social network or a multi tenant application how will you handle this
> > issue?
> >
> > While writing this up I learned about preventing directory listing, is
> > this secure enough. how about obfuscating file or directory names.
>
> This largely depends on what your HTTP server can do, but with Apache
> you can use the X-Sendfile header. This works like this:
>
> 0. Install mod_xsendfile and put "XSendFile On" in your Apache config.
> See also [1].
>
> 1. Instead of putting the images in a location with all the other
> media, put it in a protected location - one which the server can read,
> but not associated with any Location.
>
> 2. Create a view that will check permissions for a given file. As a
> response return an empty HttpResponse with "X-Sendfile" header
> containing the full filesystem path of the file to be server, or a 403
> if the person is not permitted.
>
> 3. Apache will look at the response for X-Sendfile header and if
> present the file that the header points to will be server as a
> response instead.
>
> This way you can check permission in your Django app, while still
> having the speed of serving static files directly by HTTP server. A
> similar solution is also availble for nginx[2] and probably other
> webservers.
>
> [1]: https://tn123.org/mod_xsendfile/
> [2]: http://wiki.nginx.org/NginxXSendfile
>
> --
> Łukasz Rekucki
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: Can I install Django on my Webserver?

2010-09-27 Thread vikalp sahni
Yeah you can, most of the shared web hostings provide either of

Passegener
Fast CGI
WSGI

Modules to run python web apps. you need to check which one is
installed for you and use the respective config.

Regards,
//Vikalp


On Mon, Sep 27, 2010 at 12:58 PM, McFarlane  wrote:

> Hello,
>
> I'm curious if I can install django on my webserver. It is a cheap
> Webserver I used for PHP and Python scripts. My Problem is, that I am
> only able to toggle "Python support" with a checkbox on the Domain-
> Config-Panel. I cannot install any Packages to apache.
>
> Is it still possible to get a django powerd website up and running?
>
> Thanks in advance, McFarlane
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: REST XML + HTML API suggestions

2010-09-21 Thread vikalp sahni
Hi,

You might want to have a look at django-piston.

http://bitbucket.org/jespern/django-piston/wiki/Home

Its a nice project to give rest full interface to your models.

And for some specific logic also you can tweak the handlers to get desired
results.

Regards,
//Vikalp

On Tue, Sep 21, 2010 at 11:09 AM, Brendon  wrote:

> Hi all,
>
> I want to use DJango to implement an XML based RESTful API and a
> website together using DJango. I am wondering if anyone here is aware
> of any tutorials on ways of achieving this in DJango without
> duplicating too much code?
>
>
> Basically what I want to achieve is to use the same core logic for
> both the website and the API and just have different presentation
> layers for the two systems. I have not seen any tutorials or the like
> on doing this sort of thing and was wondering if people here have
> suggestions on best approaches or tutorials that might show good ways
> to structure this.
>
> The idea is that all interaction using the API uses XML. The POST data
> sent to the server and responses from the server are all using an XML
> schema that we have designed for our application. All interaction with
> the website is the same but uses normal web forms etc for the
> interface of the presentation layer.
>
> Example API:
> * GET   : https://mywebsite/api/rooms/ : List available rooms, returns
> XML with a list of Room ID's
> * POST : https://mywebsite/api/room/  : Create a new room, raw POST
> data is XML with the parameters required to create a room, on success
> returns a Room ID
> * GET   : https://mywebsite/api/room// : Retrieves details
> about an existing room
> * POST : https://mywebsite/api/room// : Modifies details for
> an existing room
> * DELETE : https://mywebsite/api/room// : Delete a room
>
> Now, on the website side of things I want to do exactly the same but
> as part of a a nice HTML site (with menus for navigation, nice graphs
> to display relevant data etc).
>
> Example Web:
> * GET   : https://mywebsite/web/rooms/ : Displays a page with a list
> of links to available Rooms.
> * GET   : https://mywebsite/web/room/   : Displays a page with a form
> requesting input of all necessary data to create a new room.
> * POST : https://mywebsite/web/room/   : Create a new room. POST data
> comes from form displayed previously (on error redisplays form). On
> success redirects the user to the details page for that room.
> * GET   : https://mywebsite/web/room// : Displays details
> about an existing room and provides it in a form that can be used to
> change the data with a POST
> * POST : https://mywebsite/web/room// : Modifies details for
> an existing room
> * DELETE : https://mywebsite/web/room// : Delete a room
>
>
> Thanks,
> Brendon.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: AttributeError for ModelForm

2010-08-14 Thread vikalp sahni
As you are using Multi Table Inheritance,

Django docs says you should give "related_name" attribute to all your sub
classes fields
where relation is tried to establish.

You can try changing ur Question Model to:


 class Question(QItem):
   answerObject = models.OneToOneField("AnswerObject",
blank=True, null=True,related_name="ques")

Hope it works. Just a primary thought by looking on ur code.

CarpeDiem,
//Vikalp




On Sat, Aug 14, 2010 at 3:59 PM, jcage  wrote:

> I'd like to ask for you guidance in the following matter in django:
>
> I am using the following models:
>
>class QItem(models.Model):
>isWhat = models.CharField(max_length=100, blank=True,
> choices=ISWHAT)
>slug = models.SlugField(blank=True)
>script = models.CharField(max_length=100)
>comment = models.TextField(blank=True, null=True)
>author = models.ForeignKey(User)
>
>class QuestionSet(QItem):
>items = models.ManyToManyField(QItem, blank=True,
> through='Ordering',related_name="contained")
>
>
>class Question(QItem):
>answerObject = models.OneToOneField("AnswerObject",
> blank=True, null=True)
>
>
> and their respective, most basic ModelForms:
>
>class QuestionForm(ModelForm):
>class Meta:
>model = Question
>
>class QuestionSetForm(ModelForm):
>class Meta:
>   model = QuestionSet
>
>
> In a view, calling
>
>   qset=QuestionFormSet()
>   print q
> works just fine.
>
>
> However,
>
>   q = QuestionForm()
>   print q
> throws
>
>
>Exception Type: AttributeError
>Exception Value:'NoneType' object has no attribute 'label'
>
> in Django's server. When trying it in the console, I don't get any
> errors.
>
>
> Any ideas why this is the case? Why do similar models behave so
> differently, and how could I get rid of the error?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: limit a view for an ip address only

2010-08-12 Thread vikalp sahni
using  request.META['REMOTE_ADDR']

and the passing ur request through custom middleware might solve your
problem

Ex:
You can have a standard user let say "internal" which you can put into your
request if
it comes from internal IP

inside middleware.

from django.contrib.auth import login, authenticate

def process_request(self,request):
 if(request.META['REMOTE_ADDR'] == "127.0.0.1"):
  usr = authenticate(username="internal",password="password")
  login(request,usr)
 return  None

The code is just a snippet not verified. please make appropriate changes.

Regards,
//Vikalp


in request.META['REMOTE_ADDR']








On Fri, Aug 13, 2010 at 12:16 AM, Alessandro Ronchi <
alessandro.ron...@soasi.com> wrote:

> I want to limit a django view to be accessible for staff users or free
> (without autentication) for a single ip.
>
> Is it possible?
>
>
> --
> Alessandro Ronchi
> http://www.soasi.com
>
> Hobby & Giochi
> http://hobbygiochi.com
> http://www.facebook.com/hobbygiochi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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: Replace Admin Site Foreign Key Field/Dropdown with Textbox?

2010-08-08 Thread vikalp sahni
You can also hide that field which inturn will not load it on page by using

"fields" attribute in admin class for that particular model and specify all
the fields
required to be shown on change list page. Just omit the Foreign Key field in
the "fields"
list in case u don't need it in admin.

Carpe Diem,
//Vikalp

On Sun, Aug 8, 2010 at 7:40 PM, Martin Melin  wrote:

> On Sun, Aug 8, 2010 at 4:00 PM, sixpackistan  wrote:
> > For foreign key fields in the Django Admin, the default display
> > element is a drop down list box containing all of the foreign key
> > items from the related model.  I have an asset tracking instance where
> > this drop down box can contain hundreds of thousands of items and I am
> > looking to not have the admin load them all.  Is there a way to
> > override the admin interface and have it use a text box instead of the
> > populated drop down?
>
> Yup, documented right here:
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields
>
> Cheers,
> Martin
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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 to customize admin's save button functionality?

2010-03-29 Thread vikalp sahni
You can override a method called  "save_model" inside your model admin
class, this will be called
whenever you hit save button of admin for a particular class. You can write
your custom logic in
this method.

ex
def save_model(self, request, obj, form, change):
 Your Logic





Regards,
//Vikalp

On Mon, Mar 29, 2010 at 10:52 AM, Asim Yuksel wrote:

> How can I edit admin's save button, so whenever I click save, I can be
> redirected to a page after successfully inserting the values into db?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@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-us...@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.