send_mail on MAC OS X 10.7

2012-10-01 Thread Cheng
after that. Would be grateful if someone can help. Thanks, Cheng -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/r40DN0e3ybAJ. To post to this g

Re: send_mail on MAC OS X 10.7

2012-10-02 Thread Cheng
Hi Laxmikant, Do you mean this statement (I can't find any other that refers to csrf) in settings 'django.middleware.csrf.CsrfViewMiddleware', I commented it, but it still gives me error 61 - Connection refused. Thanks, Cheng Hong On Monday, October 1, 2012 10:36:43 PM U

Re: send_mail on MAC OS X 10.7

2012-10-03 Thread Cheng
on is imap.googlemail.com. Thanks, Cheng On Tuesday, October 2, 2012 9:45:17 AM UTC-7, Dennis Lee Bieber wrote: > > On Tue, 2 Oct 2012 07:25:39 -0700 (PDT), Cheng > > > > declaimed the following in gmane.comp.python.django.user: > > > > > I commented it, but i

Re: send_mail on MAC OS X 10.7

2012-10-03 Thread Cheng
Hi Kobe, I am not familiar with the Mac's setup. Do you mean the Mac's Mail application? If so, yes. If not, how do I start the sendmail program? Thanks, Cheng On Wednesday, October 3, 2012 1:37:45 AM UTC-7, Kolbe wrote: > > did you start the sendmail program? > > On Tu

varible reference in template problem

2008-10-06 Thread Stephen Cheng
Hi django friends I got a problem with varible reference in template. the case is like this: I pass a map to a template, I am trying to get map[key], in the case the key= modelA.id, then I have to use map.modelA.id, then it won't work. How can I conquer this? Can I assign modelA.id to another v

form submission problem

2008-10-09 Thread Stephen Cheng
I defined a field title in model the max length is 30 title=models.CharField("Title",max_length=30) while after I key in none - english characters, eg, Chinese and submit the form, it [database] can only take 10 Chinese characters,otherwise raise an exception. I also use an validation rule in th

Re: form submission problem

2008-10-09 Thread Stephen Cheng
if len(str(price))+len(self.clean_title())> 10: raise forms.ValidationError("The length of title plus price should be less than 10 characters") return price class Meta: model=Card On Oct 9, 10:26 pm, Malcolm Tredinnick <

Re: form submission problem

2008-10-09 Thread Stephen Cheng
Sorry about the silly question. This is resolved. All are documented: http://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validation-in-practice Thanks for your help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

distinct for ForeignKey field

2008-10-11 Thread Stephen Cheng
I am wondering how to get distinct values for a ForeignKey field For example: class ModelA(models.Model): . city=models.ForeignKey(City) I understand that I can pass the list to template than probably use regroup and get the group values, but is there a ef

subdomains cookie problem

2009-06-28 Thread Stephen Cheng
Hi I am facing a problem in DEV server that I really have no idea how to resolve, which is related to cookie variable for subdomains. I use wildcard subdomains, eg. sub1.abc.com, sub2.abc.com, sub3.abc.com and all sub domains point to one running instance of django app. The problem is that I ho

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
ly when the request reaches > the server. > > -- Raja > > On Jun 29, 9:21 am, Stephen Cheng wrote: > > > Hi > > > I am facing a problem in DEV server that I really have no idea how to > > resolve, which is related to cookie variable for subdomains. > > >

Re: subdomains cookie problem

2009-06-29 Thread Stephen Cheng
Hi Raja This looks great. Thanks for helping out. Stepehn On Jun 29, 9:17 pm, Raja wrote: > Setup thecookie.domain attribute value to '.mydomain.com' (The first > dot is important) and all hosts in that domain will get thecookie. > > -- Raja > > On Jun 29, 4

Pass context vars to django-registration

2009-05-07 Thread Stephen Cheng
I have got a case like this: I have a drop down list of value of 8 cities which requires a db query every time when every page loads. The problem is when the url is diverted to django-registration module, then I don't know how to properly pass the citylist as a context value to django-registration

Admin page with my own themes/skins

2009-05-07 Thread Stephen Cheng
I have thought this for quite a while and no idea so far. I like the forms/pages auto generated by Admin engine, but I also want to incorporate some of the forms/pages into my site with following expectations: 1. I can use my own template. 2. use my own template and also use the context variables

Re: Pass context vars to django-registration

2009-05-07 Thread Stephen Cheng
No bother, I have found the solution. Simply use the ContextProcessor. On May 7, 10:27 pm, Stephen Cheng wrote: > I have got a case like this: I have a drop down list of value of 8 > cities which requires a db query every time when every page loads. The > problem is when the url is di

Why file path and name disappear for Image Field when/after validation

2009-05-23 Thread Stephen Cheng
I suppose that all the fields' value in the form defined in model can be captured and remained when/after you do form validation. My problem is that : 1. When the form is not valid, the filename of image field is gone once you click submit or 2. If I intend to do something else once all fields ar

Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-05-31 Thread Stephen Cheng
Hi Guys This is a very strange problem and I haven't resolved it. Dev Web server just crash with a python.core dump and no exception log at all. Problem occurs when you go around the Admin page, either refresh page, add record, delete record. Now I can reproduce it by keeping refresh the admin p

How to handle asian language?

2008-06-01 Thread Stephen Cheng
I got exception in admin page when I input chinese character into one field and try to save to db. I am not sure which lib I should install to make it work or any configure I should enable. Any advice? UnicodeEncodeError at /admin/books/author/add/ 'ascii' codec can't encode characters in posi

Re: Strange:Dev Web server crash with a python.core dump after Admin page being refreshed exactly 16 times

2008-06-01 Thread Stephen Cheng
ave done or switched on during the process, it's just working fine now :) Hope this help some others. On Jun 2, 12:32 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sun, Jun 1, 2008 at 2:41 AM, Stephen Cheng <[EMAIL PROTECTED]> > wrote: > > > > > &

Re: Dojo vs Mochikit for Django dev?

2006-10-17 Thread Cheng Zhang
ine.html [3] http://visualjquery.com/ -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Django & Movable Python

2006-10-25 Thread Cheng Zhang
ou can > also play with it. Hell, we can even make a small project "Django on a > stick" and spread that nice warm feeling called Django to the rest of > the world :) > > Ideas? Suggestions? Cool idea, +1! Please get something started soon. -Cheng Zhang http://www.ifaxian.

Re: How to auto create a from Model just the Admin do?

2006-10-30 Thread Cheng Zhang
zsp007: Because English is the default language of this m-list, please try not to have Chinese characters within your post, that might confuse other non-Chinese speaking participants. Thanks. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http:/

Re: looking for Django Contractors

2006-11-01 Thread Cheng Zhang
ou are interested in working with engagement manager located in San Francisco, California and engineering team in Beijing, China, we can discuss more. BR, -Cheng Zhang Gentoo/Python/Django Powered http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powe

Re: So I made a forum with Django

2006-11-03 Thread Cheng Zhang
quite powerful. Another happy Django story. :-) +1! Looking forward to. -Cheng Zhang Gentoo/Python/Django Powered http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese --~--~-~--~~~---~--~~ You r

Re: High Load

2006-12-08 Thread Cheng Zhang
go app is running on Gentoo 2006.1, Postgres 8.1.5, Lighttpd w/ scgi. The speed to the site is visually slow. [1] http://www.linode.com/products/linodes.cfm -Cheng Zhang Gentoo/PostgreSQL/Lighttpd/Python/Django/jQuery Powered (Web) http://www.aragonconsultinggroup.com http://www.ifaxian.com 1st Djang

IOError: Client read error (Timeout?)

2006-07-02 Thread Qi Cheng
Hi, guys. This is a problem that troubled me for months, but maybe it is very easy to you. I guess it is an problem that has something relation with mod-python or cookie, but I am not sure. Since many corresponding softwares I use, between our production and develope server, are the same except L

Re: Compilation of 30 Django tutorials

2006-07-18 Thread Cheng Zhang
Great collection. :-) Will it be more informational if there is one line of summary for each tutorial? - Cheng On Jul 18, 2006, at 3:34 AM, [EMAIL PROTECTED] wrote: > > Hi all, > > I put together a compilation of 30 Django tutorials. They're mostly > from the community p

Re: New - monkey

2006-07-23 Thread Cheng Zhang
Of 'coz you can download everything needed on your windows box, then transfer over. - Cheng On Jul 21, 2006, at 7:59 PM, Rajeshwar Singh Jenwar wrote: > Hi ALL, > I m new to Django. > My linux box does not have net connection. > Can someone suggest me how to intsall Dja

Re: [Changeset] r3455 - django/trunk/docs

2006-07-26 Thread Cheng Zhang
Adrian Would you mind to point out which OSCON presentation it is? Just curious. Thanks. - Cheng Zhang On Jul 27, 2006, at 8:46 AM, [EMAIL PROTECTED] wrote: > > Author: adrian > Date: 2006-07-26 19:46:32 -0500 (Wed, 26 Jul 2006) > New Revision: 3455 > > Modified: >

Re: generic ModifiedPreorderTreeTraversal app

2006-07-26 Thread Cheng Zhang
Great. If you get time, I suggest you update the wiki page accordingly. - Cheng Zhang On Jul 27, 2006, at 12:05 PM, nkeric wrote: > hi all, > > Base upon Julio's mptt-0.9 which handles nested contents: > > http://code.djangoproject.com/wiki/ModifiedPreorderTreeTraversal

Re: favicon.ico displaying in page

2006-08-18 Thread Cheng Zhang
> share > > thanks a lot > as i m doing an aggregator, i need to display these icons next to the > content > so i was asking if some1 has experience doing this > thanks > I found this article (http://www.kryogenix.org/days/2005/01/31/ favatarsUrlparse) might be

Re: Mac vs. PC for Django work.

2006-09-15 Thread Cheng Zhang
packages/py24-fat/index.html immediately. With the combined help from that link, easy_install and darwinports (now rename as macports)/fink, the Mac ride will be flawless. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-

Re: Mac vs. PC for Django work.

2006-09-15 Thread Cheng Zhang
ent methods. In our experience, lighttpd + scgi is much better than that. Again, pick what is the most comfortable one is always our guideline. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2n

Re: Mac vs. PC for Django work.

2006-09-15 Thread Cheng Zhang
h the improvement on infrastructure open-source software like GCC, the same set of app will run faster on the same set of hardware. -Cheng Zhang http://www.ifaxian.com 1st Django powered site in Chinese ;-) http://www.aiyo.cn Our 2nd Django powered site in Chinese On Sep 14, 2006, at 1:13

Re: Editing inline object individually

2005-11-17 Thread Qi Cheng
> For the specific case of editing an inline_edited object seperately in > its own admin form, (which I believe the original poster would be > satisfied with as a stop gap measure), this should already work in > new-admin AFAIK. The foreign key with edit_inline=whatever is rendered > as a foreign

Re: ZODB Anyone ?

2005-11-20 Thread Cheng Zhang
I am curious to learn more about why "object DBs are not good fit for the MVC-like separation". Previously I had very basic exposure to ZODB, along with the concept of object database, when I played with Zope a bit years ago. Thanks. - Cheng On Nov 20, 2005, at 1:12 PM, Tom T

OODB with Django? Was Re: ZODB Anyone ?

2005-11-20 Thread Cheng Zhang
mance in the deployment phase. - Cheng On Nov 20, 2005, at 7:22 PM, mario ruggier wrote: One of these is the moellus package, that is a layer on top of the small Durus OODB (that is a ZODB-inspired OODB, but intentionally simpler), that organizes items (objects) in containers (tables).

How do I specify default value for a form field while using manipulator

2005-11-22 Thread Cheng Zhang
list) to be selected as 'test1' automatically. It would be better if this field is disabled or hidden from the page. Currently, I have no idea how to do so. Any suggestions will be appreciated. Thanks a lot. - Cheng

Re: How do I specify default value for a form field while using manipulator

2005-11-22 Thread Cheng Zhang
Thanks. Guess I should get the habit of searching wiki, esp. the cookbook. On Nov 22, 2005, at 9:21 PM, Grigory Fateyev wrote: http://code.djangoproject.com/wiki/CookBookManipulators there are two ways to do this stuff.

Re: Django job in Dallas, Texas

2005-11-22 Thread Cheng Zhang
. - Cheng On Nov 22, 2005, at 11:54 PM, Adrian Holovaty wrote: I spotted this on the Dallas craigslist: """ Pegasus News is looking for a Python programmer -- better yet for you and us if you're versed in Django -- to help with some light programming/tweaking on pre-existing conte

Re: Standalone template language

2005-11-24 Thread Cheng Zhang
It's possible, based on my limited knowledge of Django. I think such usage is more like using a Python library. In your case, you need to set the environment variable DJANGO_SETTINGS_MODULE as shown in tutorial 1, e.g. export DJANGO_SETTINGS_MODULE=myproject.settings - Cheng On N

Re: replaces_module

2005-11-29 Thread Cheng Zhang
staff', 'is_superuser'] Would you please elaborate this new meta option 'replaces_module', which I couldn't find in the doc? Thanks. - Cheng

Re: Which user posted the blog entry.

2005-12-12 Thread Cheng Zhang
ntry? Can that info be gotten by who was logged in and made that post? Of 'coz, for example you can use author = meta.ForeignKey(users.User) for your purpose. - Cheng

Re: [NOOB] ImportError: No module named django.core

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 9:43 PM, patrick kranzlmüller wrote: i just wanted to create a new app using django-admin.py startapp manage and i get the error ImportError: No module named django.core by the way, i already created an app last week, which worked fine. patrick This is due to old *.py

Modeling a category entity which has parent-child structure

2005-12-13 Thread Cheng Zhang
oesn't work. Thanks. - Cheng

Re: Modeling a category entity which has parent-child structure

2005-12-13 Thread Cheng Zhang
On Dec 13, 2005, at 10:53 PM, Alex Bondarenko wrote: On 12/13/05, Cheng Zhang <[EMAIL PROTECTED]> wrote: I am trying to model a category entity which has parent-child structure. My model is: ... If parent is as same as child, this is considered as top-level Maybe just use "par

Re: Additional User Data?

2006-01-03 Thread Cheng Zhang
meta.Admin( list_display = ('user', 'location', 'website',), ) I don't need to specifying 'ordering' parameter for admin, just FYI. - Cheng On Jan 3, 2006, at 11:44 PM, Adrian Holovaty wrote: On 12/31/05, Andreas Neumeier <[EMAIL PRO

Re: ANN: "Snakes and Rubies" (Django/Rails meetup) video/audio available

2006-01-05 Thread Cheng Zhang
Cool, feels like have been waiting for this video forever. ;-) Special cheers to Jacob's video editing efforts. I know how painful it could be. - Cheng Zhang On Jan 5, 2006, at 10:20 PM, Adrian Holovaty wrote: Last month, there was a Django/Rails meetup in Chicago, at which I

Re: models can't use globals

2006-01-10 Thread Cheng Zhang
ne can't be moved to the top of the file from django.models import get_module mod = get_module('portal', 'friends') try: f = mod.get_object(myself__id__exact=friend.get_friend().id, friend__id__exact=friend.get_myself().id) except (KeyError, mod.Frien

Re: best practices for translating content

2006-01-10 Thread Cheng Zhang
We discussed a bit about this topic in our project as well. Surely that's one way to do it, or maybe the only practical way we could come up with. But the problem is once you support more than 2 languages, keeping schema in sync will become a headache and definitely not DRY. -

Re: best practices for translating content

2006-01-10 Thread Cheng Zhang
We discussed a bit about this topic in our project as well. Surely that's one way to do it, or maybe the only practical way we could come up with. But the problem is once you support more than 2 languages, keeping schema in sync will become a headache and definitely not DRY. -

Re: Django and MS SQL

2006-01-10 Thread Cheng Zhang
also in the mailing list couple months ago but didn't have time to work more on it. The reason for picking pymssql over ado-mysql is that we'd like to run Django on Linux instead of Windows. Anyway, at this point I am kind of walking in the dark, since MS-SQL is a new territory to me. - Cheng

Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
Hi I am implementing such a function. I have a textarea that will be inputted many characters, when they are showed in page, they will be displayed in one line, very ugly.So I want to change the '\n' in the texts to ''. I know this can be implemented by wysiwig editor(e.g. tiny_mce), and I have

Re: Could django filters be used in its models instead of templates ?

2006-01-10 Thread Qi Cheng
sorry. I have got it resolved. Seems i was in a totally wrong direction. please ignore this question.

multiple levels of join

2006-01-11 Thread Cheng Zhang
friend = meta.ForeignKey(users.User, related_name="friend", verbose_name="friend") How may I get a list of entry whose submission_user is in my friend list, which is myself == my_id? After looking at db api doc for hours, I just can't figure it out. Thanks for any advice. - Cheng

Re: multiple levels of join

2006-01-12 Thread Cheng Zhang
On Jan 12, 2006, at 5:38 AM, Adrian Holovaty wrote: On 1/11/06, Cheng Zhang <[EMAIL PROTECTED]> wrote: class Entry(meta.Model): submission_user = meta.ForeignKey(users.User) class Friend(meta.Model): myself = meta.ForeignKey(users.User, related_name="myself&quo

Re: Django and MS SQL

2006-01-20 Thread Cheng Zhang
nd my mind started to blur. I will try to finish up tomorrow, clean up, and submit patches. Please NOTE that this pymssql is different with the existing ado_mssql. It can run on *nix, 'coz I am hacking on my Mac. Cheers. - Cheng Zhang - 'basic' module: API test

Re: Django and MS SQL

2006-01-20 Thread Cheng Zhang
Actually that's incorrect. Pymssql is only a thin wrapper around FreeTDS library (http://www.freetds.org/). AFAIK, FreeTDS works with SQL-Server 2000 pretty well. - Cheng On Jan 13, 2006, at 12:15 AM, Rich Bakos wrote: Jeroen Ruigrok van der Werven wrote: Hi Jeroen, Can a bunch

Re: Django and MS SQL

2006-01-20 Thread Cheng Zhang
NIX to connect to SQL Server since it's only works on Linux/UNIX. - Cheng

Re: Django and MS SQL

2006-01-21 Thread Cheng Zhang
Ok, the patch is away [http://code.djangoproject.com/ticket/1258]. :-) - Cheng Zhang

Re: Django and MS SQL

2006-01-21 Thread Cheng Zhang
On Jan 21, 2006, at 7:12 AM, Jeremy Dunck wrote: On 1/20/06, Cheng Zhang <[EMAIL PROTECTED]> wrote: Adapter class over adodbapi where supported, falling back to pymssql? I think they (ado_mssql and pymssql) are meant for different OS platforms, in that ado_mssql is for Django runn

Re: recursive template calls

2006-02-07 Thread Cheng Zhang
Please search the previous email archive for discussion on such topic like "tree view". In fact, there is a wiki page for an implementation as well. On Feb 8, 2006, at 11:31 AM, Shannon -jj Behrens wrote: Hi, I'm trying to build ye ol' bulletin board application to try out Django. I'm ha

Re: Problem and fix with ado_mssql

2006-02-27 Thread Cheng Zhang
On Feb 28, 2006, at 5:48 AM, kent wrote: > PS I tried submitting this as a patch in the tracker but I didn't see > any 'attach file' button... The 'attach file' button will appear after you create the ticket. :-) - Cheng --~--~-~--~~~---

Re: Class in views.py

2006-02-27 Thread Cheng Zhang
? Nope AFAIK. Why don't you show the errors you got? It will be easier for others to figure out why. - Cheng --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: caching questions

2006-03-01 Thread Cheng Zhang
-headers). If you didn't check it out, it might be useful for you, although I didn't have chance to use it yet. Cheers - Cheng Zhang --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&qu

Re: An expression tag

2006-03-08 Thread Cheng Zhang
On Mar 4, 2006, at 3:12 PM, limodou wrote: > > I'v written a expression tag, it can be used to calculate python > expression and save the result to a template variable. I think it > maybe some useful for someone. Indeed. I just found a place to use it in our app. :-)

Re: Django API doc

2006-03-23 Thread Cheng Zhang
Very useful. Thanks. On Mar 23, 2006, at 4:28 AM, Daniel Poelzleithner wrote: > > Hi, > > i created a css to build a django styled API doc with epydoc. > > http://djangoapi.quamquam.org/ Beta Version :) > > I hope we can integrate it as http://api.djangoproject.com someday. > > kindly regards >

Too many SQLs in change_list pages

2006-04-03 Thread Qi Cheng
Hi, guys I have been troubled by a problem for weeks, this maybe very easy for you guys. It is about the "list_display" in ADMIN of models, say ModelA. If I add a method in list_dispaly(not a field) , which will access other models data, say ModelB. Then when I acess the modelA's change_list pa

[M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-29 Thread Cheng Zhang
problem with code like: if len(id_list) > 0: Article.objects.filter(id__in = id_list) else: Article.objects.filter(id__isnull = True) Should this problem be deal with on the Django framework level, instead of application level? BR, - Cheng --~--~-~--~~~---~-

Re: [M-R] lookup like Article.objects.filter(id__in = []) will fail

2006-04-30 Thread Cheng Zhang
On Apr 30, 2006, at 1:31 PM, Ivan Sagalaev wrote: > > Cheng Zhang wrote: > >> I tried lookup like Article.objects.filter(id__in = []), which will >> have SQL statement whose where clause is something like 'WHERE >> ("poll_article"."id"

[M-R] order by on custom SELECT column

2006-05-01 Thread Cheng Zhang
ustom SQL as much as possible for portability purpose. BR, - Cheng --~--~-~--~~~---~--~~ 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 unsu

Re: ANN: magic-removal branch merged to trunk

2006-05-01 Thread Cheng Zhang
reports and other help in this > branch. Special thanks go to the magic-removal committers, Joseph > Kocherans, Russell Keith-Magee and Luke Plant. We are also busy in converting our code base for http:// www.ifaxian.com to use new API lately. :-) Chee

Re: non mod-python deployment...any experiences? (dedicated server)

2006-05-02 Thread Cheng Zhang
That blog is in Russian. ;-) On May 2, 2006, at 9:49 PM, Dmitry Medvedev wrote: > about nginx ( http://nginx.org/ ) - this web server is similiar to > lighttpd and i think results won't really differ a lot. I took > django+nginx instructions from Igor Goryachev's blog ( > http://goryachev.org/ )

Re: non mod-python deployment...any experiences? (dedicated server)

2006-05-02 Thread Cheng Zhang
than Apache + mod_python IMHO. Hugo's Django scgi page (https://simon.bofh.ms/cgi-bin/trac-django- projects.cgi/wiki/DjangoScgi) helps a lot. We are not a high-traffic site yet, but so far, such setup has been very stable. - Cheng Zhang http://www.ifaxian.com --~--~-~--~~~

Re: Keep getting TemplateDoesNotExist when unit testing

2012-03-03 Thread Calvin Cheng
Hi Jonas, I am having exactly the same problem in one of my projects and I am not sure why. Did you manage to solve it in the end? Would appreciate it if you could share with me your solution if you did. Regards, Calvin On Saturday, December 24, 2011 10:51:27 PM UTC+8, jonas wrote: > > Hell

Re: Various thoughts on authentication, registration and social logins

2012-06-18 Thread Ien Cheng
Mattias, It may be worth checking out django-allauth. It doesn't use the flow you are proposing -- as register-by-email users do need to enter a password -- but it has an nicely integrated one-click login via Facebook/Google/etc. alternative option for users. I haven't tried, as I like the def

pattern validation in QueryDict.get()

2013-06-01 Thread CHI Cheng
In url.py, we could use regex to limit string patterns. Is there anything similar for QueryDict.get()? e.g. given q = request.GET.get(key='q', default=10, *pattern=r'\d+'*) # new parameter pattern If value of q in //*path?q=xxx* does not match the pattern, then give default value. -- Chi -

Re: pattern validation in QueryDict.get()

2013-06-04 Thread CHI Cheng
Seems it should be '^\d+$'. Nobody likes this idea? Should I submit a ticket and pull request? On Saturday, June 1, 2013 9:48:17 PM UTC+10, CHI Cheng wrote: > > In url.py, we could use regex to limit string patterns. > > Is there anything similar for QueryDict.get()

Unicode character in Django project path

2015-01-18 Thread Cheng Guo
Hello everyone, I am new to this community. I have run into an issue related to Unicode character in project path: http://stackoverflow.com/questions/27996774/unicode-character-in-django-project-path Another user on StackOverflow provided a detailed analysis of what is causing the bug in the l

Re: Unicode character in Django project path

2015-01-18 Thread Cheng Guo
oding/decoding that in not aware of. > > Search through https://code.djangoproject.com/search and see if another > ticket already exists. > > -James > On Jan 18, 2015 7:05 PM, "Cheng Guo" > > wrote: > >> Hello everyone, >> >> I am new to

Newbie question: How to avoid a very long view function?

2015-01-18 Thread Cheng Guo
Hello, I am new to Django and I have run into an issue with views.py. I understand that there is a function behind each view. For a view that I am currently writing, it accepts a file upload from user and stores the file on the server. To do that, I need to: 1. check the file extension is cor

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, 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@goo

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Great, thanks! On Monday, 19 January 2015 15:46:40 UTC+8, Mike Dewhirst wrote: > > On 19/01/2015 6:28 PM, Cheng Guo wrote: > > Hello, > > > > I am new to Django and I have run into an issue with views.py. I > > understand that there is a function behind each v

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
@classmethod def save_to_disk(): pass On Monday, 19 January 2015 16:12:28 UTC+8, daniel.franca wrote: > > If the operations are model related, why don't move some of those > functions to models.py. > On Mon 19 Jan 2015 at 08:46 Mike Dewhirst > wrote: > >>

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
bject is > saved, the object itself would create the hash. This way you can save the > object from any view (or from the shell), and it would always generate a > new hash automagically (new meaning recalculated, may end up the same as > the previous value). > > TL;DR; The hash sho

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
nd up the same as > the previous value). > > TL;DR; The hash shouldn't be calculated external to the file that is > attached to the object, it should be calculated by the object itself. > > Hope that helps and makes sense... > > -James > > > On Jan 19, 2015

Re: Newbie question: How to avoid a very long view function?

2015-01-19 Thread Cheng Guo
Thank you Daniel, I didn't know this! I am going to lookup how to use session. Thanks! On Monday, 19 January 2015 17:13:10 UTC+8, Daniel Roseman wrote: > > On Monday, 19 January 2015 07:28:14 UTC, Cheng Guo wrote: >> >> Hello, >> >> I am new to Django and I h

Django formset hidden id field

2015-05-27 Thread Cheng Guo
Hello, I have a formset and when I render it, Django would include this line in the HTML: I am curious what is the purpose of having an id field here. I mean in what situation would you use it. I did look through Django's documentation on formset

Re: Django formset hidden id field

2015-05-27 Thread Cheng Guo
> Cheers > Matthias > > 2015-05-27 15:47 GMT+02:00 Cheng Guo >: > >> Hello, >> >> I have a formset and when I render it, Django would include this line in >> the HTML: >> >> >> >> I am curious what is the purpose of having an id f

Import css in Django

2016-09-11 Thread Jonathan Cheng
I use django1.10 i reference the official doc https://docs.djangoproject.com/en/1.10/intro/tutorial06/ my project name:mysite structure: - mysite- - mysite - urls.py -views.py ... - templates - ind

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
d } in the load > staticfiles tag > > 2016-09-11 7:29 GMT+02:00 Jonathan Cheng >: > > I use django1.10 > > > > i reference the official doc > > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > > > my project name:mysite > >

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
ste2.org/ or https://gist.github.com/ to share > it > > 2016-09-11 17:58 GMT+02:00 Jonathan Cheng >: > > thx reply,but it just can see the original html with no css,is my path > > setted correct? > > > > ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: >

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
ectstatic which will grab all static file and copy them in a > single directory. > > 2016-09-11 18:18 GMT+02:00 Jonathan Cheng >: > > > > https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 > > > > ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
; your settings.py you wrote "STATIC_ROOT='/mysite/static/'" which says > that static should be subdirectory of mysite which its not a subdirectory > its in a same directory of mysite > > > On Sunday, September 11, 2016 at 8:48:57 PM UTC+4:30, Jonathan Cheng wrot

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
i fixed usint STATIC_ROOD = '/static/' it seems to no error but when i connect to my runserver the css of assets just doesn't work Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道: > > here i explain , because i just test how main.css work, finally i want to > use the a

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %}" and it worked but if i want to use the all files in static is there any way to do? ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道: > > If you look at the html send by django, what is the href value ? > > 2016-09-1

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
2016-09-11 19:15 GMT+02:00 Jonathan Cheng >: > >> i fixed usint STATIC_ROOD = '/static/' >> it seems to no error >> but when i connect to my runserver >> the css of assets just doesn't work >> >> >> Jonathan Cheng於 2016年9月12日星期一 UTC+8上午

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
2016-09-11 19:15 GMT+02:00 Jonathan Cheng >: > >> i fixed usint STATIC_ROOD = '/static/' >> it seems to no error >> but when i connect to my runserver >> the css of assets just doesn't work >> >> >> Jonathan Cheng於 2016年9月12日星期一 UTC+8上午

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx everyone,all bugs were fixed early. Jonathan Cheng於 2016年9月11日星期日 UTC+8下午10時59分56秒寫道: > > I use django1.10 > > i reference the official doc > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > my project name:mysite > >

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
ng it every time I looked at the dev-server > output helped a lot. > > Comments in announce.py show how to use it. > > Good luck > > Mike > > On 12/09/2016 1:58 AM, Jonathan Cheng wrote: > > thx reply,but it just can see the original html with no css,is my path &

  1   2   >