Re: Problems install/download Django 1.5

2013-03-13 Thread Shawn Milochik
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 th

Re: Problems install/download Django 1.5

2013-03-13 Thread Shawn Milochik
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 unsubscribe from this grou

Re: How can my JQuery Sliderbar pass a value to the Veiw and cause the View to execute?

2013-03-13 Thread Shawn Milochik
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 dj

Re: Novice 101 here

2013-03-14 Thread Shawn Milochik
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: so

Re: Problems install/download Django 1.5

2013-03-14 Thread Shawn Milochik
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 r

Re: Profiling django apps using Python 3? No hotspot module.

2013-03-14 Thread Shawn Milochik
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 A/

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
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 django-users+u

Re: Problems install/download Django 1.5

2013-03-14 Thread Shawn Milochik
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 Groups "Django use

Re: Can anyone give me a suggestion or a recommendation as to how I can access the current user's username in the models.py?

2013-03-14 Thread Shawn Milochik
obviously, 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 Googl

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
On Thu, Mar 14, 2013 at 4:54 PM, Larry Martell wrote: > On Thu, Mar 14, 2013 at 3:43 PM, Shawn Milochik wrote: >> If you have an HTML file input field in your template you get one >> automatically from your browser. > > Thanks! Do you know how to change the text displayed

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
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: http://davidwalsh.name/multiple-file-up

Re: plugin for selecting files

2013-03-14 Thread Shawn Milochik
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, but you really should searc

Re: Problems install/download Django 1.5

2013-03-16 Thread Shawn Milochik
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 best-practice and

Re: Session values (occasionally) not being persisted

2013-03-18 Thread Shawn Milochik
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 from

Re: PostgresSQL or MySql with django?

2013-03-18 Thread Shawn Milochik
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

Re: Authentication with Email

2013-03-19 Thread Shawn Milochik
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 dja

Re: PostgresSQL or MySql with django?

2013-03-21 Thread Shawn Milochik
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 you are saying I should connect django

Andrew Godwin to add native migrations to Django's core

2013-03-22 Thread Shawn Milochik
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 po

Re: Python inside Django

2013-03-23 Thread Shawn Milochik
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 impo

Re: first steps with django

2013-03-24 Thread Shawn Milochik
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

Re: first steps with django

2013-03-24 Thread Shawn Milochik
On Sun, Mar 24, 2013 at 11:21 AM, Jeffrey Black wrote: > Give this a look first. > > http://www.jeffknupp.com/blog/2012/10/24/starting-a-django-14-project-the-right-way/ > > jb That's a good post. I give a hearty +1 to virtualenv, South, Fabric, and git. -- You received this message because you

Re: What are the steps to build a website?

2013-03-25 Thread Shawn Milochik
On Mon, Mar 25, 2013 at 8:03 AM, Frankline wrote: > My advice: Stop making resolutions and just start something. You will be > happier if you do. Along the way, you'll have gained an understanding of > your project to so much more. That is how I learned. > > Do not be afraid to make mistakes along

Re: Python path in new 1.4 project structure?

2013-03-25 Thread Shawn Milochik
On Mon, Mar 25, 2013 at 12:56 PM, Carsten Fuchs wrote: >> !!! PONTIFICATION ALERT !!! >> Don't do that. > > Uhh, about the first word, I didn't find it in any dictionary. > Is this somehow related to pope Franziskus? ;-) > >From http://www.thefreedictionary.com/pontificate: To express opinio

Re: What are the steps to build a website?

2013-03-25 Thread Shawn Milochik
On Mon, Mar 25, 2013 at 3:16 PM, Benjamin Marsili wrote: > I am afraid to make mistakes ;). Since there is only one correct way to do > things in Python, I don't want to hack my way around and waste my time after > a few weeks. When there's only "one correct way," it's for a tiny detail of progra

Re: [django-users] Limit uploaded image properties

2013-03-25 Thread Shawn Milochik
It's easy to do it by file size in your server config. For example, in nginx or Apache. You shouldn't have to set it in Django, and I don't believe Django provides any ability to cap it. https://docs.djangoproject.com/en/dev/topics/http/file-uploads/ -- You received this message because you are

Re: Avoiding Sessions

2013-03-27 Thread Shawn Milochik
Use django-redis-sessions as a back end instead of the database. On Mar 27, 2013 9:35 AM, "Venkatraman S" wrote: > So, if i am right, usage of sessions makes an extra call to the DB for > every view with login_required. > > SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login"

Re: Navigation Bar

2013-03-27 Thread Shawn Milochik
If you put these links in your base template it will appear on every page. If you wrap some of those links with template if/endif syntax and check request.user to see if they have permission, you can hide individual links, change their CSS classes, or replace them with a something else. -- You r

Re: Avoiding Sessions

2013-03-27 Thread Shawn Milochik
Some clients may not allow cookies, which would be a problem if that's your full session strategy. If you're storing nothing but the default information in the cookie then there shouldn't be any risk, and in any case the cookie is encrypted with the SECRET_KEY from your settings. If you store addit

Re: Is there a plan for Django to handle NoSQL databases natively?

2013-03-27 Thread Shawn Milochik
Another point is one made by Alex Gaynor at PyCon 2012. Too often, people ask "How do I do X in Django," when they should be asking "How do I do X in Python," or "Does Django have something for X." The first question is too limiting. Remember that Django is just some Python code. The second quest

Re: Doubt regarding JSON/SQL in Django

2013-03-30 Thread Shawn Milochik
Django is just Python, so yes. Just use the json module in the standard library. On Mar 30, 2013 9:23 AM, "Parin Porecha" wrote: > Hi, > > I have just started using Django. I want to create a to-do task > manager application. Users would register, login and can work with > their tasks. So, instea

Re: Doubt regarding JSON/SQL in Django

2013-03-30 Thread Shawn Milochik
On Sat, Mar 30, 2013 at 9:42 AM, Alexis Roda wrote: > Yes, just import json and work with it, but be aware that you'll loose most > of the functionality that makes django so productive: no ModelForms, no > ORM/Querysets, no admin for tasks, ... > That's true. Without the ORM and Forms/ModelForms,

Re: FileField delete and update handling

2013-03-30 Thread Shawn Milochik
You could remember the old path by saving it as a variable in your model's __init__ function. Something like this: self._old_file_path = self.file_path Then in your save(): #only if there was a non-blank path to begin with, and it changed if self._old_file_path and ( self._old_file_

Re: djano user registration form and login(full example)

2013-04-01 Thread Shawn Milochik
Don't even worry about factories. They're for when you want a bunch of forms for the same model on the page at once. Use the UserCreationForm in django.contrib.auth.forms. It only accepts a username and password, so you can either subclass it to add the fields or make your own form and add it to y

Re: djano user registration form and login(full example)

2013-04-06 Thread Shawn Milochik
I've seen some situations where it looked like signals are received multiple times. However, you can easily fix that by checking for the existence of the user in your function, or a try/except that handles the integrity error. Also, if you're starting a new project, consider upgrading to Django 1

Re: Deploying: Desktop to server

2013-04-08 Thread Shawn Milochik
It should be fine, unless you're using encrypted fields, using the SECRET_KEY setting as the key, and have a different key in production. Of course, if you want to keep the databases in sync after that, that's another issue. On Apr 8, 2013 5:09 PM, "Tim Johnson" wrote: > FYI - I'm new to django,

Re: New to testing

2013-04-10 Thread Shawn Milochik
Create a function with a name that *doesn't* start with "test" and you can easily do what you want. Then both tests can call it. -- 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, s

Re: VirtualEnv After the Fact

2013-04-13 Thread Shawn Milochik
You don't have to do anything differently than if you were starting out fresh. A virtualenv is a self-contained thing. Here's a recent blog post I wrote that might help: http://milocast.com/virtualenv.html You don't need to uninstall anything at all. However, you will need to install them again,

Re: django-newsletter, cron job not working

2013-04-17 Thread Shawn Milochik
It's almost certainly an environment issue, such as an issue with your PATH or PYTHONPATH. Just add to the command so that it puts all standard output and standard error to a file to read what the message is. your_command &> /tmp/broken_cron.log Then rig your cron job to run ASAP and read the lo

Re: Help interpreting profiler results (or: why is my app so slow?)

2013-04-17 Thread Shawn Milochik
When you print those out with pstats, sort by cumtime. cumtime = cumulative time That will tell you almost exactly (and maybe really exactly) which code is slow. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group an

Re: What is Model Manager?

2013-04-17 Thread Shawn Milochik
https://docs.djangoproject.com/en/1.5/topics/db/managers/ This should explain everything. On Wed, Apr 17, 2013 at 8:10 PM, cha wrote: > Hello how are you > I want to explain to me what is **"*Model Managers*"** in django ??? and > What are the useful ? > > -- > You received this message becau

Re: Help interpreting profiler results (or: why is my app so slow?)

2013-04-18 Thread Shawn Milochik
Yes, it does look like template tags are taking some time. Is the page huge? Are you doing a ton of formatting? Is there something you could maybe move to server-side? Also, this might help with caching bits of your output: On Thu, Apr 18, 2013 at 6:17 AM, Matt Andrews wrote: > > On Thursday,

Re: Help interpreting profiler results (or: why is my app so slow?)

2013-04-18 Thread Shawn Milochik
Hit send too soon: https://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching On Thu, Apr 18, 2013 at 8:39 AM, Shawn Milochik wrote: > Yes, it does look like template tags are taking some time. Is the page > huge? Are you doing a ton of formatting? Is there somethi

Re: django-newsletter, cron job not working

2013-04-18 Thread Shawn Milochik
Here's an example of something taken straight from my crontab from a WebFaction account: 44 * * * * cd ~/webapps/awstats_milocast;./update_awstats.sh This runs on minute 44 of every hour. There are five "time" parameters. The first one is "minute." If you set a number there, it'll run on that min

Re: How many workers do you run on one machine using django celery?

2013-04-20 Thread Shawn Milochik
In addition to Michael's good comments: I suspect you won't have 100,000 tasks coming in every second of every day. If you have to send out SMS messages and some of them take a few minutes to go out, that should be fine for most purposes. In addition, some SMS services have some limit per minute/h

Re: Is it possible to create website like Squarespace or Wix in django?

2013-04-20 Thread Shawn Milochik
I don't think there's any kind of site you *can't* make with Django. It's a Web framework, not a CMS. It's definitely possible (and trivial) to offer a wide variety of templates. It's also possible to allow a user to customize and save a template, but that comes with a whole host of security risks

Re: logging within celery processes

2013-04-20 Thread Shawn Milochik
I don't know the solution, but we had the same problem. We ended up dumping Celery in favor of rq. It's much easier to work with and we were already using Redis as a back-end. If you do figure out the solution to this, please post it here. Also, consider rq. We used Celery quite a bit and the chan

Re: I have searched and searched for a CSV Importer that does the following.

2013-04-23 Thread Shawn Milochik
On Tue, Apr 23, 2013 at 10:37 AM, Derek wrote: > > Yes, this is what I did; it is a significant amount of work to create such > a facility and I would have been glad if someone had done this already! > > Of course, linking fields to column headers is the very simple part of it > - you still need

Re: Upload csv file

2013-04-23 Thread Shawn Milochik
MongoDB documents are practically indistinguishable from Python dictionaries. You can use the csv module (csv.DictReader) to read in the CSV file and the pymongo library to write those dicts to Mongo. This really has nothing at all to do with Django. -- You received this message because you are

Re: Upload csv file

2013-04-24 Thread Shawn Milochik
http://docs.python.org/2/library/csv.html#csv.DictReader -- 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 th

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
Try iterating through your output in the view and look at field, field.content, and if field.help_text. Somewhere you have a null value which is None in Python. Since the traceback you posted (if it's complete) is all from Django's code and not yours, then the error must be in your data. -- You

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
nt know wich field and how to find out > > > 2013/4/24 Shawn Milochik > >> Try iterating through your output in the view and look at field, >> field.content, and if field.help_text. Somewhere you have a null value >> which is None in Python. >> >> Since

Re: Django admin error : coercing to Unicode: need string or buffer, NoneType found

2013-04-24 Thread Shawn Milochik
Ah, I missed that point. You could temporarily create an __init__ override in your model and put the code there. -- 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

Re: Blog writen by django?

2013-04-27 Thread Shawn Milochik
Do a Google search. There are thousands. -- 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 e

Re: django-filetransfers and HttpResponseRedirect

2013-04-29 Thread Shawn Milochik
Use HttpResponseRedirect, as you mention in your subject line. -- 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

Re: Store arbitrary key-value pairs in model?

2013-04-29 Thread Shawn Milochik
A Django app sometimes benefits from a "No-SQL" database on the side. You could do what you want using a text field and storing JSON or a pickled value, but I advise against it. It's hard to query and de-duplicate. -- You received this message because you are subscribed to the Google Groups "Dja

Re: quick problem with str and int

2013-04-29 Thread Shawn Milochik
How about adding a get_absolute_url method to your model? Then you can take care of the logic there, instead of the template. https://docs.djangoproject.com/en/1.5/ref/models/instances/#get-absolute-url Worst-case, you can just do the conversion in your view and assign it as a new property to you

Re: Little help needed writing models for star-ratings app

2013-04-29 Thread Shawn Milochik
It looks like you're not looking for a "little help." You're looking for someone to do the work for you. You'll get the best help if you try something, get stuck, and explain what you tried and what the error is. Here is the documentation for using the ORM. This is not a snarky response -- I real

Re: Newbie: trying to get an existing project running on a different machine

2013-04-29 Thread Shawn Milochik
Do you have piston installed in the virtualenv where you're trying to test this? Check for any "local settings" on the production server that it may be using but which aren't available through the repository. -- You received this message because you are subscribed to the Google Groups "Django u

Re: Little help needed writing models for star-ratings app

2013-04-29 Thread Shawn Milochik
I reiterate: Please read the ORM documentation. That will answer all of your questions. Once you understand how to do queries in the ORM (and which queries are easier than others) then you will know how to design your models so that they'll be easy to work with. As you're reading, make notes about

Re: Need explanation of the flow of info between my javascript, my View, and my template, trying to diagnose my current roadblock.

2013-04-30 Thread Shawn Milochik
If I understand your question and your code properly, the problem is that you are expecting a redirect, but what's happening is that the raw HTML from the view is being returned to your JavaScript function, which does nothing with it. It seems like what you should do is just do a normal HTML form

Re: Need explanation of the flow of info between my javascript, my View, and my template, trying to diagnose my current roadblock.

2013-04-30 Thread Shawn Milochik
You're welcome. You may be new to it, but you ask better questions than most I see. When I see "How do I do X?" I usually ignore it. When I see "Here's what I did. It's not working for some reason" then I try to help if I can. Keep up the good work. Shawn -- You received this message because you

Re: Akiban + Django

2013-05-02 Thread Shawn Milochik
The short answer is that if you can use it in Python, you can use it in Django. -- 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...@googlegr

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Shawn Milochik
https://docs.djangoproject.com/en/1.5/howto/custom-model-fields/#converting-database-values-to-python-objects https://docs.djangoproject.com/en/1.5/howto/custom-model-fields/#converting-python-objects-to-query-values Have a look at these two methods of a custom field. You can pretty easily make yo

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Shawn Milochik
On Fri, May 3, 2013 at 8:06 AM, Marc wrote: Thanks, i'll play with that and see what I can come up with. > Docs are good, but sometimes really hard to read/find what you need :) > > > > Oh come on, you mean "get_prep_value" and "to_python" weren't obvious? ;o) -- You received this message becau

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Shawn Milochik
On Fri, May 3, 2013 at 8:37 AM, Marc wrote: So Tom: i can't use those methods Shawn pointed out? What I was hoping I > can do is override the code that builds the SQL query. > Further looking I think thats correct; as I did get a module working I > found and played with which uses those methods

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Shawn Milochik
On Fri, May 3, 2013 at 10:22 AM, Marc wrote: Thanks. I understood and that doesn't work for my project as python/django > can't handle the returned bytes I need to use. > my project requires that the values are stored using the result of > aes_encrypt from MySQL because other systems not made in

Re: Django - Query

2013-05-05 Thread Shawn Milochik
On Sun, May 5, 2013 at 3:29 PM, Hélio Miranda wrote: > How do I get the two? > > -- > > Use .filter() instead of .get(). -- 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

Re: a simple form confirmation before commit instance to database

2013-05-06 Thread Shawn Milochik
That feels like the wrong place to do it. The simplest thing would be to just pop up a JavaScript dialog that intercepts the form POST, and ask then. This does exactly what you want with the exception that it'll ask them whether or not the form is valid, but I think that's irrelevant. If you do i

Re: Some basic questions from somebody learning Django/Python

2013-05-06 Thread Shawn Milochik
Hi Christopher. In general, you don't install a Django app -- you just run it with ./manage.py runserver. If it's a "pluggable app" it should have an installer. If it needs to be installed and the author hasn't provided an easy way for you to do it, it's probably better to learn from code written

Re: Postgres/psycopg2 setup error

2013-05-06 Thread Shawn Milochik
I see you posted the question on StackOverflow as well. A quick search turned up the same problem there, with a solution that allegedly works: http://stackoverflow.com/questions/14863723/psycopg2-import-error-due-to-failure-to-load-libraries -- You received this message because you are subscribe

Re: Noobie questions about Django and Databases

2013-05-06 Thread Shawn Milochik
In that case, you'd just add a 'model number' field to your table. In the Django ORM, each Model instance relates to a table. So you aren't going to want to have more than one to write your code against. Just read through these two pages and everything should make sense: https://docs.djangoproje

Re: Django html input error

2013-05-06 Thread Shawn Milochik
No, it's a bad solution because it only fixes *some* unicode errors, and only on your single machine. See this. In my opinion it's the easiest Python unicode explanation to understand: http://farmdev.com/talks/unicode/ -- You received this message because you are subscribed to the Google Groups

Re: Accessing django development server using internet

2013-05-07 Thread Shawn Milochik
pip install gunicorn, then run python manage.py run_gunicorn instead of runserver. Ensure that the port you're running your app on is being handled properly by your Web server app (nginx or Apache). This means that hits to your URL hit the Web server and are being directed internally at your liste

Re: Some basic questions from somebody learning Django/Python

2013-05-07 Thread Shawn Milochik
Coincidentally, Russell just gave the answer to that question less than an hour ago, so I'll just refer you to his reply: https://groups.google.com/d/msg/django-users/AMYLfQo6Ba4/Y-57B0i7qy4J -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: middleware

2013-05-09 Thread Shawn Milochik
In your middleware you'll have access to the request object, so you can easily check the URL, user, etc. -- 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-u

Re: Django with 2 subapps with same name

2013-05-10 Thread Shawn Milochik
It is not possible. https://groups.google.com/forum/#!msg/django-users/AMYLfQo6Ba4/Y-57B0i7qy4J -- 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+uns

Re: Redirect specific username upon login to email change page

2013-05-13 Thread Shawn Milochik
Use a combination of the redirect() shortcut and request.user. https://docs.djangoproject.com/en/1.5/topics/http/shortcuts/#redirect -- 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 i

Re: help regarding celery implementation with django

2013-05-14 Thread Shawn Milochik
I think your question boils down to "How do I use Redis from Python." The answer is 'pip install redis' and play with it. Figure out which commands you'll need by looking at them in the Redis docs. The docs are good. http://redis.io/commands At the top of the page you can filter by type. I'd sta

Re: Atomic test/set/get using django cache API?

2013-05-14 Thread Shawn Milochik
I love and recommend Redis. If you can use a Redis key instead of Django's cache, you can call get() on the key. If the result is not None, now you have it. If it is None, you know it didn't exist, so you can set it. I don't think it's possible to have it work the way you want with the default ca

Re: Looking For A Solid Learning Tutorial

2011-04-13 Thread Shawn Milochik
Try James Bennett's book, "Practical Django Projects." It walks you step-by-step through creating full apps. Shawn -- 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 unsubscri

Re: cURL or wget with contrib.auth and CSRF

2011-04-14 Thread Shawn Milochik
This isn't a Django question. Check out the man pages for curl and wget -- both have the ability to GET & POST and retain cookie data for future requests. You shouldn't have to change anything in Django. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Need straightforward way to pre-process form data

2011-04-14 Thread Shawn Milochik
I believe you can customize your form's __init__ to handle this. In the __init__, call the super() __init__ and then do your dynamic field jazz. After that, you should be able to manipulate the data. -- You received this message because you are subscribed to the Google Groups "Django users" gr

Re: testing views problem

2011-04-14 Thread Shawn Milochik
If the code sample you pasted is accurate, then you have an extra space between 'activate' and the next forward-slash. -- 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: Need straightforward way to pre-process form data

2011-04-14 Thread Shawn Milochik
No data validation takes place any time during __init__, so it's not too late. -- 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 dja

Re: Form with two select boxes + javascript - selection gets destroyed???

2011-04-15 Thread Shawn Milochik
Two things: 1. Does your form use a prefix? 2. Please post a relevant excerpt of your request.POST data. -- 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: Form with two select boxes + javascript - selection gets destroyed???

2011-04-15 Thread Shawn Milochik
Can you show us the field declaration in your form -- specifically the value of 'choices'? In an item is not in the original choices then it's invalid. -- 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: Using request.GET and having issues

2011-04-16 Thread Shawn Milochik
This doesn't appear to be a Django question. Your 'results' variable is being populated by checking the length of an nltk.text.ConcordanceIndex() instance. I'm not familiar with the nltk module, but I'm assuming you are at least a little, since you're using it. It appears that its length isn't usef

Re: get_model not working

2011-04-18 Thread Shawn Milochik
This sounds like a perfect job for pdb. One easy way is to put these lines where you want it to pause execution: import pdb pdb.set_trace() Then you can type 'n' (next) to go line-by-line. If you type a variable name or "print varname" at any time it will print the current value. Anothe

Growl-like notifications in your Django app.

2011-04-18 Thread Shawn Milochik
http://www.erichynds.com/examples/jquery-notify/ I just implemented this today and it's awesome. It is great to use with the new 'messages' app added to Django 1.2, and also with your own JavaScript code live during the life of a page. It's not 100% on-topic for the list, but I think it's fair co

Re: Growl-like notifications in your Django app.

2011-04-18 Thread Shawn Milochik
Rudi, I'm experimenting with Hookbox (http://hookbox.org/) myself for a bunch of uses, including this sort of thing. If you get something going with ape please post a follow-up, and I'll do the same with Hookbox. It would help me (and the community) a lot, because it seems like there's very little

Re: Growl-like notifications in your Django app.

2011-04-18 Thread Shawn Milochik
Thanks for those links. I started reading the first one and will check them both out. Shawn -- 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

Re: For any dictionary in a list, does a value exist for a key?

2011-04-18 Thread Shawn Milochik
You can do this pretty easily in Python with any(): if any(['foo' in x for x in my_list]): #do something However, I don't know of a way to do it in a template, which is what it appears you're asking. -- You received this message because you are subscribed to the Google Groups "Django users

Re: How to fix a column typo in django

2011-04-18 Thread Shawn Milochik
You can use South. south.aeracode.org You'd create a schema migration to create the new field, then a data migration to populate the new field from the old, then another schema migration to remove the original field. Shawn -- You received this message because you are subscribed to the Google G

Re: already logged in users

2011-04-19 Thread Shawn Milochik
On Tue, Apr 19, 2011 at 2:01 PM, Luterien wrote: > I'm using the template method for now since i dont know much about > decorators. I tried using the decorators at contrib.auth.decorators > but it didnt work. Doing something the wrong way you're comfortable with instead of making yourself better

Re: already logged in users

2011-04-19 Thread Shawn Milochik
Cool. I understand putting a temporary solution in place to get the job done sometimes. Glad I could help. Shawn -- 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: Debugging a unittest

2011-04-19 Thread Shawn Milochik
www.doughellmann.com/PyMOTW/pdb/ -- 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 mo

Re: Custom form field

2011-04-20 Thread Shawn Milochik
Maybe just save your time and re-use some tasty open-source. Examples: http://code.google.com/p/django-ajax-selects/ http://code.google.com/p/django-autocomplete/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: readonly field ordering issue

2011-04-20 Thread Shawn Milochik
I think you can just specify a 'fields' attribute in your admin model to fix this. It should retain the order in which they're entered. http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fields -- You received this message because you are subscribed to the Go

Re: Custom form field

2011-04-20 Thread Shawn Milochik
http://docs.djangoproject.com/en/1.3/howto/custom-model-fields/ What specific problems/errors are you experiencing? -- 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 unsubscri

Re: readonly field ordering issue

2011-04-20 Thread Shawn Milochik
On Wed, Apr 20, 2011 at 11:13 AM, Bobby Roberts wrote: > thanks!  That is exactly what i used.  would be great if the docs > actually said that would solve the issue. > You're allowed to open a ticket and submit a patch. ;o) -- You received this message because you are subscribed to the Google

<    2   3   4   5   6   7   8   9   10   11   >