building components
Hello i just started over 2 days ago with python and django (although i have some expirience in WebObejcts and Tomcat/JSP). I did the tutorial and started building my first "app" :) and came to my first "bigger" problem (perhaps understanding problem). I'd like to build one component "Login" or "Navigation" which can be places on different templates at different palces. e.g.i'd like to have the the login component on the right side by default, but sometimes it should be in the content area. Till now i learend that i can repalce {% block login %} by extending one base template and overriding the block. But what i'd like to do is having one componend "login" and place that component e.g. inside the login-block on the base page. I'd like to do this because i want to build up some logic inside that components and don't like to have that logic on the main template but in one seperate "file". Till now i'd do it like this: base.html: Define the blocks -> base_login_right.html: Template havin login on the right side (override only the login block) -> base_login_right_navigation.html: Template having the login on the right side and also havin the navigation. (override only the navigation block) All my pages would extend base_login_right_navigation.html then. Somehow this seems very strange to me. Having the login on the left side would force me to define one new base.html, base_login_left.html and also base_login_left_navigation.html including all the code once againe ... I am prety sure i missed something :) Any hints would be very welcome ... ( block.super probably? ) Many thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: building components
Thanks Rajesh i think i found the documentation therefore... Starting with inclusion tags now :) I'm pretty sure there will be more such basic questions and hope i can ask them (and also get an answer) _tia On 19 Nov., 16:05, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > I'd like to build one component "Login" or "Navigation" which can be > > places on different templates at different palces. e.g.i'd like to > > have the the login component on the right side by default, but > > sometimes it should be in the content area. > > > Till now i learend that i can repalce {% block login %} by extending > > one base template and overriding the block. > > But what i'd like to do is having one componend "login" and place that > > component e.g. inside the login-block on the base page. > > > I'd like to do this because i want to build up some logic inside that > > components and don't like to have that logic on the main template but > > in one seperate "file". > > > Till now i'd do it like this: > > > base.html: Define the blocks > > -> base_login_right.html: Template havin login on the right side > > (override only the login block) > > -> base_login_right_navigation.html: Template having the login on the > > right side and also havin the navigation. (override only the > > navigation block) > > > All my pages would extend base_login_right_navigation.html then. > > > Somehow this seems very strange to me. Having the login on the left > > side would force me to define one new base.html, base_login_left.html > > and also base_login_left_navigation.html including all the code once > > againe ... > > > I am prety sure i missed something :) > > > Any hints would be very welcome ... ( block.super probably? ) > > You should consider creating template tags for these "widgets". So, > you would have a navigation tag, a login tag, etc. The tags are > implemented using Python code and HTML so you have more control on > what they do. > > If you want to style these widgets based on their location in your > layout, simply wrap them in a CSS class container like this: > > > {% login_tag %} > > > > {% login_tag %} > > > -Rajesh D --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
pydev error
Hello i am having some "problems" and question with pydev (+extentions) and django. Since some hours (hmmm) eclipse points out an error, saying User.DoesNotExist is not defined, although i have included django.contrib.auth.modes.User I can run the code (in debugger) and django does not throw any exception when running the code, so i asume its an problem with pydev. I am prety sure i did not have this behaviour yesterday. Even if its not that bad, because the code runs, i'd like to fix this. Is there some posibility to "refresh" the lib-list that pydev uses for lookup? I allready tryed to recreate the project and also removed python.exe from the global python-path and reput it in, but without success. Also i'd like to ask if there is some way to validate a complete project. I mean i can start one site and errors are only cought on-the- fly. Something like a precompiler or codevalidator. i meanif i change code i will test it thats true, but there is code that only gets reached under difficult circumstance (e.g. except's, crashes). I'd be happy to be sure that code would at least be syntactically good :) _thanks and sorry for such newby questions (but just started python/ django) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
django documentation
hi as mentioned earlyer today i am very new to django and againe have some question, this time reguarding the documentation. I started django by duing the tutorial, and now i started building my own little project from ground up :) but i am lacking of information. I am missing some documentation, some good organised api. E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos on the user. The documentation from http://docs.djangoproject.com says "define that in settings.py and in your model and use it via get_profile" But no one tells you that you have to create it by yourself and save it also. Ok this is something you can try out but the information would be placed good on the doc side. Also i'd like to implement groups in my app. The only infomation on the site is, that you can use groups and all users of one group have the permissions of the group. Thats all. There is no description on how/where to specify groups, how to create then, how to add users to one group ... I'l have to find everything by myself on google.. Can anyone give me some link to one good documentation or do there exist good books which cover issue's completly so you don't have to search most time while learning? _tia --~--~-~--~~~---~--~~ 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 documentation
Hello Brian i allready saw those hints on the djangoproject/djangobook homepage and that was the reason i was writing this post. Imagine i am new to django, i read "i have to add those lines to my model and do some stuff on the setting.py file and run syncdb" then everything is ok and i can use get_profile to load the profile . I did that but running get_profile raises exceptions. I took quite a bit to realize that the profile does not get generated automaticly (checked in db table) but you have to create it by yourself. I mean its just one sentense more but it would save many searching on the web. Also take a look on the groups: " Groups Groups are a generic way of categorizing users so you can apply permissions, or some other label, to those users. A user can belong to any number of groups. A user in a group automatically has the permissions granted to that group. For example, if the group Site editors has the permission can_edit_home_page, any user in that group will have that permission. Beyond permissions, groups are a convenient way to categorize users to give them some label, or extended functionality. For example, you could create a group 'Special users', and you could write code that could, say, give them access to a members-only portion of your site, or send them members-only e-mail messages. " Now try to use this infomation. The documentation should point out, that i have to create the groups with the Admin, that i have to add the users in the Admin to those groups. It should also tell me if/how i can add/remove users to group by code? Or creating the groups by running syncdb (probably i have to use some dumpload) What i want to say is that the provided infomation is not realy usefull for someone begining django. I have to read the docs and then start searching on the web to figure out how to use the functionality. Thats what seems insufficient to me. And this are only 2 aspects i wrote down as a example. Now i just ordered 2 Books on Django and one on Python :) Hope they will cover functions more complete. PS: http://djangoapi.quamquam.org/trunk/ _thanks On 25 Nov., 01:38, Brian Neal <[EMAIL PROTECTED]> wrote: > On Nov 24, 5:18 pm, ReneMarxis <[EMAIL PROTECTED]> wrote: > > > hi > > > as mentioned earlyer today i am very new to django and againe have > > some question, this time reguarding the documentation. > > > I started django by duing the tutorial, and now i started building my > > own little project from ground up :) but i am lacking of information. > > I am missing some documentation, some good organised api. > > > E.g. i want to implement AUTH_PROFILE_MODULE to store additional infos > > on the user. The documentation fromhttp://docs.djangoproject.comsays > > "define that in settings.py and in your model and use it via > > get_profile" But no one tells you that you have to create it by > > yourself and save it also. Ok this is something you can try out but > > the information would be placed good on the doc side. > > http://docs.djangoproject.com/en/dev/topics/auth/#storing-additional-...http://www.djangobook.com/en/1.0/chapter12/#cn222 > > > > > Can anyone give me some link to one good documentation or do there > > exist good books which cover issue's completly so you don't have to > > search most time while learning? > > Searching is part of the process of learning. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
different database access
hi i am new to django and evaluating if i could use it for one new application. I did some mal app with django last days and i am impressed :) however i need some infomation from expirienced developers. 1) Is it possible to connect to more than one database, and beeing able to use the model-functionality from django? 2) I have to connect to: Oracle/MS-SQL Server/ and postgres/sqlite at the same time. Anyone having expirience with http://code.google.com/p/django-mssql/? thats all for now. _tia rene --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
DateTimeField and input_formats
Hi i have some basic question on datetime formating. I have one form and view as defined under http://dpaste.com/96096/ Just to get it right: shouldn't the form format the dates while rendering automaticly and show them formated according to the input_formats? The form does not for me. Also the form validation inside the view does not pass if i enter e.g. 01.01.2008 01:01:01nor does it if i enter 2008-01-01 01:01:01. Why? Any help would be very welcome. --~--~-~--~~~---~--~~ 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: DateTimeField and input_formats
fixed ... i had to pass in a tupel ... not a string. and as far as i saw the field does not format the data automaticly. you have to pass it in as a formated string. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
designing search functionality
Hi I have one question reguarding design of an app. I have one model that has about 10 fields and 3 relations (foreign key) and i need to make one "Add new" and "Edit" form of it. My question reguards those relations in the model. How would you realize a search functionality for those related model-fields? Selecting the right relation involves a new search form, as there are 100's of entries one should filter first before selecting the right on. Till now i thought of opening a new js window that includes the search form, and on completition of that search i would set the result in one hidden field in the parent window. An other approach would be to have one "Search button" inside the form, which redirects to one new search form (in the same window). But then i would have to save the data allready entered in the form inside my session, or is there some possibility to pass the whole form from one view to another? That would be best. PS: the search functionality will be reused in many other forms... Any hints would be very welcome :) _thanks rene --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Date Formating
Hello i am having some problems getting date-formating running ... here is some code-snippet i use in my app http://dpaste.com/121354/ The form shows up ok. If i enter valid data everything is ok. But if i enter invalid data or none the form will be empty. There is no validation error showing up, just nothing. The validation rules are the once entered in DateFormattedTextInput (format='d.m.Y'). I can check that by entering data only valid for that formater. So. Can anyone give me some hint where to look next? I am a little bit lost. Or even better: Is there one way to specify date/time/datetime formats for the whole app? I thought of using technical message ids and localization, but i was told that will also not work. Many thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Date and Times
Very sorry to bug you againe, but this is getting very critical Please can someone tell me how to format output of one DateField in a way that form.is_valid() is not breaking? I allready posted this question some time before under http://groups.google.com/group/django-users/browse_thread/thread/33b6fadb5db48525 but got no result. This must be something, someone else allready steped over. I think every e.g. german application must deal with this.. I also need this for modeled forms. On those i can get the initial data showing up formated the right way, but after one failed .is_valid () the form is empty againe. Many thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date and Times
What i basicly need: Have one imput format and the same output format for modeled and nonmodeld forms and all other functionalities should be present as default (e.g. is.valid()) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date and Times
Ok got this fixed. The problem comes if you enter invalid data. return dateformat.format(value, self.format) would throw an exception and the form would render to "" class DateFormattedTextInput(FormattedTextInput): "Renders formatted date." def __init__(self, format=None, attrs=None): super(DateFormattedTextInput, self).__init__(attrs) self.format = format or settings.DATE_FORMAT def format_value(self, value): if value: try: #here was the problem return dateformat.format(value, self.format) except: return value else: return value Solves this. If the value can not be formated the original one is returned. BTW: the problem only occured after calling form.isvalid(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date and Times
Would you say i am right? I would past this on http://code.djangoproject.com/ticket/3672 where i got the original code from --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date and Times
> That was a whole 19 hours before you posted this! It's not as if it's > been a week with no answer. For a question like this, where even > understanding the problem requires wading through 40 lines of code, it > might well take a while before somebody has time and motivation to get > there. > > Regards, > malcolm I know this was very short but i can not belive i am the first one having this problem. Nearly every german application should have to deal with this. I am sorry for this but it was very important to know if it's solveable ... Although i got the code from the official django tickeing system, so i was pretty sure many peoples would have used the code before. But i'll take some patience next time. Guaranteed --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date Formating
Solved Please see http://groups.google.com/group/django-users/browse_thread/thread/4f19a5e0c9719f53/3ff236709a6d6578#3ff236709a6d6578 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Date and Times
thanks koenb i'll try that this evening. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
how to not saving models
Hello i have a question if something is possible to implement :) i need some demo functionality in my django app and i'd like to realize it by having some flag in the user's session that defines if data should be saved at all or not in the whole app (for the session user). That way i could just create some data (via fixtures) and define some demo-user and all functionality would be 'visible', but no data could be changed/saved. Could something like this be realized in django? Probably with signals? Any hints are very welcome. _rene --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: how to not saving models
what i forgot to say: Of course i don't like to change all models- code. Some 'global' solution is what i am looking for. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: how to not saving models
Hey Matias. Many thanks for your answer. This is what my 'new' manage.py looks like: http://dpaste.com/58713/ and it seems to work. At least no data is saved any longer :) But next question is not far away: I can use pass or return forig(self) according to if i'd like to save or not (is this ok at all?), but how can i check session data. There is no request/response loop right? PS: Monkey patching... very nice this :) On 23 Jun., 13:38, Matías Costa wrote: > Monkey patch django.db.model.save > Where? in manage.py? > > On Tue, Jun 23, 2009 at 12:56 PM, ReneMarxis wrote: > > > what i forgot to say: Of course i don't like to change all models- > > code. Some 'global' solution is what i am looking for. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
django images nginx and authentication
Hello i'm faceing the following problem: i have some application for creating image galleries (upload/change...). Till now the images are served by an nginx webserver (and are therefore open to everyone). The django app is running in apache with wsgi. My problem is i need to restrict the image delivery only to persons that are authorized to watch the images. Best would be to include djangos authentication with nginx. Is there any way to accomplish this or any other hints? _thanks rene --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django images nginx and authentication
Many thanks. i will try that out. But sounds to be a good solution :) On 15 Okt., 15:00, tback wrote: > Hi Rene, > > look at this:http://wiki.nginx.org/NginxHttpSecureDownload. I personally use > lighttpd and mod_secdownload and googled the above. > > It works like this: > Your django application and your image server(s) share a secret. > Your application takes the secret, the url and a timestamp to > generate a new url consisting of the original url, the timestamp and > a hash value. > > The image server than takes his secret, the timestamp and the url > to calculate the hash. If the timestamp is not older than your > specified period and the hash matches the submitted hash the user > is allowed to download the image. > > cheers tback > > On Oct 15, 12:41 pm, ReneMarxis wrote: > > > Hello > > > i'm faceing the following problem: i have some application for > > creating image galleries (upload/change...). > > Till now the images are served by an nginx webserver (and are > > therefore open to everyone). The django app is running in apache with > > wsgi. > > > My problem is i need to restrict the image delivery only to persons > > that are authorized to watch the images. Best would be to include > > djangos authentication with nginx. > > > Is there any way to accomplish this or any other hints? > > > _thanks rene --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Admin and search_fields
Hello does anyone know some app similar to https://pypi.python.org/pypi/django-admin-visualsearch that is able to filter over more than one related (foreign key) level? Would be great to define just some fields i'd like to search on (in admin.py), and get one input field for every search_field... _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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a480c11f-948a-4377-94ad-3c9de0b29750%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Django 1.6 and get_search_results
Hello can someone tell me why all 'custom' the GET parameters (except the once used from admin directly like ?q or ?o) are getting removed from the request before get_search_results is called on an admin.ModelAdmin instance? i do see all the GET parameters in get_changelist but they are removed on get_search_results. POST parameters are not removed. I'm trying to build some custom search functionality with more than one search field. _rene -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8af6a3d6-8669-4fc5-a16a-1be9bb089111%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
problem with django, nginx and gunicorn
Hello i have some question on deploying an django app. I'm using nginx and gunicorn to publish one django app. For gunicorn i wanted to use gevent, because there are some calls to the app, that can take up to 5 minutes to finish (generating pdfs) Firsts question is more an understanding question... When using gevent and only one gunicorn worker thread, all 'blocking' requests run in an seperate gevent/libevent thread correct? Thus, that call will not block the app completly right? If i understud the task of gevent correct, this is the sens of gevent right? Now to my problem... Doing one blocking call to my app, and having only on worker, blocks my entire application. In the gunicorn logs (startup) i can see, that gevent is used, but the calls seem to be synchronus. Here is my nginx config https://dpaste.de/Dfi5 and here my gunicorn https://dpaste.de/UAqH Can someone find some error in this config? My next problem is, that calls that take longer than 60 seconds lead to an error if i set timeout to 120 inside the gunicorn config (504- Gateway Time-out). Where can i tweak this? It seems like nginx is cutting the connection. The gunicorn thread is running 120 seconds and is getting restarted by gunicorn-master then (could check that by using top). Any hints are very welcome ... 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3872c97d-35d7-4f24-9002-8099095adb2e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: problem with django, nginx and gunicorn
Hello Erik thanks for your responce! I started reading a little bit related to GIL. I think this is the root of my problem. I'm using xhtml2pdf to generate some large pdf's (up to 200 pages). I do know i have to rewrite this code to run in background (e.g. using celery). However i want to understand, why gevent is blocking. As i understood, gevent spawms a new 'microthread' that does the long lasting work. My mistake was/is that i thought a gevent thread would be a full featured gunicorn thread. but this can't be of course. wouldn't make sense to use gevent otherwise ... However this is not a big issue, as the function itself is used only in admin by some special users. I can 'train' them to create only smaller pdf that get created under 10 seconds ... Nevertheless it would be nice to know, what kind of "heavy work" can be done asynchronous with gevent. Reading the documentation i can't figure out, where gevent would realy help improving to serve more pages/sec. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d419ae4c-ff44-4a38-8adb-ae23de8a1342%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: problem with django, nginx and gunicorn
Hello Javier also thank you for your answer. However i do know how to implement such a long running task for a customer. I generaly use celery and send out an email with a link on completition of such a task. For simple tasks i use just a cronjob. Most of those jobs run on an separeate machine normaly. The question is more related to gevent und unicorn. I'd like to understand what tasks/aktions can run in paralell when using gevent in gunicorn. Lets say there are some calls inside the app that return just some calculated values from db. Those calls need something about 200-300 ms to complete and doing nothing else than reading values from db and calculating some results and presenting them with an django template. I'm running 6 to 8 workers in gunicorn. If i understood the meaning for using gevent correctly, the app should be able to serve more that 8 current connections, right? Except if there are calls inside the app that block GIL (what seems to happen for xhtml2pdf), which seems to block the gunicorn master-worker. I did not change anything on the django app till now. I thought gunicorn would monkypath everything on startup. I'll probably have to investigate some time here ... -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/08c6b7b9-9969-4afe-969f-1e36d2eec06e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.