Django Tutorial: please help rewrite form on classes?

2021-03-18 Thread Alexey
I can't rewrite the mysite/polls form into classes.help me. I get different errors every time.     {% csrf_token %}     {{ form.as_p }}     # forms.py: from django import forms from .models import Choice class VoteForm(forms.ModelForm):     choices = [(ch.pk, ch.choice_text) for ch in Choi

QueryDict and unicode

2017-10-02 Thread Alexey Lozickiy
there is no such check for PY2? Why not to decode only if it's not unicode? With such implementation it is not possible to pass unicode object that contains non-ascii characters to QueryDict. Can somebody give me a hint on why things wre done in this way? Thanks, Alexey. -- You re

Strange named parameter passing style

2016-12-15 Thread Alexey Gerasimov
Why "flat" keyword is accepted that way? Why not just as def values_list(self, *fields, flat=False)? Because of that I cannot have support in my IDE (autocomplete) def values_list(self, *fields, **kwargs): flat = kwargs.pop('flat', False) if kwargs: raise TypeError(

Re: Bug in Django? It throws server error when context processor raises Http404

2015-06-09 Thread Alexey Grigoriev
I found this issue in my big project. And then I started new Django project from scratch, and reproduced the problem. You can reproduce this bug: 1) start new Django project 2) create context processor that raises Http404 3) set Debug=False 4) create custom '404.html' template And then you get

Bug in Django? It throws server error when context processor raises Http404

2015-06-09 Thread Alexey Grigoriev
Django doesn't catch django.http.Http404 exception in my context processor when Debug=False and when I have custom '404.html' template. It just throws Internal Server Error. Is it Django bug? -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Rewrite (port) project from PHP (Code Igniter) to Django

2015-03-05 Thread Alexey Milogradov
Hello everyone! I would like to collect thoughts, articles, posts, code bases, actually any shared experience on how to port existing project from PHP to Python/Django. Platform agnostic advises or thoughts are appreciated as well. There are my initial quick thoughts and findings on what shou

Django response with two HTTP 'WWW-Authenticate' headers

2014-01-20 Thread Alexey Gusev
Im developing small intranet web service. I want authenticate users over kerberos in MS AD or with basic auth. For that reason i need to set two 'WWW-Authenticate' http headers in response 401. How can i do it with Django ? Should be something like this: Client: GET www/index.html Server: H

Re: How to manage django settings.py for Github, local, production

2013-03-29 Thread Alexey Kinyov
Hi, Surya! My practice is to have 'settings_template.py' in repository and 'settings.py' ignored, so 'settings.py' looks like: from settings_template import * # and here's confidential settings and other There also may be many 'templates' for settings, like 'settings_dev.py', 'settings_pr

[ANN] 'django-smarter' app for declarative style generic views in Django

2013-03-28 Thread Alexey Kinyov
Hello, everyone! I've released 1.0 beta of the app: https://github.com/05bit/django-smarter It helps with adding generic views. Actually, I've build this app for one of my projects, which is 80% based on generic views, and it seemed very useful for that particular case :) As my project evolved a

Re: Django on Jython - Newbie installation difficulties

2013-03-17 Thread Alexey Kinyov
You are welcome :) I'm just interesting what kind of task and environment do you have? I've never played with Jython and never needed to use it, so it's uncommon for me. Sure. If you need your Python code to interact "directly" (not through network API) with Java code, Jython seems reasonable sol

Re: Django on Jython - Newbie installation difficulties

2013-03-16 Thread Alexey Kinyov
Hi, SeeGull! It seems that Django 1.5 is incompatible with your version of Jython (or with Jython at all, I don't know). I've looked at 'django/utils/version.py' (you can see from traceback - exception raised in this file): https://github.com/django/django/blob/master/django/utils/version.py So,

Re: [ANN] Introducing Brillixy - Django admin skin & customization kit

2013-03-16 Thread Alexey Kinyov
Hi, Derek! First of all, thank you! :) > Looks good ... I think a demo with more items in it would be useful se we > can see how page navigation works. It also seems that there is no record > count when you add a filter (eg. "displaying 5 of 20")? Sure, you're right - actually with large amount

Re: Django 1.5 and url tag ( {% url 'django.contrib.auth.views.login' %})

2013-03-13 Thread Alexey Kinyov
You are welcome! :) Alex /// On Thu, Mar 14, 2013 at 12:33 AM, VVilku wrote: > Thanks a lot :) > You're right.I did not notice it. > > Working when add 'atest': > > or > > or > when remove this namespace from project/urls.py. > > regargs > > > > W dniu środa, 13 marca 2013 20:46:41 UTC+1 użytko

Re: Django 1.5 and url tag ( {% url 'django.contrib.auth.views.login' %})

2013-03-13 Thread Alexey Kinyov
Hi VVilku! It should work if you remove `namespace='atest'` from 'auth_project/urls.py'. regards, Alex /// On Wed, Mar 13, 2013 at 10:14 PM, VVilku wrote: > No, I dont't. :) > The attachment in the first post it is my attempt to isolate the problem. > (assumption "blog"=="atest") > > > > W dni

Re: FreeBSD+wsgi+django static and media how-to-do

2013-03-13 Thread Alexey Kinyov
Hi dj-konst! Static files in production are generally served by web server - Nginx or Apache or something else. And it's safer to place static files dir outside of your project dir and use 'collectstatic' command to grab static files there. Here are some examples of Nginx config with static files

Re: Asking for opinion about an Agile Web Framework Comparison

2013-03-13 Thread Alexey Kinyov
Hola David! :) I appreciate your attempt and systematic approach :) It might be interesting. I write web-services using Python and Django since 2008, before that I worked for some projects in PHP/WordPress/Drupal (less then 1 year exp.), I've programmed several games in Flash/AS3 (about 3 years e

Re: [ANN] Introducing Brillixy - Django admin skin & customization kit

2013-03-12 Thread Alexey Kinyov
Thank you, Mário! :) Alex /// On Tue, Mar 12, 2013 at 11:23 PM, Alexey Kinyov wrote: > Hi Tomas, > > thank you! :) It's really inspiring :) > > Yes, I looked through all well known admin customization/skin apps - > some of them a really nice. I'm trying to buil

Re: [ANN] Introducing Brillixy - Django admin skin & customization kit

2013-03-12 Thread Alexey Kinyov
> > Anyway, I wish you good luck in future development. > > Cheers, > Tom > > > Dne Tue, 12 Mar 2013 19:58:22 +0400 > Alexey Kinyov napsal(a): > >> Hello everyone! >> >> Today we've released alpha of Brillixy https://github.com/05bit/brillixy. >&

[ANN] Introducing Brillixy - Django admin skin & customization kit

2013-03-12 Thread Alexey Kinyov
Hello everyone! Today we've released alpha of Brillixy https://github.com/05bit/brillixy. This is a Django admin skin with some extras. Actually it's an alternative to Grapelli, Admin Tools and other apps that changes standard Django admin look and user experience. It's simple and minimal at the

Re: Python Web Development with Django by Wesley Chun

2012-05-22 Thread Alexey
http://rutracker.org/forum/viewtopic.php?t=3720635 On 22 май, 09:05, Ali Shaikh wrote: > Hey Django.!! > > Please can anyone share Python Web Development with > Django by Wesley Chun E-Book?? > > Thank Yooo -- You received this message because you are subscribed to the Google Gr

urls with/without implicit views import

2012-04-20 Thread Alexey Luchko
Hi! I wonder what are pros and cons of explicit import views in urls.py. There are at least 2 ways of defining urlpatterns. * explicit import from . import views urlspatterns = patterns('', ('а/', views.a), ) * lazy import urlspatterns = patterns('path.to.app.views', ('a/', 'a'), ) The fir

Re: TestCase Client.login() fails

2012-03-28 Thread Alexey Kinyov
s a User. https://docs.djangoproject.com/en/1.4/topics/auth/#django.contrib.auth.models.UserManager.create_user I think the problem is that 'user.password' is hashed value but login() method receives raw plain text password, as I answered above. Alexey /// On Wed, Mar 28, 2012 at 12:27 PM, Reinou

Re: TestCase Client.login() fails

2012-03-28 Thread Alexey Kinyov
Hello, Jonathan! I think issue is in the fragment 'password=user.password' in the line: >         response = self.client.login(username=user.username, > password=user.password) 'user.password' - is not plain text password, it's encrypted and it's not equal

Re: Reports

2012-03-16 Thread Alexey Luchko
We are using PDFs. -- 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/-/EfQeowVhrBoJ. To post to this group, send email to django-users@googlegroups.com. To unsu

Re: Reports

2012-03-05 Thread Alexey Luchko
Hi! We are using http://PythonReports.sf.net/. -- Regards, Alex. -- 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+un

Re: Logging from multiple processes

2012-02-16 Thread Alexey Luchko
Hi! We are using TimedRotatingFileHandler with overridden stream with a class that opens log file for append on every write. -- Regards, Alex. -- 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@go

Re: Report tool is supported for django .

2011-10-06 Thread Alexey Luchko
I need to make a report with django . This report supports (chart , export PDF, Excell ...,) please give me some recommendations with tool i must use for this case. To produce printable reports, you can try http://pypi.python.org/pypi/PythonReports/. -- Regards, Alexey. -- You received this

Django auth context processor: not to query for user for each request

2011-09-24 Thread Alexey Moskvin
Hi, I enabled django auth middleware, so now I have a user variable in my request context. In this case for each page request user object is queried from the database. Is it possible to set up this middleware to use a cached user object (for example, put by me in session)? User objects are not upd

Re: Django 1.3 logging not working as I'd expect

2011-08-29 Thread Alexey Luchko
Hi, try executing import logging logger = logging.getLogger('testlogger') logger.warn('hello') logger.info('please appear') in ./manage shell. -- Alex -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Re: Defunct Processes on Server

2011-08-12 Thread Alexey Luchko
daemons do, but this is a bit more expensive. -- Regards, Alexey. -- 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 dj

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-25 Thread Alexey Luchko
es it allow access to the other app by direct url after successful login and redirect? -- Regards, Alexey. -- 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 unsubsc

Re: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Alexey Luchko
ingly? You can try redirect twice. Set fixed LOGIN_REDIRECT_URL to a view that makes further redirect based on user permissions. Or you can try fixed hidden input next in the login templates. -- Regards, Alexey. -- You received this message because you are subscribed to the Google Groups &q

Re: django & py2exe (was: import django models without runing the server)

2011-07-22 Thread Alexey Luchko
pt that imports settings and then calls a manage command manually like that: from django.core.management.commands import syncdb syncdb.Command().execute() If one will try to make a solution, count me in. -- Best regards, Alexey. -- You received this message because you are subscribed to th

Re: help plz to install Django

2011-06-11 Thread Alexey Moskvin
https://docs.djangoproject.com/en/1.3/intro/install/ On 11 июн, 15:01, ihsan mokhlisse wrote: > hi all . i'm so exited to be a member in this wonderful group . i > wanna start learn Django but the problem is . that i need who can > guide me to accomplish the task (learning Django) . > so plz  i n

Re: Updating static files: Still in browser cache

2011-06-09 Thread Alexey Moskvin
Tomas, try this: https://github.com/jaddison/django-cachebuster On 9 июн, 11:09, Thomas Guettler wrote: > Hi, > > My static files (JS/CSS) are cached in the browser. But if there is a bug > in a file, an update won't help people which have already cached the old file. > > You would need a new URL

Re: New to Django, need some help with tutorial

2011-06-06 Thread Alexey Moskvin
Hi, check that directory with python binary is added to your system PATH environment variable. On 7 июн, 09:59, Dori Rutkevitz wrote: > Hi all, > > I am new to programming in general and recently decided to pick up Django. > Im reading bits of a book on Python, and im starting to stumble through

Re: Dynamic verbose_name_plural to display number of models in admin panes

2011-06-05 Thread Alexey Moskvin
Tim, thanks for your help! Also, I've found another solution for this problem: http://stackoverflow.com/questions/6241906/display-number-of-instances-for-each-model-in-djangos-admin-index On 5 июн, 16:50, Tim Shaffer wrote: > You could probably do it using a signal. Every time a record is created

Dynamic verbose_name_plural to display number of models in admin panes

2011-06-05 Thread Alexey Moskvin
Hi, I need to display number of objects at main django site admin page. For example, in list of models I need to display Elephants (6) instead of Elephants I added this code to my model: class Elephant(models.Model): class Meta: verbose_name_plural = 'Elephant ' + '(' + unicod

checking ManyToManyFields for modifications in save()

2011-02-10 Thread Alexey Toptygin
act that my test code runs inside a method decorated with @django.db.transaction.commit_on_success? Alexey -- 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

Re: How to avoid passing of the same parameters in many views

2010-12-19 Thread Alexey Moskvin
Thanks, Piotr. It was a solution with custom tag but implementation with database requests from template looked not too elegant for me. I'll look into custom context processors. On Dec 19, 1:25 pm, Piotr Kilczuk wrote: > Hi, > > I have a block, included into several pages (for example, in all > >

How to avoid passing of the same parameters in many views

2010-12-19 Thread Alexey Moskvin
Hi, I have a block, included into several pages (for example, in all sections of my website you can see top rated articles in the right column). I can include a template, that prints this list into base template and avoid any copy-paste here. But I need to provide it with context variable, that con

Re: Good examples or references

2010-04-22 Thread Alexey Kostyuk
mentation It will be really good to know. > > thanks > Hi! You can find useful links at Django Documentation project http://docs.djangoproject.com/en/1.1/ Also you can read Django Book here - http://www.djangobook.com/ -- Alexey Kostyuk -- You received this message because you are su

Re: Noticed some strange behaviour of request.GET.get()

2010-04-08 Thread Alexey Vlasov
#x27;) > > will return an unicode string, u"public_html", instead of a normal > string, 'public_html'. > > > If it works with the byte string, try changing the line to > > subdir_path = str(request.GET.get('subdir')) > > Nuno > > 2010

Re: Noticed some strange behaviour of request.GET.get()

2010-04-07 Thread Alexey Vlasov
52AM -0400, Bill Freeman wrote: > 1. Why is this view code in urls.py? > > 2. What is the value of subdir_path in the trace back? (There's a > little arrow you can click to > see the variable values fro the frame.) > > 2010/4/7 Alexey Vlasov : > > Hi. > >

Noticed some strange behaviour of request.GET.get()

2010-04-07 Thread Alexey Vlasov
erstand it why "subdir_path" getting the same very value in one case works perfectly and in the +other fails. Django runs following the instuctions +http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-wit +h-apache -- BR

Re: User permissions to see a view

2010-02-18 Thread Alexey Kostyuk
rote: > Hi Alexey, > > But how do you set a permission for a view? There's no underlying > model to which to add the custom meta permissions. > > ALJ > > On Feb 18, 12:48 pm, Alexey Kostyuk wrote: > > On Thu, 2010-02-18 at 02:30 -0800, ALJ wrote: > > > Fir

Re: User permissions to see a view

2010-02-18 Thread Alexey Kostyuk
uired in your views. See link[1] for details. [1]http://docs.djangoproject.com/en/dev/topics/auth/#the-permission-required-decorator -- Alexey Kostyuk -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googleg

Problem with queryset during model unit-testing

2010-02-12 Thread Alexey
First, the code of my tests.py def test_get_current(self): m = Member.objects.create(...) q = Question.objects.create(name="q1", text="q1", start_datetime=self.day_before, close_datetime=self.day_after, type=self.type) r = Response.objects.create(question=q, text='response') expect

Re: Display most popular video from each category

2010-02-01 Thread Alexey
I guess that video is a dictionary with one element. But dictionary. Try video[0].id On Feb 1, 1:06 pm, grimmus wrote: > When i write out just {{video}} it outputs the id of the object, but > when i try {{video.id}} or {{video.title}} i get nothing. > > On Feb 1, 11:03 am, grimmus wrote: > > > I

Re: 'Reverse' (??) InlineModelAdmin objects

2010-01-30 Thread Alexey
You should inline Books, not Author. So: class BookInline(admin.TabularInline): model = Book class AuthorAdmin(admin.ModelAdmin): ... inlines = [BookInline, ] and then you'll be able to create books in the same time as creating authors. (Books form already has author (foreign key)

Strange error: Error was: 'module' object has no attribute 'validators'

2009-10-24 Thread Alexey Moskvin
Hi! I'm using dango 0.97 pre (yep, my site still was not upgraded to be compatible with trunk). I use apache + fastcgi for it. And I have a strange problem: sometimes (I can't guess the order) some of the views throw such error: Tried audio_index in module mysite.audio.views. Error was: 'module'

How to disable autoescape in django feeds?

2009-10-19 Thread Alexey Moskvin
Hi! I use django feed framework to organize rss feeds for my website. I need to put some hyperlinks to feed items, but al of them are autoescaped ( "<" is replaced with "<" and so on). Is it possible to keep tags in my feed (as I understand, I can't use {% autoescape off %} tag in feed templates)?

Re: django vps hosts

2009-09-24 Thread Alexey Moskvin
You can try Dreamhost Private Server. Also they have added root access for PS not long ago. On 24 сен, 05:54, "neri...@gmail.com" wrote: > I think I'm ready to finally switch to a django vps host due to > problems with django on DreamHost. Can anyone recommend a good vps > host? --~--~-~

Re: Port large webapp from PHP to Django: tips, experiences, links needed

2009-01-05 Thread Alexey Moskvin
Hello! Perhaps, there is no answers to your questions because of some of them are already discussed here and in other django-related places (like cache perfomance e t.c.), some of them are closed to holywar :) (like to use or not to use of the ORM), and some of them like "How about Django in that

Django + non-parseable headers

2008-12-19 Thread Alexey Moskvin
Is it possible to send responce with non-parseable header from django app? afaik, my hoster support it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Django + Apache (FastCGI): how to spread 404 error

2008-11-29 Thread Alexey Moskvin
Hi, I am using Django + Apache (via FastCGI). I've made my own 404 page (404.html in templates dir) and turned debug mode off. When I'm requesting for non-existed page I see my custom error page, but in Apache's log there is something like this: "GET /authors/333.html HTTP/1.1" 200 368 "-" (the re

Failed to send email via send_mail function

2008-11-14 Thread Alexey Moskvin
Hi, I am trying to send mail from my website. Here is my settings py: EMAIL_HOST = 'mail.mydomain.ru' EMAIL_HOST_USER = '[EMAIL PROTECTED]'' EMAIL_HOST_PASSWORD = 'pass' EMAIL_PORT = 587 (credentials are correct, them work from PHP-script), telnet to smtp server works fine. But when I launch my sc

Dev & Production difference: escaping html in admin

2008-11-01 Thread Alexey Moskvin
Hi, I have developer (win) & production (debian) installations of Django 0.97. There is one difference in admin app. I have a photogallery, and Picture model has this method: def show_thumb(self) : return '%s' % (self.get_image_url(), self.get_image_thumb_url(), self.image) also

Re: Problem with compiling django.po file

2008-03-03 Thread Alexey Moskvin
Thanks for quick reply, Malcolm. Now anything is ok. On 3 мар, 21:12, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-03-03 at 10:04 -0800, Alexey Moskvin wrote: > > Hi! I am trying to compile django.po file for Russian language from > > HEAD django revis

Problem with compiling django.po file

2008-03-03 Thread Alexey Moskvin
Hi! I am trying to compile django.po file for Russian language from HEAD django revision using bin/compile-messages.py, but there is such error: processing file django.po in locale\locale\ru\LC_MESSAGES locale\locale\ru\LC_MESSAGES\django.po:1649: a format specification for argu ment 'counter' do

Re: hosting web

2008-02-10 Thread Alexey Moskvin
Ramadas, I want to run my django website (it is not highload, about 1000 visitors per day) on Dreamhost. I have no problems with running up Django there, but now I moved all development to local machine (according to high latency when working with DH using ssh). But I want to move my app there, wh

Re: Custom template tag

2008-01-13 Thread Alexey Moskvin
The correct directory for your tags is "templatetags", not "templatetag" On 13 янв, 19:47, Alessandro <[EMAIL PROTECTED]> wrote: > I'm trying to create a custom template tag. I've added a feedimport > app in my project, added it on my installed apps, and inside it I've > created a templatetag dir

Re: Submit Django book to slashdot book review?

2007-12-28 Thread Alexey Moskvin
As a first step, let's vote for it on Digg: http://digg.com/search?s=django+book&submit=Search§ion=all&type=both&area=all&sort=score :) On 27 дек, 21:39, walterbyrd <[EMAIL PROTECTED]> wrote: > A lot of people read slashdot, and slashdot has never done any sort of > story on Django. There have bee

Re: Very Easy Question

2007-12-20 Thread Alexey Moskvin
Looks strange, I have never used "install.py" for WinXP, see this tutorial: http://thinkhole.org/wp/django-on-windows/. On 19 дек, 23:55, Trev <[EMAIL PROTECTED]> wrote: > Hi, This should take 2 seconds for an experience Django user. > I'm trying to install Django on windows XP. I've installed py

Re: WebAlchemy accelerates Django in 100 times

2007-11-18 Thread Alexey Moskvin
Thanks for your article! I am using Dreamhost too :), thinks, it will be useful. On Nov 18, 10:34 pm, Dima Dogadaylo <[EMAIL PROTECTED]> wrote: > With WebAlchemy only pages involved in form processing are served > directly by Django, the rest of the pages most of the time are served > directly by

Serving media files from Apache to specific users

2007-05-24 Thread Alexey Maksimov
give him the file only if code he enters is right. How can I do this with django? Thanks in advance, Alexey. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen