Advanced Search in django

2013-06-27 Thread Harjot Mann
How can we add advance search in django like google's advance search??

-- 
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: forloop breaking

2013-06-27 Thread Harjot Mann
On Thu, Jun 27, 2013 at 11:40 AM, yati sagade  wrote:
> I doubt she has a problem with the Python for-loop. She is trying to achieve
> similar control flow in the Django templating language's for loop.


I want to remove the static heading of a table in django templates in
which the data is coming form database which is dynamic so I want if
there is no entry in that column it should not display even its
heading by any means with html, in python.

--
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.




Re: Advanced Search in django

2013-06-27 Thread Peith Vergil
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.

-- 
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: django deploy structure

2013-06-27 Thread mulianto
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+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.
> 
> -- 
> 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.
>  
>  

-- 
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: forloop breaking

2013-06-27 Thread abhijeet shete
Hi,

You can achieve this by using javascript or jquery. Just check this
example : http://jsfiddle.net/pxbW9/


I want to remove the static heading of a table in django templates in
> which the data is coming form database which is dynamic so I want if
> there is no entry in that column it should not display even its
> heading by any means with html, in python.
>


Regards.
Abhijeet Shete
Software Engineer | mquotient |  Mobile +91.9860219715

-- 
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-27 Thread Harjot Mann
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.




Re: Advanced Search in django

2013-06-27 Thread Peith Vergil
What I would probably do in that situation is setup Whoosh and
django-haystack. Then use Haystack's EdgeNgramField on your user model's
firstname and lastname.


On Thu, Jun 27, 2013 at 4:33 PM, 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.
>
>
>

-- 
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.




configure apache for shared hosting using fcgi

2013-06-27 Thread Sheila
Following the django book 
https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache
 I 
am trying to deploy my project on shared host. 
To try it first I am using a virtual Ubuntu 10.04 server. In my server user 
can access http://localhost/~USER/ and if I put any html in 
/home/user/public_html it can be access. 
But the method in the book using .htacess and fastcgi do not work. I am 
suspecting that my apache2 configuration is wrong. 
Can someone tell me what do I need to change in my apache2 configuration to 
set up share hosting?? I am new to apache2 :(

-- 
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: Multiple TaggableManager() on model [django-taggit]

2013-06-27 Thread Thierry Ballzac
This solution did the business for me nicely!

https://neutron-drive.appspot.com/blog/multiple-tags


On Tuesday, July 17, 2012 12:52:55 PM UTC+1, Alir3z4 wrote:
>
> Hi
> This question is about having more than one 
> taggit
> .managers
> .TaggableManageron
>  model.
> I guess many people have faced with this issue before, But i couldn't find 
> any *complete* correct solution for it.
> And also there is #50 
> issue/ticket opened since 
> one year ago on the taggit's github repo, and 
> couple of solution provided which none of them is the correct solution.
> So how you implement a model with more than 1 TaggableManager ?
>
> 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.
For more options, visit https://groups.google.com/groups/opt_out.




Dynamic constructions of URLs in Django

2013-06-27 Thread Nafiul Islam
Hi, I was reading the docs here 
: https://docs.djangoproject.com/en/dev/topics/http/urls

In overview, it says that you because the URLConf is written in Python it 
can be dynamically constructed. What does that mean, and what does it imply 
for a developer like myself?

-- 
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: Save String /Value to Table Entry

2013-06-27 Thread Bill Freeman
There are several approaches:

1. Your code that currently reads the string could connect to the Django
site via HTTP, log in as a user to which you have given suitable
permissions, and know enough about how to talk to the admin interface to
create and populate instances of the model that you have designed to hold
the strings.

2. Similar to 1, but using a custom view you have written (possibly
RESTful) that is single purpose for creating the populated model instances,
and designed to be easier for a program to talk to.

3. Your program could create a Django "fixture" file containing the
information, which can then be loaded using manage.py loaddata to load it
into Django.  See https://docs.djangoproject.com/en/1.5/howto/initial-data/

4. Assuming that your existing code is in python, write a new management
command based on it that fetches your strings as now, and then directly
saves them using the ORM.

5. Have your program use an independent connection to the database that is
backing Django to create the rows directly.

I suspect that 3 or 4 are the simplest to code, but will require more
Django study than that required to put up a web site.

Bill


On Wed, Jun 26, 2013 at 5:28 PM, hiQ  wrote:

> I currently use Microsoft Visual Studio 2010 Express *(my hardware is
> working under Windows)* and have created an application that can read
> strings from an external source and display them on Msgbox's.
>
> I would like to save these values into an table in django so I can query
> them later. Is this possible. May I ask for some tutorial references or
> guidance?
>
> 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.
> 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: View pictures from the template via models.FilePathField

2013-06-27 Thread Federico Erbea
but ImageField, you should not use to save the imported files by users?

-- 
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.




DateTimeField returns an hour

2013-06-27 Thread Hélio Miranda
Hi!
I have a problem and do not know what's wrong.
I have a field defined with time DateTimeField ...
When I insert eg 20:30 19:30 he returns, returns with an hour ...

Someone can explain me why?

thank you

-- 
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: configure apache for shared hosting using fcgi

2013-06-27 Thread Bill Freeman
While I don't know the details, I do know that use of .htaccess files (and
I'm pretty sure there are two "c"s, as I have it, but at lest in your
email, you have one) must be explicitly enabled in apache's configuration.
That's because checking for .htaccess files in every directory slows apache
down.  See: http://httpd.apache.org/docs/current/howto/htaccess.html


On Thu, Jun 27, 2013 at 6:06 AM, Sheila  wrote:

> Following the django book
> https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache
>  I am trying to deploy my project on shared host.
> To try it first I am using a virtual Ubuntu 10.04 server. In my server
> user can access http://localhost/~USER/ and if I put any html in
> /home/user/public_html it can be access.
> But the method in the book using .htacess and fastcgi do not work. I am
> suspecting that my apache2 configuration is wrong.
> Can someone tell me what do I need to change in my apache2 configuration
> to set up share hosting?? I am new to apache2 :(
>
>  --
> 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.
>
>
>

-- 
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: Dynamic constructions of URLs in Django

2013-06-27 Thread Bill Freeman
I suspect that this just means that you can add or not add url patterns,
and adjust the contents of the regular expression or other members of the
url pattern object, based upon information AVAILABLE AT IMPORT TIME, such
as settings.DEBUG, settings.INSTALLED_APPS, socket.gethostname(), etc.


On Thu, Jun 27, 2013 at 9:39 AM, Nafiul Islam wrote:

> Hi, I was reading the docs here :
> https://docs.djangoproject.com/en/dev/topics/http/urls
>
> In overview, it says that you because the URLConf is written in Python it
> can be dynamically constructed. What does that mean, and what does it imply
> for a developer like myself?
>
> --
> 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.
>
>
>

-- 
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.




Add dynamically form to Formset

2013-06-27 Thread Mário Idival
Hello,
How you do for add more formset in form with Django 1.5?

-- 
Mário Idival

*Twitter *: *@marioigd*
*Facebook*: *mario.idival*
*User Linux : **#554446*
Skype*: marioidival*

-- 
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.




Customize the admin look and feel

2013-06-27 Thread krazyXplorer
I am new to Django and got stuck at 
Tutorial 2 - Customize the admin look and feel


When I directly went into *
C:\Python27\Lib\site-packages\django\contrib\admin\templates\admin\base_site.html
* and made changes in *base_site.html* there was no problem and I didn't 
even had to edit the *TEMPLATE_DIRS (...)*


But When I copy the *base_site.html* into *C:\xampp\htdocs\mytemplates\admin
* and edit *TEMPLATE_DIRS (...)*  to

TEMPLATE_DIRS = (
"C:/xampp/htdocs/mytemplates/admin/base_site.html"
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)*
*

*There was no Change in admin look 
*

*Please help ..what am I doing wrong ??
*

-- 
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.




New user: example database tables not found

2013-06-27 Thread rshepard
I'm working my way through the django-1.5.1 manual. Following instructions 
to create the polls sample site I see on page 29 to run 'python manage.py 
syncdb' to create the model tables in the postgres database. However, when 
I run 'psql -l' I do not see the sample database. What might I have done 
incorrectly?

Rich

-- 
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.




Setting up django with mongoengine on windows7

2013-06-27 Thread Dave Francois
So I am trying to set mongo-engine as django's back-end and am having no 
luck :/ so if someone can point me in the direction of a really good guide 
to follow or can walk through setup with me that would be greatly 
appreciated 

-- 
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: Customize the admin look and feel

2013-06-27 Thread Jygga fey
Try it like this:

TEMPLATE_DIRS = (
"C:/xampp/htdocs/mytemplates/"
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

You are expected to list locations (in other words: directories, hence the 
DIRS part) of where the loader will look for templates, in search order. 
[see https://docs.djangoproject.com/en/1.5/ref/settings/#template-dirs]

Since the docs are not really descriptive there, here is a simplified 
explanation:
When defining the template to be used with a context, built in a view, you 
will always give a relative path, starting from any path you set in 
TEMPLATE_DIRS, at least that is how you can easily remember what to put 
where.
The same principle works for the admin views. The view is telling the 
loader to load the template "admin/base_site.html", so the loader will 
prepend each template_dirs to that starting with the first, checking if 
there is a template there and return it when its found.

Hope that helps.


Am Donnerstag, 27. Juni 2013 18:46:40 UTC+2 schrieb krazyXplorer:
>
> I am new to Django and got stuck at 
> Tutorial 2 - Customize the admin look and feel
>
>
> When I directly went into *
> C:\Python27\Lib\site-packages\django\contrib\admin\templates\admin\base_site.html
> * and made changes in *base_site.html* there was no problem and I didn't 
> even had to edit the *TEMPLATE_DIRS (...)*
>
>
> But When I copy the *base_site.html* into *
> C:\xampp\htdocs\mytemplates\admin* and edit *TEMPLATE_DIRS (...)*  to
>
> TEMPLATE_DIRS = (
> "C:/xampp/htdocs/mytemplates/admin/base_site.html"
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )*
> *
>
> *There was no Change in admin look 
> *
>
> *Please help ..what am I doing wrong ??
> *
>

-- 
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: Customize the admin look and feel

2013-06-27 Thread Tomas Ehrlich
Hi there,
please try:

TEMPLATE_DIRS = (
"C:/xampp/htdocs/mytemplates/"
)

After all, it's TEMPLATE_DIRS not TEMPLATE_FILES. It should contain
directories with templates.

Cheers,
  Tom


Dne Thu, 27 Jun 2013 09:46:40 -0700 (PDT)
krazyXplorer <1.kc.d...@gmail.com> napsal(a):

> I am new to Django and got stuck at 
> Tutorial 2 - Customize the admin look and feel
> 
> 
> When I directly went into *
> C:\Python27\Lib\site-packages\django\contrib\admin\templates\admin\base_site.html
> * and made changes in *base_site.html* there was no problem and I didn't 
> even had to edit the *TEMPLATE_DIRS (...)*
> 
> 
> But When I copy the *base_site.html* into *C:\xampp\htdocs\mytemplates\admin
> * and edit *TEMPLATE_DIRS (...)*  to
> 
> TEMPLATE_DIRS = (
> "C:/xampp/htdocs/mytemplates/admin/base_site.html"
> # Always use forward slashes, even on Windows.
> # Don't forget to use absolute paths, not relative paths.
> )*
> *
> 
> *There was no Change in admin look 
> *
> 
> *Please help ..what am I doing wrong ??
> *
> 

-- 
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: How to store site-wide application settings

2013-06-27 Thread Felipe Coelho
2013/6/27 rush 

> Hi,
>
> Could please somebody advice how to store application settings and allow
> to edit them via admin panel?
> Settings are used site-wide, not on per user basis.
>
> This settings have different types ( text, ineteger, images aka banners )
> therefore it looks impossible to create "settings" model and store it in
> "item" - "value" fields.
>
> From the other hand it looks unreasonable to make a lot of models and put
> one or two rows into each of them.
>
> What is the best practice for that?
>
> ps. For example I have to allow configure following things: welcome text,
> 2 banners and 3 links to item from foreign application. It is easy to
> hardcode them into template, but it would be very a bit annoying to edit
> the code each time to modify something from it.
>

Hi,

I have not used those, but the djangopackages.com site has a section with a
few apps that deal with what you need:

https://www.djangopackages.com/grids/g/configuration/

-- 
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: How to store site-wide application settings

2013-06-27 Thread der_fenix
Quick way is create one model with fields, that equals all params. I.e. for 
your example - field with welcome text, two fields with banners and 3 fields 
for links. So you'll have one record in table with all needed parametrs. 
Of course this way isn't acceptable if you'll have over hundred params, but if 
it is ~10-20 params - it is the easiest and most suitable option.

> Hi,
>  
> Could please somebody advice how to store application settings and allow to
> edit them via admin panel? Settings are used site-wide, not on per user
> basis.
> 
> This settings have different types ( text, ineteger, images aka banners )
> therefore it looks impossible to create "settings" model and store it in
> "item" - "value" fields.
> 
> From the other hand it looks unreasonable to make a lot of models and put
> one or two rows into each of them.
> 
> What is the best practice for that?
> 
> ps. For example I have to allow configure following things: welcome text, 2
> banners and 3 links to item from foreign application. It is easy to
> hardcode them into template, but it would be very a bit annoying to edit
> the code each time to modify something from it. 
> --
> wbr,
> rush.
> --
> 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.
>  
>  

signature.asc
Description: This is a digitally signed message part.


Static files not served

2013-06-27 Thread Sithembewena Lloyd Dube
Hi all,

I have a local development project where I put all static media in a
'static' subdirectory of my app (/project/app/static/). I then created a
'static' directory in the root folder of my project (/project/static/) and
specified that as my STATIC_ROOT in settings.py.

When I run the './manage.py collectstatic' command, all static media are
added to the static root as expected. In the templates, usage is as
follows: '' and so
on, but when I view the page in a browser the CSS and js are not applied.
If I view page source and click on the generated links to static resources,
I do see them.

One thing I do notice is that two of the missing css files are in the
document's noscript tag and the links for all three are not clickable when
viewing source. There are three in there, so one loads fine.

Any pointers to what I could be missing? Thanks.
-- 
Regards,
Sithu Lloyd Dube

-- 
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: Static files not served

2013-06-27 Thread Sithembewena Lloyd Dube
Update: removing the noscript tags around the css tags in the template
solves the issue. I am no clientside scripting expert, but it is my
understanding that noscript tags accommodate browsers with scripting turned
off, or legacy browsers? Surely the css should work by default?

I know this is not an html mailing list, but has anybody else encountered
this?

Another thing i noticed is that all this is not a problem when i view the
templates from outside a Django project - i.e. as a standalone html website.


On Thu, Jun 27, 2013 at 10:08 PM, Sithembewena Lloyd Dube  wrote:

> Hi all,
>
> I have a local development project where I put all static media in a
> 'static' subdirectory of my app (/project/app/static/). I then created a
> 'static' directory in the root folder of my project (/project/static/) and
> specified that as my STATIC_ROOT in settings.py.
>
> When I run the './manage.py collectstatic' command, all static media are
> added to the static root as expected. In the templates, usage is as
> follows: '' and so
> on, but when I view the page in a browser the CSS and js are not applied.
> If I view page source and click on the generated links to static resources,
> I do see them.
>
> One thing I do notice is that two of the missing css files are in the
> document's noscript tag and the links for all three are not clickable when
> viewing source. There are three in there, so one loads fine.
>
> Any pointers to what I could be missing? Thanks.
> --
> Regards,
> Sithu Lloyd Dube
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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: Static files not served

2013-06-27 Thread der_fenix
Is there you main static dir in STATIC_URL in settings.py?

> Update: removing the noscript tags around the css tags in the template
> solves the issue. I am no clientside scripting expert, but it is my
> understanding that noscript tags accommodate browsers with scripting turned
> off, or legacy browsers? Surely the css should work by default?
> 
> I know this is not an html mailing list, but has anybody else encountered
> this?
> 
> Another thing i noticed is that all this is not a problem when i view the
> templates from outside a Django project - i.e. as a standalone html website.
> 
> 
> On Thu, Jun 27, 2013 at 10:08 PM, Sithembewena Lloyd Dube  > wrote:
> > 
> > Hi all,
> > 
> > I have a local development project where I put all static media in a
> > 'static' subdirectory of my app (/project/app/static/). I then created a
> > 'static' directory in the root folder of my project (/project/static/) and
> > specified that as my STATIC_ROOT in settings.py.
> > 
> > When I run the './manage.py collectstatic' command, all static media are
> > added to the static root as expected. In the templates, usage is as
> > follows: '' and so
> > on, but when I view the page in a browser the CSS and js are not applied.
> > If I view page source and click on the generated links to static
> > resources,
> > I do see them.
> > 
> > One thing I do notice is that two of the missing css files are in the
> > document's noscript tag and the links for all three are not clickable when
> > viewing source. There are three in there, so one loads fine.
> > 
> > Any pointers to what I could be missing? Thanks.
> > --
> > Regards,
> > Sithu Lloyd Dube

signature.asc
Description: This is a digitally signed message part.


A PHP framework with some Django features?

2013-06-27 Thread thomaaaas
Hello,

I have a PHP background, and I'm learning Django.
Long story short: I love Django, but some things are really painful to do 
(configuration, media/static content, etc.).

That's why I want to know if there is a PHP framework that has some of 
Django's really cool features:
- Automatically creates the SQL table from the model
- Automatically creates an admin

Thanks for your help

-- 
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.




I am having trouble using ajax with model form set.

2013-06-27 Thread yeswanth nadella


EventsFormSet =  modelformset_factory(Events, extra=0)
if request.method == 'POST':
formset = EventsFormSet(request.POST)
if formset.is_valid():
formset.save(); 
return HttpResponseRedirect('/sucess/')
   else:
   formset = 
EventsFormSet(queryset=Events.objects.filter(date__day=current_day, 
date__month=current_month, date__year = current_year))
   return render(request, template_name, {'formset': formset})

The above does not work. But this code works

EventsFormSet =  modelformset_factory(Events, extra=0)
formset = 
EventsFormSet(queryset=Events.objects.filter(date__day=current_day, 
date__month=current_month, date__year = current_year))
return render(request, template_name, {'formset': formset})

This is my jquery

$(document).ready(function() 
{
$(".foo").click(function()
{
var day = $(this).text()
day = day.substring(0, 2);
$.post('/foo/',{day:day}, function(data) 

{
$("aside").hide().html(data).fadeIn("4000");
window.scrollTo(0, 0);
});
});
});

-- 
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: Django-admin-tools unicode problem

2013-06-27 Thread Jaimerson Leandro Amaro de Araújo
Cara, o problema é que a exceção tá sendo no template do aplicativo, que lê 
as informações do banco de dados. Alterar os arquivos do admin-tools é 
inviável em termos de portabilidade na hora do deploy. O que eu quero saber 
é se é possível mudar o encoding padrão desse app.

Em quarta-feira, 26 de junho de 2013 11h22min18s UTC-3, Odin escreveu:
>
> Jaimerson, ainda assim creio que você deva tentar adicionar ao topo de 
> suas views e/ou dos módulos usados do admin-tools a linha:
>
> # -*- coding: utf-8 -*- ou # -*- coding: iso-8859-1 -*-
>
> Isso permitirá ao Python ler o arquivo no encoding definido.
>
>
> 2013/6/26 Jaimerson Leandro Amaro de Araújo 
> >
>
>> Uh, I know it`s an encoding problem, I was hoping there was a way of 
>> changing default charset for that app.
>>
>> Em quarta-feira, 26 de junho de 2013 10h16min02s UTC-3, Odin escreveu:
>>>
>>> Think it's an encode problem. I never use this app but try to add this 
>>> line o top of your views file:
>>>
>>> # -*- coding: utf-8 -*-
>>>
>>>
>>> 2013/6/26 Jaimerson Leandro Amaro de Araújo 
>>>
 (I posted this on django-admin-tools mail list, but apparently there's 
 no one alive there)


 Hello, I'm stuck in a encoding issue, on the dashboard template. Some 
 of my models have fields with non-ascii characters (like "à" or "á"), and 
 when I try to load the page, I get the following error:
 DjangoUnicodeDecodeError at / 

 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in 
 range(128).
 You passed in  
 ()

 [...]
 Unicode error hint 

 The string that could not be encoded/decoded was: *Conte��do*
 Please, advise. 

 -- 
 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.




Django automatically formatting ints with commas, bug?

2013-06-27 Thread Stryder Crown
Any body know why django would format an integer as a comma seperated 
value?  i.e. 1578 becomes 1,578?
No, I'm not using humanize and only loading il8n and sekizai tags...The 
only way I've found to force it to render correctly is to use 
'|stringformat:"s"'.

Usage:
{% load i18n sekizaitags %}
Element {{ element.id }} 

That's 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.
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: Django automatically formatting ints with commas, bug?

2013-06-27 Thread carlos
try this
https://docs.djangoproject.com/en/dev/ref/settings/#decimal-separator

Cheers


On Thu, Jun 27, 2013 at 7:32 PM, Stryder Crown  wrote:

> Any body know why django would format an integer as a comma seperated
> value?  i.e. 1578 becomes 1,578?
> No, I'm not using humanize and only loading il8n and sekizai tags...The
> only way I've found to force it to render correctly is to use
> '|stringformat:"s"'.
>
> Usage:
> {% load i18n sekizaitags %}
> Element {{ element.id }} 
>
> That's 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.
> 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.
>
>
>

-- 
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: Static files not served

2013-06-27 Thread Sithembewena Lloyd Dube
Hi @der_fenix,

My STATIC_URL setting is as follows: STATIC_URL = '/static/'

I suspect that Django's development server's static serving does not like
noscript tags? I have no idea. I might poke around later ... starting from
Django's 'django.contrib.staticfiles.views.serve()' call.


On Thu, Jun 27, 2013 at 10:47 PM, der_fenix  wrote:

> Is there you main static dir in STATIC_URL in settings.py?
>
> > Update: removing the noscript tags around the css tags in the template
> > solves the issue. I am no clientside scripting expert, but it is my
> > understanding that noscript tags accommodate browsers with scripting
> turned
> > off, or legacy browsers? Surely the css should work by default?
> >
> > I know this is not an html mailing list, but has anybody else encountered
> > this?
> >
> > Another thing i noticed is that all this is not a problem when i view the
> > templates from outside a Django project - i.e. as a standalone html
> website.
> >
> >
> > On Thu, Jun 27, 2013 at 10:08 PM, Sithembewena Lloyd Dube <
> zebr...@gmail.com
> > > wrote:
> > >
> > > Hi all,
> > >
> > > I have a local development project where I put all static media in a
> > > 'static' subdirectory of my app (/project/app/static/). I then created
> a
> > > 'static' directory in the root folder of my project (/project/static/)
> and
> > > specified that as my STATIC_ROOT in settings.py.
> > >
> > > When I run the './manage.py collectstatic' command, all static media
> are
> > > added to the static root as expected. In the templates, usage is as
> > > follows: '' and
> so
> > > on, but when I view the page in a browser the CSS and js are not
> applied.
> > > If I view page source and click on the generated links to static
> > > resources,
> > > I do see them.
> > >
> > > One thing I do notice is that two of the missing css files are in the
> > > document's noscript tag and the links for all three are not clickable
> when
> > > viewing source. There are three in there, so one loads fine.
> > >
> > > Any pointers to what I could be missing? Thanks.
> > > --
> > > Regards,
> > > Sithu Lloyd Dube
>



-- 
Regards,
Sithu Lloyd Dube

-- 
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: A PHP framework with some Django features?

2013-06-27 Thread Rene Vallecillo
I guess you could try http://symfony.com/


On Thu, Jun 27, 2013 at 3:13 PM, thoms  wrote:

> Hello,
>
> I have a PHP background, and I'm learning Django.
> Long story short: I love Django, but some things are really painful to do
> (configuration, media/static content, etc.).
>
> That's why I want to know if there is a PHP framework that has some of
> Django's really cool features:
> - Automatically creates the SQL table from the model
> - Automatically creates an admin
>
> Thanks for your help
>
> --
> 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.
>
>
>



-- 
¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸¸ Rene V²¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,

-- 
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: A PHP framework with some Django features?

2013-06-27 Thread yeswanth nadella
Even cake php framework does create db tables from models. The only thing 
is that you need to install a third party application. 

On Thursday, June 27, 2013 4:13:38 PM UTC-5, thoms wrote:
>
> Hello,
>
> I have a PHP background, and I'm learning Django.
> Long story short: I love Django, but some things are really painful to do 
> (configuration, media/static content, etc.).
>
> That's why I want to know if there is a PHP framework that has some of 
> Django's really cool features:
> - Automatically creates the SQL table from the model
> - Automatically creates an admin
>
> Thanks for your help
>

-- 
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: Add dynamically form to Formset

2013-06-27 Thread yeswanth nadella
Can you explain a little more?

On Thursday, June 27, 2013 11:22:14 AM UTC-5, Mário Idival wrote:
>
> Hello,
> How you do for add more formset in form with Django 1.5?
>
> -- 
> Mário Idival
>
> *Twitter *: *@marioigd*
> *Facebook*: *mario.idival*
> *User Linux : **#554446*
> Skype*: marioidival*
>  

-- 
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: Customize the admin look and feel

2013-06-27 Thread krazyXplorer
Hey Thanks Tomas Ehrlich and Jygga fey it worked !!

At first it didn't worked
I was referring to lots of suggestions and then made a mistake of adding *
admin:* in the base_site.html so got this error
TemplateDoesNotExist at /admin/ 

admin:admin/base.html

 Request Method: GET  Request URL: http://127.0.0.1:8000/admin/  Django 
Version: 1.5.1  Exception Type: TemplateDoesNotExist  Exception Value: 

*admin:admin/base.html*

 Exception Location: C:\Python27\lib\site-packages\django\template\loader.py 
in find_template, line 139  Python Executable: C:\Python27\python.exe  Python 
Version: 2.7.3

But now everything is working just fine Thanks a Lot !!  Cheers !!

-- 
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.