set initial data to django-haystacks FacetedSearchForm

2013-05-03 Thread Amyth Arora
I have been digging around for about 24 hours now and am still not able to solve this. I am using a 'haystack.forms.FacetedSearchForm' and want set some initial field values to some of the form fields. Here are some more details on what I am trying to do.

Re: Guidance

2013-04-16 Thread Amyth Arora
POST and GET here are not actually methods but dictionaries which are attributes of the request object. `.get()` method is applicable to any dictionary object. You can check the official docs here http://docs.python.org/2/library/stdtypes.html#dict.get to know more about the get method. Also, If

Re: Use variable in my template?

2013-03-05 Thread Amyth Arora
how are you passing the variable to the template ? show us the view method that renders the template On Feb 28, 2013 4:36 PM, "Maria" wrote: > Hello everyone, > > I have a variable I want to have access to in my Django template. But > somehow I can't manage to do that. > > I

Re: Easy way to make all form fields read only?

2012-11-01 Thread Amyth Arora
I would suggest you adding Boolean field to your UserProfile model like is_authorized = models.BooleanField(default=False) and then in the templates do something like: {% if user.is_authorized %} {% else %} On Thu, Nov 1, 2012 at 9:09 AM, Elena Williams wrote: > I

Re: My page cound not load image, help!

2012-10-22 Thread Amyth Arora
Serve the image as a static file. in your settings.py file set the following: STATIC_URL = '/static/' STATICFILES_DIRS = ('/path/to/your/image/directory',) # Without a trailing slash and then load your image as On Mon, Oct 22, 2012 at 5:14 PM, Joel Goldstick wrote:

Re: Django Troubleshooting

2012-10-20 Thread Amyth Arora
Yeah, those are CLI commands. Although "tar" and "sudo" would not work with windows as they are linux terminal commands. you may follow this easy step by step procedure on how to setup django on windows. Though this was written for windows 7

Re: "Error: unable to open database file" when trying out the Django tutorial

2012-10-20 Thread Amyth Arora
change 'NAME': 'E:/Users/python/mysite/mysite.db', to 'NAME': 'mysite.db', and then try. If that does not work, delete the database file and do python manage.py syncdb again. On Fri, Oct 19, 2012 at 11:22 AM, Hamed Tohidloo wrote: > I am getting the exact same error . did

Re: Django shopping cart example

2012-10-20 Thread Amyth Arora
Try this $(document).ajaxSend(function(event, xhr, settings) { function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) {

Re: Duplicate entry in database on refreshing the submitted form

2012-09-29 Thread Amyth Arora
As Tim said use "redirect" instead of "render". Alternatively on form submit you can also have some kind of validation for ex: Query for one reference_no can take place only once in 24 hours and if it is being submitted twice return an error message. This way it will be more user friendly. Also,

Re: Unable to Store Decimal values to DecimalField

2012-09-27 Thread Amyth Arora
What other integer fields are there in your model ? On Thu, Sep 27, 2012 at 2:35 PM, Sergey Fursov wrote: > As I see from the stack, error produced by book.save() in File > "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118 but in you > code I can't this line of

Re: IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread Amyth Arora
Not quite sure, but it seems like the save() method is being called twice so it is trying to create insert an entry with a primary key that already exists. On Thu, Sep 27, 2012 at 2:23 PM, enemybass wrote: > http://wklej.org/id/837631/ - models, traceback, urls, views,

Re: syncdb in GeoDjango tutorial

2012-09-27 Thread Amyth Arora
post the code to WorldBorder Model. 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

Re: New Project 403 Forbidden Error

2012-09-27 Thread Amyth Arora
What View are you getting the error on ? can you post the code to the View and the template ? Thanks & Regards Amyth [Admin - Techstricks] Email - aroras.offic...@gmail.com, ad...@techstricks.com Twitter - @mytharora http://techstricks.com/ -- You received this

Re: questions about generating static web page.

2012-09-25 Thread Amyth Arora
sorry, changeuserdata = UserData.objects.filter(userid=1) to userdata = UserData.objects.filter(id=userid) On Wed, Sep 26, 2012 at 12:15 AM, Amyth Arora <aroras.offic...@gmail.com>wrote: > What do you mean by generating a Static HTML page for each user? > > From what i und

Re: questions about generating static web page.

2012-09-25 Thread Amyth Arora
What do you mean by generating a Static HTML page for each user? >From what i understand you can simply have a profile layout's html template and use simple template tags to retrieve user data. For example: 1. Define a UserData class in your models.py that will basically store all the user

Re: syncdb is not creating auth tables

2012-09-20 Thread Amyth Arora
You've changed the models after the tables were initially created. Delete the current database and create a new one. Then ->> syncdb. On Thu, Sep 20, 2012 at 1:01 PM, Mario Gudelj wrote: > Hi Djangoers, > > I'm sure I'm missing something simple but for the life of me I

Re: -bash: django-admin.py: command not found

2012-09-13 Thread Amyth Arora
Seems like your django-admin.py was not added to your system path, Try the following command sudo ln -s /usr/local/lib/python2.6/dist-packages/django/bin/django-admin.py /usr/local/bin/django-admin.py -- Thanks & Regards Amyth [Admin - Techstricks] Email -

Re: How to use FTP to upload files with Django?

2012-09-05 Thread Amyth Arora
To accept i guess as he said , he want his users to be able to upload files... On Wed, Sep 5, 2012 at 11:53 PM, Kurtis Mullins wrote: > Do you want to use FTP to serve or accept the files? > > On Wed, Sep 5, 2012 at 2:14 PM, Mando wrote: > >> Would

Re: Validating GB telephone numbers in Django forms.

2012-09-05 Thread Amyth Arora
To be frank , i am not really familiar with all possibilities of GB phone numbers, if you could throw some light on this, i might be able to help ya. On Wed, Sep 5, 2012 at 5:59 PM, g1smd.1 wrote: > > Thanks for the reply and information. > > > The jQuery validation

Re: Problem with Django recaptcha

2012-09-05 Thread Amyth Arora
This is because the re-captcha API is not able to recognize the keys ? do you have the re-Captcha settings set to automatic by any chance ? if so change it to manual and add the domains you'd want to work it on and you should have it working... On Wed, Sep 5, 2012 at 6:19 PM, Lakshmen

Re: Choosing a JS framework to go together with Django

2012-09-05 Thread Amyth Arora
I am not sure what you are exactly trying to achieve. A more issue specific topic would have been easy to understand though i can suggest you following frameworks (in particular order): 1. KnockoutJS 2. BackboneJS 3. Cappucino 4. Ember.Js 5. Sammy.JS 6. Spine.JS 7. JavascriptMVC On Wed, Sep 5,

Re: bound field object - dynamic forms

2012-09-05 Thread Amyth Arora
check if it is being passed to template. {% if issue %} {{ issue }} {% else %} Issue was not passed #Debug {% endif %} On Wed, Sep 5, 2012 at 8:45 PM, Mando wrote: > are you passing it to the template? > > > On Wednesday, September 5, 2012 7:09:57 AM UTC-5, mjh wrote:

Re: Django Interview Questions

2012-09-05 Thread Amyth Arora
after reading this guide it seems, the interviewer who asks such questions himself is new to django or more importantly to programming. When it comes to programming or codes , most of the interviewers would ask you logic based questions instead of framework based questions as technologies like

Re: Easy way to temporarily disable the need to login

2012-09-05 Thread Amyth Arora
could you post the traceback and the respective code. Most probably you'll need to disable all login_required decorators and also disable your user login based template tags in all the templates for it to work properly. On Wed, Sep 5, 2012 at 10:36 PM, Larry Martell

Re: Validating GB telephone numbers in Django forms.

2012-09-05 Thread Amyth Arora
you can alternatively use jquery to validate the field, i do not have the link handy as m on my phone right now but google validation engine, it is one of the most powerful jquery validation library which also has builtin method of validating uk phone numbers. On Sep 4, 2012 5:00 AM, "g1smd.1"

Re: Javascript Image Hollover In Django

2012-09-04 Thread Amyth Arora
Here i created a step by step tutorial with explanations for you. Enlarge Image on Hover - jQuery On Sat, Sep 1, 2012 at 3:25 AM, coded kid wrote: > When I followed your tutorial, the

Re: How to package a django application

2012-08-31 Thread Amyth Arora
I see, your actual problem is not really related either to packaging a django app or to using custom script. are you using django's in built user model ? if yes, then you can do something like this. from django.contrib.auth import authenticate, login from django.shortcuts import

Re: Javascript Image Hollover In Django

2012-08-31 Thread Amyth Arora
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.offic...@gmail.com, ad...@techstricks.com Twitter - @a_myth_

Re: How sitemaps used in the Django

2012-08-31 Thread Amyth Arora
Hey Mugdha, Have you had a look at django sitemap framework ? 1. add django.contrib.sitemaps to INSTALLED_APPS and then syncdb 2. add (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}) to urls.py 3.

Re: brute force protection

2012-08-31 Thread Amyth Arora
I agree to David, it is much better to do this at a server level instead of application level. If you want your app to take care of it, i think django-axes is the best solution, you'll just need to customize a few bits according to your needs. Even

Re: people.djangoproject.com broken

2012-08-31 Thread Amyth Arora
Have you tried visiting the website using a proxy ? On Fri, Aug 31, 2012 at 12:22 AM, creecode wrote: > Hello Timothy, > > I just tried going to the login webpage and had no problem. I'm not > registered on that website so my experience may be somewhat different. > > On

Re: About the Django URL tag {% url %}……

2012-08-31 Thread Amyth Arora
Paste the code to your urls.py and highlight which urls are not working. On Thu, Aug 30, 2012 at 8:07 PM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > Also, your URL patters should start with "^" like your first one does. > And unless you need the older version, I would upgrade to

Re: Upload Image and pdf file

2012-08-31 Thread Amyth Arora
Do you actually see anyfiles uploaded under static/finale if you manually browse the folder? or is it empty ? On Thu, Aug 30, 2012 at 7:54 PM, Dott. Tegagni Alessandro < tefari@gmail.com> wrote: > I have a project created with cms Django, and in this project i must > upload a image and pdf

Re: coding urls in templates

2012-08-31 Thread Amyth Arora
wordpress landing pages and the django project running on separate servers, so I should figure out how I can move it without changing any urls... > > > On Aug 31, 2012, at 7:45 AM, Amyth Arora <aroras.offic...@gmail.com> wrote: > > could you post the directory structure and your urls.

Re: Syncdb Error With Oracle Database - IntegrityError Exception

2012-08-31 Thread Amyth Arora
Hey Jon, I guess this is because of a bug in django. Django already has a open ticket for this bug. Check it out here . On Fri, Aug 31, 2012 at 7:17 AM, Jon Blake wrote: > Just discovered Django and trying out the Django 1.4

Re: How to package a django application

2012-08-30 Thread Amyth Arora
Using pure python scripts with django is not all that difficult, as django itself is a python package. So , you can simply have a custom script "mailserver.py" (or whatever name) and you import the script to your views and simply call the functions from your custom script under the respective user

Re: coding urls in templates

2012-08-30 Thread Amyth Arora
could you post the directory structure and your urls.py file. Thanks. On Fri, Aug 31, 2012 at 11:00 AM, Mike wrote: > Quick question: I changed my urls.py so I can run my project in a > subdirectory and I broke all the urls in my templates. Should I be using > {% url

Re: Instaling django

2012-08-30 Thread Amyth Arora
Seems you have not correctly installed django, you can follow any of the following tutorials to install the latest stable version of django according to your operating system: for windows: Install Django on Windows Tutorial for linux (ubuntu) :

Re: Django Friendly URLs

2012-08-26 Thread Amyth Arora
Good Work Jeff ! On Sun, Aug 26, 2012 at 11:47 AM, Jeff Tchang wrote: > Hey all. I've created a Django application that allows you to create > friendly/vanity urls: > https://github.com/tachang/django_friendlyurls > > There is still a lot to be desired but it gets the

Re: error in the order form

2012-08-23 Thread Amyth Arora
The reason you are getting this error is because the 'TO' argument you're passing to send_mail is not a list but a string. you're calling the send_mail function using send_mail(name, email, tema, summa) and here the TO argument you are passing is 'email' which is not a list of recipients but the

Re: What is the easy way to install DJango?

2012-08-22 Thread Amyth Arora
Here is an easy tutorial on how you can install django on windows http://techstricks.com/install-django-on-windows-7/ .I am assuming that you already have python installed on your computer, if not then First install Python using this tutorial

Re: django + TinyMce

2012-08-20 Thread Amyth Arora
you are getting the error because you are not register the tinyMCE correctly, the line that is causing this error is: admin.site.register(TinyMCEAdmin) you need to specify a model class as the first argument and then the ModelAdmin class, for example: admin.site.register(TinyMCEModel,

Re: [ImageField -Upload a valid image]

2012-08-20 Thread Amyth Arora
did you try uploading any other images ? On Mon, Aug 20, 2012 at 12:58 AM, MN TS wrote: > Hello everybody. > > I've problem. When i upload image and submit i got follow form error. >- Upload a valid image. The file you uploaded was either not an image or > a corrupted

Re: ImproperlyConfigured at /

2012-08-20 Thread Amyth Arora
Hey, seems you are using django 1.4. FYI -> django.template.loaders.app_directories.load_template_source has been deprecated so you should rather use django.template.loaders.app_directories.Loader Just change : django.template.loaders.app_directories.load_template_source TO

Re: Need Django experts to explain some of my questions in bay Area, CA

2012-08-20 Thread Amyth Arora
Hey Nirmal, Could you please post here, what problem are you facing. Thanks On Mon, Aug 20, 2012 at 9:35 AM, Nirmal Sharma wrote: > Hi, > I am building a website for non-profit work using Django but i got stuck at > one place. > It would be great if somebody help me

Re: django + TinyMce

2012-08-20 Thread Amyth Arora
Hey there, i could not really find a detailed step by step tutorial on setting tinyMCE on django, so i did one for you and for others, you can check it out here http://techstricks.com/django-tinymce-tutorial-step-by-step/ and feel free to ask any question if you face any problems On Mon, Aug 20,

Re: Mac.... Won't Download, sync to python, or install... please help

2012-08-18 Thread Amyth Arora
what do you meant by "django to go into python" ?? Once you execute "python setup.py install " from the django package it automatically install django inside python 'site-packages'. ?? On Sun, Aug 19, 2012 at 3:19 AM, phil archambault wrote: > > > On Saturday, August

Re: Django + FAPWS doesnt show the templates/view correct

2012-08-18 Thread Amyth Arora
Your Static Dir is not defined in the Server (Nginx) configuration. So as Melvin said you'll need to create an alias for your static dir in your server configuration file. On Sat, Aug 18, 2012 at 7:40 PM, Melvyn Sopacua wrote: > On 17-8-2012 11:43, keeran wrote: >> >> >>

Re: problems in installing django on windows 7

2012-08-17 Thread Amyth Arora
If you still face problem you can go through this tutorial right here -> http://techstricks.com/install-django-on-windows-7/ On Sat, Aug 18, 2012 at 7:40 AM, Amyth Arora <aroras.offic...@gmail.com> wrote: > You can either create a symlink or add the django directory to your > path

Re: problems in installing django on windows 7

2012-08-17 Thread Amyth Arora
You can either create a symlink or add the django directory to your path for it to work, on windows the django files are installed in "C:\Python27\Lib\site-packages\django". You can replace the Python directory according to the version of python you are using. On Fri, Aug 17, 2012 at 11:10 PM,

Re: Full auth solution

2012-08-17 Thread Amyth Arora
You may want to consider a library like Django Allauth by Raymond Penners, it provides majority of Social Authentication options and a Custom Registration option as well out of the box. Repository: https://github.com/pennersr/django-allauth Tutorial:

Re: Not reading from TEMPLATE_DIRS in settings.py

2012-08-17 Thread Amyth Arora
Glad that you solved it! However, i would recommend using absolute path instead of a relative path as it might break when you clone or move it to another location. On Fri, Aug 17, 2012 at 6:17 PM, madala wrote: > Thanks I solved it. Was looking up wrong directory because I

Re: Adding Button in admin form

2012-08-17 Thread Amyth Arora
Django Admin by default only provides Dropdown option for Foreign Keys. On Fri, Aug 17, 2012 at 2:56 PM, Madhu wrote: > Can you please tell me how to add the Buttom on admin form in django? > I want to add the button beside the field. > > -- > You received this message

Re: Not reading from TEMPLATE_DIRS in settings.py

2012-08-17 Thread Amyth Arora
While you get this error do you see your template dir listed on the error/debug page ? On Fri, Aug 17, 2012 at 2:46 PM, madala wrote: > Thanks you for replying. Here is traceback: > > Traceback (most recent call last): > File "/usr/lib/python2.7/wsgiref/handlers.py", line

Re: Using sessions in Django

2012-08-17 Thread Amyth Arora
You're Welcome. Glad to Help. On Fri, Aug 17, 2012 at 2:28 PM, Sandeep kaur <mkaurkha...@gmail.com> wrote: > On Fri, Aug 17, 2012 at 1:39 PM, Amyth Arora <aroras.offic...@gmail.com> > wrote: >> I think this is because you are passing it the "Session Key" instead

Re: Using sessions in Django

2012-08-17 Thread Amyth Arora
oogle 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.co

Re: Adding Button in admin form

2012-08-17 Thread Amyth Arora
oups.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. -- Best Regards, Amyth Arora +91856363 +918800212140 -- You received this mes

Re: installing django extensions

2012-08-16 Thread Amyth Arora
t; > -- > 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. >