In Django 1.6 it QuerySet was in package "django.db.models.query.QuerySet".
But since 1.7 it also may be imported with "django.db.models.QuerySet".
Is "django.db.models.query.QuerySet" deprecated since 1.7? What is the
"official" way to import QuerySet? I can't find any documentation regard
thi
to add this app to INSTALLED_APPS and set
FIELDS=["last_name", "first_name"] in my settings.py and it works.
I have the same for "get_absolute_url" method as well.
It is not very pythonic way to do something, but it works.
> -James
> On May 18, 2015
Hello.
> I am not aware of a good solution to this problem other than manually
> adding the .select_related() to your query on the list-of-users page.
>
Oh :((
>
> > I am really unhappy with idea of using custom user model.
>
> Why?
>
> If it's because this is an existing project and the p
Hello,
I want to add just a one field to my model, and this field participates in
user representation ( I use monkeypatch to change __str__).
Django manual tells me to create profile with one-to-one relation in this
case. Well, it may work. But if I have with 250 users, I face 250
"SELECT" qu
You also may use widgets instead of "extends":
http://sniplates.readthedocs.org/en/latest/
On Friday, May 15, 2015 at 6:50:40 AM UTC+3, sacrac wrote:
>
> Thank Andre Luis :)
>
> On Wed, May 13, 2015 at 1:41 PM, André Luiz > wrote:
>
>> extends should always be on first line of file and it accep
Hi.
I believe the best installation is Apache + wsgi and nginx for static.
In some scenarios Apache performance may be your bottleneck, but:
1) there are a lot of ways to tune it. Read about "Multi-Processing
Modules" for example.
2) 99% of web applications do have different bottlenecks, not th
Hello,
I have many places in my app where user (from user model) is displayed:
templates, forms, fliters, tables etc.
It is displayed as username everywhere.
I want it to be displayed as first_name/last_name.
I can do that with monkey patching:
@receiver(request_started)
def patch(*args, **kwa
looks silly. I will
create custom form or review my model structure.
On Wednesday, April 22, 2015 at 3:38:30 PM UTC+3, Ilya Kazakevich wrote:
>
> Thank you, that may work, but I feel that I reinventing wheel here.
>
> Actually, there are inline_formset and CreateWithInlinesView (fr
What about putting it into ?
On Thursday, April 9, 2015 at 8:50:50 PM UTC+3, Eric Plumb wrote:
>
> Hi Djangoers!
>
> Sometimes in the course of human events it becomes necessary to encode a
> JSON object directly into a template. We all prefer AJAX and REST APIs and
> the rest of the TOFLAs, bu
Wednesday, April 22, 2015 at 2:40:56 AM UTC+3, Vijay Khemlani wrote:
>
> What about and old-school DetailView?
>
> def get_context_data -> Creates the two forms and puts them in the context
>
> def post -> Validates and process the forms
>
>
>
> On Tue, Apr 21, 2015
Hello,
I have several models with one-to-one relation. For example
class Task(models.Model):
initial_comment = models.OneToOneField('Comment')
# A pack of other fields
class Comment(models.Model)
body = RichTextField()
# A pack of other fields
I want to create "create view" based
This tutorial is about client-side (JavaScript) while Python/Django is
server side:)
What are you trying to do? Pass all options from HTML page to server side?
What for?
In most cases you want to pass the option selected by user to server. You
must first read about HTML forms and how to submit
You can't just store stream in database.
You need to buffer it first, and then save to field like
blob: http://www.postgresql.org/docs/9.1/static/datatype-binary.html
I am not sure that relational database is the best place to store binary
data coming from devices.
On Thursday, April 2, 2015 a
Simon is right. I recommend
this http://martinfowler.com/books/continuousDelivery.html
On Thursday, April 2, 2015 at 1:57:40 PM UTC+3, guettli wrote:
>
>
>
> Am 02.04.2015 um 03:13 schrieb Ilya Kazakevich:
> > Hello.
> >
> > What exactly are you trying to achie
Why do you need it?
Web-browser encodes your data using Percent-encoding
(http://en.wikipedia.org/wiki/Percent-encoding) by default.
You may base64 your code on client side using JS and decode it on server
side using python, but it seems useless for me. base64 is used to eliminate
special cha
Hello.
What exactly are you trying to achieve?
If you have some part of functionality that is interesting for other
people/projects and hence should be shared via pypi, you should extract it
as reusable app. Projects, how ever, are not reusable. If you need a fast
way to install al project req
Hello.
Django is full-stack *web* framework, so it has some web-specific
shortcuts, and probably does not fit ideally in enterprise patterns.
For example, it does not encourage you to have "backend server" and
"frontend server" connected via SOAP/XML/ESB like in "classical" enterprise
approach
This one "{% static "" %}" is MUCH better than {{STATIC_URL }}.
It is recommended way.
You almost never need to use {{STATIC_URL }}.
On Friday, March 20, 2015 at 3:59:08 AM UTC+3, Fellipe Henrique wrote:
>
> Hi,
>
> In my template, when I made a reference to my Static folder.. what's the
>
django-admin creates infrastructure required for your project, and there
should be more than 3 files.
On *nix systems django-admin is py script with shebang, but due to windows
command processor limitations (cmd) on windows there is executable file
which actually calls django-admin.
So, you sh
There are 2 types of Apps in Django:
1) reusable one with clear, documented interface
2) not reusable one, because it depends on current project heavily.
Ideally, project consists of several reusable-apps, and project-specific
data is stored in project-specific places like URLConf or filesystem
I like Simon's ideas about shared location and separate app (Django
encourages us to use apps to share anything), but you also may share them
on VCS level. SVN supports "external" checkout, in git you may add one
repository to another.
\project1\templates\shared_temps
\project2\templates\share
You may start from highest level testing:
1) create "usage scenarios" for your website. Like "customer opens page
'foo', and should see 'bar'". You use such scenarios for manual testing,
right?
2) code such scenarios against Django project. You may use BDD testing
tools (like lettuce or behave)
What is the point of NOT translating "month" to English?
There are several solutions:
1) Create custom templates / custom tags and include them based on
language. For example you may have "foo.nl.html" and "foo.en.html" and
include "foo..html". But I believe using different HTMLs for
different
You never know what would be popular in next several years. In late 90th
Perl was the main web development language. In 2000th it was PHP. Now it is
Ruby and Python. If you love Python, use Django but study Ruby/RoR in
background. Ruby is not rocket science and you should not have any serious
t
In modern world any heavy loaded site should have HORIZONTAL SCALING. That
means it should support scale by adding new servers to cluster.
With horizontal scaling you should not care about how python is slow on
each node, until you have traffic like Facebook or Guthub have. I believe
99% website
.48.45:389";
ldp = ldap.initialize(LDAP_URL)
print ldp.bind(LOGIN, PASSWORD)
for (dn, entry) in ldp.search_s(GROUP_DN, ldap.SCOPE_ONELEVEL): # Scope!!!
print(entry)
ldp.unbind()
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Dev
ht Commander.
But I believe you need to read some books or tutorials about Ubuntu before.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>
Hello,
Do you have different versions of python or libs? Use virtual env.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[
PyCharm will support DjangoLint inspections soon, I believe:
http://youtrack.jetbrains.com/issue/PY-4554
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@
Hello,
You may use websockets on client and asyncio on serves as it is done here:
https://github.com/throwable-one/chat-async/
But websockets require modern client and asyncio require python 3.4 (but
asyncio is standard and worth using, anyway)
Ilya Kazakevich,
JetBrains PyCharm (Best Python
Oh, sorry, I forgot it is about manage command.
Try to disable USE_I18N (USE_I18N = False) and check if it works.
See "django\utils\translation\__ini__.py" in your site-libs for details (class
Trans, its getattr and get_language() function)
Ilya Kazakevich,
JetBrains PyCharm (B
LocaleMiddleware sets your language to one, provided by your webbrowser.
Tty to disable LocaleMiddleware or configure your browser to use different
language
(http://stackoverflow.com/questions/7769061/how-to-add-custom-accept-languages-to-chrome-for-pseudolocalization-testing)
Ilya Kazakevich
depend on LANGUAGE_CODE. You should use
get_language() to support I18N
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@g
s download database drivers automatically (like 0xDBE or PyCharm), it
is sad that Aptana does not do it)
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@google
You probably need to have "insert_date" field and store entry created date
there.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups
I believe you need software that supports distributed transaction coordination
protocols ("X/Open XA" Is good example) and both DBs should support this
protocol and two-phase commit.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
&qu
Instead of
from holes.models import HoleImage
write
from holes.models import HoleImage, Hole
Please read https://docs.python.org/2/tutorial/modules.html
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>
d PHP _before_
zend/phpcacke/joomla or wordpress, right?:) )
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com
To use any symbol (including " HoleImage" class) you need to import it first.
You've imported Hole (from holes.models import Hole), but you forgot to import
HoleImage.
So, you got " name 'HoleImage' is not defined " error.
It is better to use IDE, because it
Hello,
Use Primary Key:
https://docs.djangoproject.com/en/dev/topics/db/models/#automatic-primary-key-fields
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@
Hello,
What are you trying to do? Split string? Copy array? You probably need to use
builtin functions for that.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>Fr
Hello,
Try to use debugger. https://docs.python.org/2/library/pdb.html or
http://www.jetbrains.com/pycharm/features/#debugger
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>Fr
Hello,
There are a lot of ways to do that: from simple "rsync" or "checkout
periodically with cron" (in both cases you need to move your settings to
environment vars) to engines like Fabric.
Even books are written: (http://continuousdelivery.com/)
Ilya Kazakevich,
Jet
What algorithm is used for keys in HTTPS on your installation?
AFAIK, Safari@iOS does NOT support DSA keys (only RSA keys are supported).
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Messa
://httpd.apache.org/docs/2.2/logs.html )
3) NEVER hardcode urls! Use URL tag
(https://docs.djangoproject.com/en/dev/ref/templates/builtins/#url)
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Messa
quot; to find your postgres installation.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com] On Behal
this field
whatever you want.
I believe "id" is nice.
I use DetailView unless I need really custom logic, so I use "slug" almost
always.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
ly, you should start with Django 1.6 or even 1.7 (1.5 is outdated!) and
use official Django tutorial
(https://docs.djangoproject.com/en/dev/intro/tutorial01/) instead of this book.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pl
Hello,
Shebangs are not supported by windows command processor (cmd).
Try:
C:\Python27\python.exe django-admin.py
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>Fr
Hello,
* Silverlight
* JavaFX
* Flash
* ActiveX (Windows only)
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@g
'app_name.model_class_name'.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com] On Behalf Of Inderpree
http://stackoverflow.com/questions/12758786/redirect-return-to-same-previous-page-in-django
See also: https://docs.djangoproject.com/en/dev/ref/request-response/
Be sure to check this header exists.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"De
Hello,
For web services (I believe you speak about SOAP web services) check:
* https://wiki.python.org/moin/WebServices (SOAP section). It has info about
Python SOAP client and server libraries.
* For .NET (client) :
http://stackoverflow.com/questions/1302525/how-to-use-a-wsdl
Ilya Kazakevich
Hello,
Try managers: https://docs.djangoproject.com/en/1.6/topics/db/managers/
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[
Django and try to move one site to it. Then, move next one.
Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"
>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googl
Hello,
There may be some web-proxy between client and server that limits request size
or time. Server may limit it as well.
* Remove all proxies between client and server
* Try to use different client (browser for example)
* Check your server configuration for request size and timeout.
Ilya
56 matches
Mail list logo