Re: Data too long for column problem
chinese and some other complex or unicode characters takes more than one byte to be stored. but as I know char(250) means 250 bytes or you can store about 80 chinese chars if we assume 1 char takes 4 bytes. then you need to change model, and manually alter table column. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: create objects from custom SQL
http://docs.djangoproject.com/en/dev/howto/legacy-databases/#howto-legacy-databases Here is a guide that will help you to build model from current database structure. maybe you need to do some optimizations on it. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
case insensitive search
Hello all. Just now I've deployed my first django web app. it's kind of address book. everything went smoothly. http://docs.djangoproject.com/en/dev/ref/contrib/admin/ says that search_fields is case insensitive. but when I search some person using django admin, it shows exact matches with case. I need to search everything no mater what the case is. I'm using django 1.0, and sqlite3 as a storage. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: case insensitive search
> Use search_fields = ['name'] in the corresponding > class inside admin.py I did. Actually my text is Cyrillic. Just now I tested searching sample latin or english text, and search workin fine. Is it problem with non-english text? if so how i can fix it, and make work? -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: case insensitive search
> "(A bug: SQLite only understands upper/lower case for 7-bit Latin > characters. Hence the LIKE operator is case sensitive for 8-bit iso8859 > characters or UTF-8 characters. For example, the expression 'a' LIKE 'A' is > TRUE but 'æ' LIKE 'Æ' is FALSE.)." Got it. > So it sounds like you will need to move to a different DB if you want > case-insensitive searching to work for Cyrillic chars. also sqlite3 seemed very slow compared to MySQL. then I'll switch to mysql. thank you. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django along with PHP - avoiding Apache crashes
I use apache2's mpm-worker which is threaded and means very fast, requires less resource. And use PHP5 as a fastcgi, django (through python) also as fastcgi. This setup maybe difficult compared to apache modules based setup. but proven to be very fast, and no side effects. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Beginner on Django and web developing
> Hello folks, I have aready used python only in desktop. About 1 a week > ago I installed the Django 1.0 on Fedora 9. I wonder about the > djangobook, its version is 0.96 or 1.0? book's version is 1.0, but written for 0.96. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Help regarding Sqlite3
> I'm a newbie to Django, in my application i'm uisng Sqlite3 as my > Database. I've created the models as per my requirement. The database is > succesfully synchronized. After this how can i view the tables (like select > statement in Postgres) to check whether my data is successfully inserted > into the tables. you can check it by using Django admin, or sqlite command line tool. See http://www.sqlite.org/docs.html. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: php templates support
> when i use my hosting provider (mediatemple) which i believe is > running django via a fast cgi container setup. overall, the setup > seems to work, no errors, definately calling php.py, and detects the > php:file.php tags, but no php is converted into the template output. > blank text, not even the original php..so, it seems to run the php, > but never updates the templates with the output. As I understand, you want to run php script or template inside Django. Am I right? It's impossible, because Django is, as you may know, written in python. Python and PHP are completely separate languages with completely different syntax and so on. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: FastCGI and Django as a continuously running server
> The one thing left that I'd like to do is set up Django to run > continuously, even when there are no http requests. My application > runs a bunch of periodic background tasks in addition to serving up > web content, and it seems that after a few minutes with no web > activity, the app is terminated. I'm coming from the java world where > you typically have one long-running jvm which handles all requests and > does not start and stop with new Apache instances. I'd like to set up > something similar with Django. I think there is no such possibility in Apache. It terminates processes or thread after every request. > Are there any web pages or documentation people could point me to > which explain how to set this up? Again I'd like my Django app to run > continuously and have each web request make a call into an already > running python interpreter. Maybe you can use cron job to run or make request to you application periodically. Drupal uses such thing to index web pages and some other stuffs. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: One Question About Cache
> I want to use per-view cache with memcached and low-level cache with > filesystem caching. what's the advantage of having both of them? -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: DateField() value as 000-00-00
> I was trying to parse their data and replace it empty date fields > values by a '-00-00', no luck. maybe you should try to set default value in database engine. as I know mysql supports it, and inserts default value if no value has been provided. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Fixtures erase data?
> I just set up a few fixtures for some of my models and realized that > every time I syncdb it changes the existing data in my database. I > assume this is normal behavior, but I was wondering if it is possible > to have the fixtures only *add* data and not change it? As I understand, and also as documented syncdb doesn't change existing table. you should modify your model, after or before that you should alter your table to consist with model. > I have a fixture that adds a row to my model with the value "foo", > then I change it in the admin to "bar", then syncdb, it gets changed > back to "foo". Is there a way to keep the changed value of "bar"? after changing row you don't need to run syncdb, just save it. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: apache and django
> Ok. But are the configuration lines any different or will they > change. If anyone has a good tutorial written could you please post > it. Also, What does this line mean ? > SetEnv DJANGO_SETTINGS_MODULE mysite.settings See http://httpd.apache.org/docs/2.2/mod/mod_env.html. I suggest you to do some research by yourself. -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: apache and django
Please follow instructions on http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ to setup django and mod_python. And it's interesting that how do you know that mod_python is working? -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: apache and django
> Thank you, but as I've mentioned I have tried to follow these > instructions and have had no luck. Why is it instructing me to > configure my httpd.conf file when my sub domain exists in sites- > available/sites-enabled? It seems that you use Debian based distro. Debian based systems have separate site files instead of one big config file. And you should do it that way. You may consider using default or you own. https://help.ubuntu.com/8.04/serverguide/C/httpd.html -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Too Many Connections
> File > "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py", > line 74, in Connect > > File > "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/connections.py", > line 170, in __init__\nsuper(Connection, self).__init__(*args, > **kwargs2) > > OperationalError: (1040, 'Too many connections') as you can see above, it's mysql problem. mysql server have some default limitation on concurrent connections. you can increase max_connections in my.cnf. depending on your linux distro my.cnf may be located in different places. for me, or on ubuntu it's at /etc/mysql/my.cnf, and you need to uncomment the line, and increase the value. by default mysql gets 100 concurrent connections. and the question is why is dev site is getting that much connection? -- Regards Dulmandakh --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---