You should develop locally, because you are guaranteed to make
mistakes that will crash the app and expose debug information you
don't want exposed during development.
If your hosting provider provides a one-click installation, it will
probably set up its environment different than the one on
You can completely eliminate Django from your thinking about the
problem. This is a pure Python question.
A Python file being within a Django project changes nothing about how
Python imports code. Either you're importing something on your Python
path or you're doing a relative import. If your
http://www.kickstarter.com/projects/andrewgodwin/schema-migrations-for-django
I've been using South for a long time and have met Andrew a few times.
He's a genuinely nice guy and has put years of free work into
open-source software.
I encourage anyone who appreciates his work to throw in a few
On Thu, Mar 21, 2013 at 3:44 PM, Lachlan Musicman wrote:
> Frocco,
>
> No, he's saying you can have two databases set up at the same time.
> You can have X databases (I presume).
>
> Cheers
> L.
>
> On 22 March 2013 01:13, frocco wrote:
>> Hi Alan,
>>
>> so
Your timing is just about perfect. Django 1.5 was just released, with
a customizable user model. So use that.
--
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
Postgres.
Just from conversations I've seen in the community, MySQL has a
thousand edge-cases which cause problems. From previous conversations
on thsi topic, I think more people use Postgres.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Do you have SESSION_SAVE_EVERY_REQUEST enabled?
https://docs.djangoproject.com/en/1.4/topics/http/sessions/#session-save-every-request
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails
On Sat, Mar 16, 2013 at 9:25 AM, wrote:
> Secondly, python 2.7 being "highly recommended" for Dj 1.5 can not be used
> in debian stable.
> Installing a virtualenv again undermines package management control.
Using virtualenv does not undermine package management and is the
On Thu, Mar 14, 2013 at 6:03 PM, Larry Martell wrote:
>
> I have been googing this for 2 days and trying lots of different
> things, without success. I really appreciate your help - I've made
> more progress in the last hour when in the previous 48.
Glad I could help,
You can certainly upload a file, then parse it or whatever. I'm just
saying you can't just grab a directory listing from the user.
To upload multiple files, you may be able to just add "multiple" to
your file upload element. A quick Google search found this:
On Thu, Mar 14, 2013 at 4:54 PM, Larry Martell <larry.mart...@gmail.com> wrote:
> On Thu, Mar 14, 2013 at 3:43 PM, Shawn Milochik <sh...@milochik.com> wrote:
>> If you have an HTML file input field in your template you get one
>> automatically from your browser.
bviously, because you
can not rewrite every third-party app to support this (among other
reasons). There was a good tutorial for using threadlocals on the
official Django wiki but someone deleted it in a fit of spite a few
years ago.
If you search for "audit user shawn milochik" in this Google Gro
On Thu, Mar 14, 2013 at 3:51 PM, wrote:
> Sorry can't find a message from you in this newsgroup with any virtualinv
> instructions.
>
https://groups.google.com/d/msg/django-users/aRfuUHY21CU/L9UukI7CmxoJ
--
You received this message because you are subscribed to the Google
If you have an HTML file input field in your template you get one
automatically from your browser.
--
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
I use this and it's great. I haven't tried it with Python 3, but it's
all standard library stuff.
I tweaked mine a bit so it dumps the profile files to my temp folder
instead of the way it works by default. That's because I wanted to
profile AJAX calls, keep multiple runs for the same sites for
Check out the post I made on this forum about five minutes ago. I put
in pretty detailed virtualenv instructions. That should be all you
need to get going.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop
Download virtualenv and create a virtualenv by manually typing the
path to your Python 2.7 executable.
Something like this (path will probably be different on your Mac, type
"which python2.7" to find it:
/usr/bin/python2.7 virtualenv.py /home/user/my_virtualenv
Then activate your virtualenv:
I'm guessing that the POST vs. GET issue was due to a missing CSRF token.
I'm glad you got it working, though.
--
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
On Wed, Mar 13, 2013 at 12:55 PM, wrote:
> Okay - now I directly get server errors, so the Django error handler is
> passed by...
>
It helps if you post the errors.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Delete all your .pyc files in your virtualenv.
find /path/to/virtualenv -name '*.pyc' -exec rm -f {} \;
If that doesn't fix it, manually delete all Django folders from your virtualenv.
Go to the "lib/python2.7/site-packages/" folder in your virtualenv
and look around.
--
You received
On Wed, Mar 13, 2013 at 6:08 AM, wrote:
>
> Question remains how to get current releases of Debian, Python and Django
> running together.
>
As I said in the earlier e-mail, use virtualenv:
https://pypi.python.org/pypi/virtualenv
--
You received this message because you are
You can just download the tarball and "pip install filename."
--
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
The best solution is to use a virtualenv.
The decision to purge Python2.6 was a very, very bad one. You should
never mess with the version Python that comes with your OS. Lots of
software on the system relies on it.
You could try to use aptitude to restore it. Hopefully that will work.
https://docs.djangoproject.com/en/1.5/topics/forms/modelforms/#inline-formsets
--
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
If the refresh is the only thing in your "extrahead" block, then just
don't add block.super to extrahead in your change form, and you can
eliminate the "if" statement from it in your base template.
--
You received this message because you are subscribed to the Google Groups
"Django users"
You'll need to attach something to the "change" event of your slider
to execute a JavaScript function.
The function would contain something like this:
// $.ajax({
// url: your_url,
// cache: 'false',
// success:
Yes. Use a post-save signal.
--
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
I think we've come all the way around to where my response is now
appropriate. :o)
https://groups.google.com/d/msg/django-users/kB27nmftPng/btPKtxvoumYJ
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and
I doubt there's a Django app for that -- it's not a problem for a Web
framework. You may be able to find a project that does this on Github
or Bitbucket.
RSS feeds are just XML files. You need something that will parse the
XML from multiple files, then re-write one XML file containing the
items
On Thu, Mar 7, 2013 at 10:38 AM, frocco wrote:
> Thanks you, I think I will only use Pycharm now to help prevent this issue
> again.
> I hope future versions will offer better trace.
Even better, use version control, such as git. Then your editor will
be irrelevant and it
Are you using it as the key for any encrypted fields, or anything
other than the built-in stuff Django does with session cookies?
If not, I don't think you'll have a problem. Of course, back up your
database first as a precaution, and use version control on your code
so you can revert if
On Tue, Mar 5, 2013 at 5:41 PM, Johan ter Beest wrote:
> Not an Oracle expert at all but maybe this SO answer explains some things?:
>
> http://stackoverflow.com/questions/563090/oracle-what-exactly-do-quotation-marks-around-the-table-name-do
>
So if it's down to
This works for me in Postgres as well. This script:
from django.contrib.auth.models import User
qs = User.objects.filter(username='smilochik')
print qs.query.sql_with_params()
returns this output:
('SELECT "auth_user"."id", "auth_user"."username",
"auth_user"."first_name",
I'm taking a look at this as someone pretty unfamiliar with the ORM.
Hopefully someone more knowledgeable will jump in.
However, in the meantime (if you're feeling adventurous), you could
look in django/db/backends/oracle/base.py and have a look at function
quote_name. A naive look at it makes me
Instead of extends, you could use the "include" directive.
--
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
Sure. Just use the post-save signal:
https://docs.djangoproject.com/en/1.5/ref/signals/#post-save
--
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
Rule #1: Measure first.
Don't add any complexity to fix any bottlenecks until you know for a
fact where they are. Once you know where one is, the solution will
probably be fairly obvious. Caching, denormalization, etc.
Come up with a way to stress-test your app and add measurements.
--
You
On Mon, Mar 4, 2013 at 3:35 PM, frocco wrote:
> ok, I was thinking it was a python code thing.
>
No, you can't execute arbitrary Python code on the user's machine.
People were playing wav files (hampster dance, anyone?) many years ago
in HTML.
This has nothing to do with Django. It's an HTML or maybe a JavaScript
thing. Just do a Google search.
Unless you're going to dynamically generate the WAV file and need help
streaming it, I don't think list this is the best resource.
--
You received this message because you are subscribed to
No, because that will just invalidate the cookie so that they'll have to
log in again when they reopen their browser.
It doesn't magically notify your Django app that the browser closed.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
On Mon, Mar 4, 2013 at 2:05 PM, frocco wrote:
> So are you saying the best I can do is show users that logged in xx minutes
> ago, even through they may have logged off?
Actually, yes. Because most users never log out. They just close their
browsers. So even if you did look at
Probably consume the view with AJAX, doing a POST on the change event
of the slider.
http://api.jquery.com/category/ajax/
Put your result in a dictionary within your view and return it as JSON:
return HttpResponse(json.dumps(result), mimetype="application/json")
--
You received this message
On Mon, Mar 4, 2013 at 1:02 PM, frocco wrote:
> ok, do you have a better idea on how I might do this?
> user is used to seeing this from a PHP site that I am porting.
>
I use this at the shell sometimes:
from django.contrib.auth.models import User
for user in
Yep, I got my full development environment for one of my company's
applications running on it with almost no problem. The one exception
was MongoDB, which is for x86 only, so I had to compile a fork, which
took about 10 hours on the Pi.
It was definitely pretty slow, but it works.
Our stack
On Thu, Feb 28, 2013 at 11:30 AM, Maria wrote:
> Can you tell me where exactly to insert that Variable?
Have a look at this page in the tutorial:
https://docs.djangoproject.com/en/1.5/intro/tutorial03/
See how a variable in the view is added to the context? Exactly like
On Wed, Feb 27, 2013 at 12:46 PM, Doug wrote:
> Thanks Shawn. So what is your take? Only authentication data in User?
> Separate Profile model and app?
I think Russell hit the main points well. Make User only what it needs
to be for identification/authentication, and put other
Do a search on the history of the django-developers mailing list.
There are many reasons, and they were discussed for literally years.
Some of the main ones that come to mind:
first_name/last_name is US-centric.
e-mail address field length was too short.
e-mail address could not be used as the
Ahh, the release of a new version of Django. Always a fantastic time
to support the Django Software Foundation:
https://www.djangoproject.com/foundation/donate/
The money goes to support sprints and other things -- see the donate
page for more details.
--
You received this message because you
Remember, it's just Python. In the end, all you need is for the
'choices' of the field (which is just an iterable) to contain the
value after the form's __init__ so that the form won't consider the
value invalid.
You could:
1. Have a pop-up form that allows the user to submit the new choice
via
You probably need to run syncdb, or migrate if you're using South.
--
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
To answer the original question, my vote is for nginx + gunicorn.
--
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
On 05/02/2012 08:59 AM, alon wrote:
running
$python manager.py shell
opens a python shell
is there any way (a parameter) to make the manager run a python file
with my commands??
thanks
If you have iPython installed then running manage.py shell will run in
iPython.
Then, you can use
Assuming your PYTHONPATH is set up properly, and your
DJANGO_SETTINGS_MODULE is correct or you import your settings file from
your crawler, then you can just import and use the models.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post
I think you have to change your model.
Override the save() method to raise an exception if "self.id is not None."
This won't prevent developers from using the 'update()' or 'delete()'
methods of a queryset, but for a single instance it shouldn't be
editable. It will still be able to be
There's no reason a user couldn't run virtualenv, regardless of permissions.
Download the virtualenv tarball and extract it. It contains a file named
virtualenv.py.
Done.
Run python virtualenv.py some_path and it will work.
--
You received this message because you are subscribed to the
On 04/25/2012 11:04 AM, Marcin Tustin wrote:
Apologies, these are job application questions:
https://www.odesk.com/jobs/Programmers-Python-Django-and-client-side-programming-MySQL_~~c7db577bb2246e77?tot=5000=4&_redirected
There are eleventy bajillion discussions on this already.
Please search the group history on Google Groups.
--
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
For what it's worth, Redis itself allows you to set expiration at the
millisecond level. That won't help you with Django's own caching, but if
you need to write something custom using the Redis Python module then
you can.
--
You received this message because you are subscribed to the Google
The best solution for this, in my opinion and experience, is to use
supervisord. It's easy, requires no root access, and allows you to
control all your long-running processes (Django app, celery, Redis,
MongoDB, etc.) from one place.
--
You received this message because you are subscribed to
On 04/08/2012 11:25 AM, shacker wrote:
alias delpyc='find . -name "*.pyc" -print0 | xargs -0 rm -rf'
Then you safely run "delpyc" from the top level of your project at any
time to remove them all, ensuring that whatever problem you're
experiencing isn't a result of them.
This is probably
On Sat, Apr 7, 2012 at 12:03 AM, xthepoet wrote:
> This was working fine for my Ubuntu 10.04LTE system with Django
> 1.3.1. It seems broken now in 1.4.
>
> In Django 1.4, I get this error TypeError: get_db_prep_value() got an
> unexpected keyword argument 'connection'
Try using pdb and/or logging statements to trace it.
You will almost certainly find your problem that way. If not, you'll be
able to ask a more specific question that will be easier for others to
answer.
On Apr 6, 2012 3:11 PM, "imgrey" wrote:
> I'm trying to store temporary
https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#adding-custom-validation-to-the-admin
Essentially, make a ModelForm exactly as you would normally, and add
logic to it.
You're going to want to change the queryset of the field(s) in question.
For example:
class
Django won't support 3.x for a while. You can't go wrong with 2.7 for now.
https://www.djangoproject.com/weblog/2012/mar/13/py3k/
Shawn
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to
Not a PATH issue, but a PYTHONPATH issue.
Run "python manage.py shell" and try to import 'messages.'
I suspect it's not where you think it is, or its location is not on your
PYTHONPATH.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To
Check your PYTHONPATH. Perhaps it's not set right on the CentOS machine.
The Linux distro shouldn't make a difference, nor should the presence of
Cpanel or MySQL.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send
On 03/15/2012 11:22 PM, Murilo Vicentini wrote:
Uhmmm, thank you a lot. That was what I was looking for! Sorry for
wasting your time. One last question, does this double-underscore
notation work at my html template? Because after filtering I will want
to display the information of the
Look at how the Q objects are being used in the example and it's clear
why that is. It's using the pipe (|) to do an "or" query.
If you want to change how the search works you'll have to add more code:
1. Split the search parameters on whitespace.
2. Create Q objects for searching in either or
You can certainly use Q objects to query across models, just as you can
in a normal QuerySet, by using the double-underscore notation.
https://docs.djangoproject.com/en/1.3/topics/db/queries/#lookups-that-span-relationships
--
You received this message because you are subscribed to the Google
If you don't know which fields your users will be searching on in
advance, you'll have to create Q objects and dynamically build your
query in your view.
https://docs.djangoproject.com/en/1.3/topics/db/queries/#complex-lookups-with-q-objects
--
You received this message because you are
On 03/12/2012 03:34 PM, Ervin Hegedüs wrote:
The main problem is the PromoList is _dynamyc_ - it means all
administrator on admin site should add new PromoList, without me
:), so I can't derivate all subclass in code...
You can't dynamically create database tables on the fly. That would
First, I would avoid using the word 'list' for describing anything in
your own data, since it's a Python built-in. Maybe CodeList or PromoList
or something, if they're going to be promotion codes. Or maybe just
Promo, since a model should be a singular name, and each instance of
your model
You can just use Celery. It's very simple if you use django-celery and
MongoDB as the broker.
Next, you could make sure you're using the ORM effectively. Use
select_related where possible, avoid doing any querying in loops,
pre-pulling data from the database and storing it in memory (in a
I think I'd do this:
Models:
Question
question text
Answer
question foreign key
answer text
correct (boolean)
Guess
user foreign key
answer foreign key
That should be all you need (along with the User model or your own
method of
On 03/11/2012 02:13 PM, jbr3 wrote:
I've gone through the tutorial. But I would just like to get a general
idea of the best way to incorporate all these elements so I can save
and reuse them.
What have you tried, and what specific issues have you run into?
If you ask a question and nobody
You can do exactly that by specifying a sender:
https://docs.djangoproject.com/en/1.3/topics/signals/#connecting-to-signals-sent-by-specific-senders
Also, note that the sender is available in the receiver because it's
always the first argument sent by the signal, so you can have a function
On 03/08/2012 03:44 PM, Stone wrote:
Dear users,
I have developed some web pages and I have never used Django
administration?
Is there any control for controlling access of users?
Do you have any examples?
Thank you
Petr
https://docs.djangoproject.com/en/1.3/topics/auth/#permissions
--
It turns out I was just missing quotes around the () for the custom
formatter.
I just wrote a blog post will a full working example in case anyone else is
interested.
http://shawnmilo.blogspot.com/2012/03/using-json-logging-in-django-and-python.html
--
You received this message because you
Hi everyone. I'm hoping someone has gotten this working and can point
out whatever tiny thing I'm doing wrong here.
I want to log JSON instead of the default. I found JsonFormatter here:
https://github.com/madzak/python-json-logger
It works great with a small script I created based on the
On 03/07/2012 08:58 PM, Andres Reyes wrote:
For me, the main reason to use virtualenv has nothing to do with
security or anything like that, is the convenience of having different
projects with different sets of requirements not interfering with each
other
It's really all about convenience.
On 03/07/2012 05:21 PM, Andre Terra wrote:
Again, don't install as root, use virtualenv. This will save you
headaches in the future, and unless you have an inexcusable reason to
have Django run as root, you shouldn't.
Sincerely,
AT
+1. Also, there is no excusable reason to need to do it as
You're welcome.
To clarify, South is wonderful. It's sqlite that is the problem. The
migrations only fail because sqlite doesn't support all normal SQL commands.
I love sqlite, but it's not always the best solution.
--
You received this message because you are subscribed to the Google Groups
On 03/02/2012 09:55 PM, DF wrote:
Thanks. Still not sure how to wipe the database before starting fresh
with South.
If it's a sqlite database you just delete the file.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group,
If it's dummy data then you can always wipe it and reset South.
There are some issues with sqlite. Not all constraints are enforced and
it doesn't support removing fields, for two biggies. So you can't delete
a field from a model (the migration will fail), and you can't use the
On 03/01/2012 07:48 AM, Stanwin Siow wrote:
Hello,
I want to view the actual json data from django view, is there anyway i can do
that before i parse it into jQuery?
Assuming that you have a dictionary named "return_data," this will do it:
return
Check your code to find out what "get_notes_health" is and you'll be 99% of
the way to your answer. It's something to do with that, and that's
something in your code, not Django itself.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
Read the Django docs about ModelForms, then use the 'exclude' kwarg to
exclude the author from your ModelForm.
Then, use request.user to get the appropriate user in your view and pass
that to the form save(), which you must override to accept the extra
argument, and use that user in the save()
Certainly. People do it all the time.
https://github.com/ask/django-celery
Celery is probably the main way to go, and django-celery makes it
super-simple to set up.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
You can either add the proper path of pg_config to your PATH, or just
extract the psycopg2 and add the full path to pg_config into the config
file it contains then run 'python setup.py install' on the setup.py in
the package.
--
You received this message because you are subscribed to the
On Tue, Feb 21, 2012 at 12:18 PM, Daniel Marquez <
daniel.marquez0...@gmail.com> wrote:
> Wow, I should've caught that. Thanks guys. However, since I needed a
> string, what I did was add "default=x" to the integer field as
> follows:
>
> class Phone(models.Model):
>phonenumber =
On 02/21/2012 10:53 AM, Javier Guerra Giraldez wrote:
i do exactly that. just a tip: to create and maintain the pip
requirements file do:
pip freeze> piprequirementsfile.txt
+1
And it's checked into version control.
Shawn
--
You received this message because you are subscribed to the
Read the error message in your subject line. Then look at the
__unicode__ method of your Phone model. It appears that this is the
problem, and not the Device model.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send
On 02/19/2012 09:29 PM, ds39 wrote:
Thanks for your response. But, would you mind expanding on it a little
bit ?
How about you give it a try and see what you can figure out? In your
view, request.user will return the currently logged-in user (or an
AnonymousUser if they're not logged in).
When you process the form in your view, you'll have access to
request.user. Just use that.
--
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
I think what you're looking for is annotate():
https://docs.djangoproject.com/en/1.3/topics/db/aggregation/
--
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
Why not just put all those manage.py commands in a shell script and run
that?
--
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
I don't think there's one true way. In other words, the answer is "all
of the above," depending on your project and the needs of each
individual test.
It also depends on your code. If you've done TDD, and therefore made
your code easier to test, you can probably do it the simplest way
You override the __init__ of the form object and set the .choices
property of the form field representing the items.
--
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
You can use the divisibleby template tag in combination with a
forloop.counter (both explained on this page):
https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#divisibleby
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to
It's probably related to the 80/20 rule. No tool or framework is going
to be 100% what you need. Use it for the 80%. When your needs can't be
handled by the tool, you can choose to twist yourself into a pretzel
within the constraints of the tool or break free and do it the "manual"
way --
101 - 200 of 1237 matches
Mail list logo