|
Doh004 posted:What am I doing wrong? I just want to select stuff after a certain date: You should just be able to pass in a datetime object. And in fact it will be much easier if you use the forms library. Create a form with a DateTimeField, and in either the form's save() method or in your view code you can pass that DateTimeField's value directly into the queryset.filter(). The below code isn't tested but it should help you get where you're going: in myapp/forms.py: code:
code:
Lamacq fucked around with this message at 20:06 on Oct 13, 2010 |
# ? Oct 13, 2010 19:57 |
|
|
# ? May 21, 2024 00:13 |
|
Lamacq posted:You should just be able to pass in a datetime object. And in fact it will be much easier if you use the forms library. Create a form with a DateTimeField, and in either the form's save() method or in your view code you can pass that DateTimeField's value directly into the queryset.filter(). *edit* Nevermind, server_plus hadn't refreshed itself yet.
|
# ? Oct 13, 2010 20:52 |
|
Can anyone recommend me a decent UK Django host which is fairly affordable? We just need some cheap, reliable and fast. I know a lot of the time it's a case of getting a virtual dedicated but we can't really afford anything like that for this project.
|
# ? Oct 14, 2010 14:01 |
|
Hanpan posted:Can anyone recommend me a decent UK Django host which is fairly affordable? We just need some cheap, reliable and fast. They are my go-to host for anything that doesn't need a VPS.
|
# ? Oct 15, 2010 01:07 |
|
I need help with a pretty serious problem. I've got some social networking integration code that's pretty simple: I get a token from the third party, save it in the session, then redirect them away to the third party website, which then comes back to me and I use that token in my session to complete the authentication. Most of the time, this works fine, but if I click through the third party website very fast, sometimes by the time it gets back to my site, the session variable seems to not have written yet. It's very confusing because everything I've seen indicates that Django sessions should write pretty much instantaneously. I've eliminated everything else I can think of as the problem. The session cookie is set, and works seemingly fine elsewhere. If the problem happens on the first time through, the session value will come back empty. On subsequent attempts, sometimes it will still have the old value. The crazy thing is that if I refresh the page, it will seemingly have had enough time to write properly and will suddenly work. Is it possibly that my database is the problem? I've run test inserts on the session table in the database in it works in milliseconds just as it should, but it is a relatively slow database with a relatively large amount of data. Is there some way I can flush out any pending session requests or something like that? If it really is taking a few seconds for the sessions to save, I have no problem halting the page load until it's been given enough time if there's a way for me to do that. edit: Nevermind, I figured it out. I was using the "cache_db" session engine for performance. When I switched it to just the "db" engine the problem went away. SlightlyMadman fucked around with this message at 16:59 on Oct 19, 2010 |
# ? Oct 18, 2010 23:11 |
|
I've made a website in Django. I'd love to get some feedback about what you think works, and doesn't. It's for musicians who have trouble keeping track of the songs in their repertoire and who don't want to have to visit and revisit lovely tab websites. It's called Geektar. Tell me what you think!
|
# ? Oct 25, 2010 09:36 |
|
alistair posted:I've made a website in Django. I'd love to get some feedback about what you think works, and doesn't. It's for musicians who have trouble keeping track of the songs in their repertoire and who don't want to have to visit and revisit lovely tab websites. How about a demo account?
|
# ? Oct 25, 2010 16:18 |
|
alistair posted:I've made a website in Django. I'd love to get some feedback about what you think works, and doesn't. It's for musicians who have trouble keeping track of the songs in their repertoire and who don't want to have to visit and revisit lovely tab websites. Geektar posted:Internal Server Error
|
# ? Oct 26, 2010 02:12 |
|
Any thoughts on good strategies for doing partial log ins. The site Im working on has to take someones details, do an email confirm, THEN get their credit card details. Once the balance is positive, they can log in. So I want to log them in partially, but not fully. If that makes any sense. Theres already a pretty large site existing, and I dont want to change 100+ methods to be "aware" of this.
|
# ? Oct 27, 2010 04:06 |
|
duck monster posted:Any thoughts on good strategies for doing partial log ins. This sounds like something for permissions and groups - add them to "partial" group first, then move them to the "full" when their balance is positive.
|
# ? Oct 27, 2010 11:04 |
|
Jonnty posted:This sounds like something for permissions and groups - add them to "partial" group first, then move them to the "full" when their balance is positive. Hmm. At the moment I'm using the 'active' flag (That triggers after the initial email confirmation). Maybe the trick might be to not use the usual @decorator to enforce log-in, and just match the username and password for the credit-card screen. Sort of seems funky to me, but I think it'll work. I think. The big catch is I might need to manually stuff the user/customer objects. In the command line util I wrote I'm creating a "bogo-request" that can emulate the request structure for certain functions and poo poo.
|
# ? Oct 28, 2010 03:59 |
|
I agree with Jonnty. Both partial and full login's are actually full login's to Django. Just make either a "partial" group, or a "full" group, and lock down permissions so that when you are in the partial group you can only access the pages to enter your CC info and pay.
|
# ? Oct 28, 2010 11:51 |
|
duck monster posted:Hmm. At the moment I'm using the 'active' flag (That triggers after the initial email confirmation). Maybe the trick might be to not use the usual @decorator to enforce log-in, and just match the username and password for the credit-card screen. Everything you're doing sounds horrendously hacky. What do you think is wrong with using permissions and groups as they're meant to be used?
|
# ? Oct 28, 2010 11:54 |
|
So, I'm thinking about using this InheritanceCastModel as I'd like to be able to go from Product -> Ebook or from Product -> DigitalProduct. Is there any way query across the subclasses and get a queryset containing the all the models that inherit from Product?
|
# ? Oct 29, 2010 14:10 |
|
Jonnty posted:Everything you're doing sounds horrendously hacky. What do you think is wrong with using permissions and groups as they're meant to be used? not rewriting a about 5-10K+ lines of horribly complicated pre-existing voip provider code because the boss had a brain-fart about login sequences. Theres a few hundred pages of configurator in this loving thing and its servicing tens thousands of customers. Not loving with that code is a high priority for me. duck monster fucked around with this message at 01:45 on Nov 2, 2010 |
# ? Nov 2, 2010 01:43 |
|
duck monster posted:not rewriting a about 5-10K+ lines of horribly complicated pre-existing voip provider code because the boss had a brain-fart about login sequences. Theres a few hundred pages of configurator in this loving thing and its servicing tens thousands of customers. Not loving with that code is a high priority for me. But surely you're writing the django code on top of all this?
|
# ? Nov 2, 2010 02:09 |
|
Jonnty posted:But surely you're writing the django code on top of all this? No thats the django. Theres literally hundreds of pages of dynamic content in this site, poo poo, just in the administration alone, let alone the reseller sites, user pages and more, and it uses django's libraries under the hood for a bunch of configuration scripts and all the various mechanics hooking a VOIP website and the underlying mechanics of the provider.
|
# ? Nov 2, 2010 08:08 |
|
duck monster posted:No thats the django. Theres literally hundreds of pages of dynamic content in this site, poo poo, just in the administration alone, let alone the reseller sites, user pages and more, and it uses django's libraries under the hood for a bunch of configuration scripts and all the various mechanics hooking a VOIP website and the underlying mechanics of the provider. Oh. Well, I guess we can't help you given that it sounds like an unusual setup. Just make sure that if you can use groups and permissions in the place of horrible hacks, you do.
|
# ? Nov 2, 2010 14:51 |
|
I'm using Eclipse + Aptana 3 ßeta as a plugin to develop a Django app, the project is registered as Django and debug as Django starts the dev server and I can debug calls as they come in and that is good. I can also from a terminal window, start a python interpreter instance, and from appname.models import ModelName and test code that way. However, what I can't seem to do is combine the two. Is there a way to get a debug console in pydev that I can import my models and have it apply breakpoints to the code? I've tried to right click the model and debug python instance on it, however that fails due to: File "/home/wyntersoft/server/external-src/django/db/models/base.py", line 50, in __new__ kwargs = {"app_label": model_module.__name__.split('.')[-2]} IndexError: list index out of range Exception AttributeError: "'NoneType' object has no attribute 'print_exc'" in <bound method Popen.__del__ of <subprocess.Popen object at 0x1d33490>> ignored (It's trying to convert __main__ to a 3 dotted 'apps.appname.model') I'm pretty sure I've done something like this before but I don't remember what I had done at the time.
|
# ? Nov 3, 2010 14:55 |
|
alistair posted:I've made a website in Django. I'd love to get some feedback about what you think works, and doesn't. It's for musicians who have trouble keeping track of the songs in their repertoire and who don't want to have to visit and revisit lovely tab websites. I like the name, dual meaning intended? 1) It's for geeks who play guitar. 2) its a place for geeks to TAR their guitar resources.
|
# ? Nov 5, 2010 22:42 |
|
My company is looking for kick rear end django developers. If I refer someone I get a fat rear end bonus. We are a startup based in South Beach (our office is two blocks from the beach). The pay is pretty darn good, even for this area. You need to know Django, jQuery, and having experience with automatic deployment, celery, or orbited is a huge plus. If you're interested, send your cover letters and resume's and stuff to nbvfour@gmail.com
|
# ? Nov 9, 2010 02:57 |
|
So I'm trying to use a stored procedure via a cursor and callproc() but I always get the error:code:
code:
code:
code:
Edit: Using a MySQL database Ferg fucked around with this message at 21:24 on Nov 17, 2010 |
# ? Nov 17, 2010 21:20 |
|
Has anyone implemented their own AdminSite? How easy/hard was the basic implementation? I'm in the midst of building a "cms" that's going to be quite large and decently complex in some areas and I'm wondering if using something like AdminSite would save some time. I'd rather not have to make my own implementation for admin actions and inlines and the like (I know I can just use inline forms but that's not as simple as inlines = [Foo]). When using a custom AdminSite, is further customization equivalent to customizing the standard Django admin?
|
# ? Nov 24, 2010 21:05 |
|
MonkeyMaker posted:Has anyone implemented their own AdminSite? How easy/hard was the basic implementation? Two questions 1) Have you looked into some of the existing django CMS options (including Ellington?) 2) Why reinvent the wheel. Just build, chop and modify the existing admin site to your needs. I can't imagine something you wouldn't be able to do within the existing admin system.
|
# ? Nov 25, 2010 02:22 |
|
Hey guys, I need a little help! I'm working on a website for a client and there's a weird bug that only happens: -on the prod server -when Debug=False Basically, when I try to click on an instance of a very specific model in the admin (the model is events.event) when Debug is set to False in the settings, django throws a 500 internal server error. Here is the traceback: code:
admin.py code:
|
# ? Dec 2, 2010 04:43 |
|
Can you show the Event and EventTranslation forms and models?
|
# ? Dec 3, 2010 02:35 |
|
Are custom django-admin commands considered the best way to execute commands that feed data into the applications database? (automatically pulling data from an API) I got it working fine for what I needed, I'm just wondering if this was a good idea or bad idea.
|
# ? Dec 7, 2010 09:48 |
|
hitze posted:Are custom django-admin commands considered the best way to execute commands that feed data into the applications database? (automatically pulling data from an API) I got it working fine for what I needed, I'm just wondering if this was a good idea or bad idea. That is how I pretty much always do it. For example I have a course management app for my school that uses a management command (run via cron) that pulls in course descriptions from the central university course management system via SOAP. I'd be curious to hear what other people do in that situation though.
|
# ? Dec 7, 2010 20:17 |
|
I do the same, although instead of creating one specific admin command per task, I just have a single command that and call through my cron, which can delegate and run tasks as needed. I do it this way so I can mark the various tasks in the database and perform checks to make sure the previous tasks were finished before running the next ones.
|
# ? Dec 7, 2010 21:38 |
|
code:
I'd love to see someone put together a good ncurses (for headless boxes) templatey-menuey-inputy type library for django. Something like "Edit up your screens on this package, load em in your view, and capture the output in some controllers. It'd make writing code for sysadmin stuff *really* easy
|
# ? Dec 8, 2010 04:35 |
|
You can also use Fabric and its Django support for this. It's been a while since I used Django so I don't remember if setup_environ is effectively the same as setting DJANGO_SETTINGS_MODULE, but either way, assuming your project is in the PYTHONPATH, you could do something like: code:
|
# ? Dec 9, 2010 01:40 |
|
I'm curious how people see the future of Django. Personally, it's my go to framework these days over various PHP alternatives. At the company I work at, I managed to convince them to give it a try for a few CMS powered websites and they loved it, although frustratingly moved back to PHP because "it's what everyone uses". When I'm developing web applications, I always like to think I am using the right tool for the job (although granted in this case there isn't really a right or wrong tool) and I do worry that Django may begin to phase out in the next few years, leaving the sites I have programmed stranded with technology no one supports anymore. A friend of mine who went to Djangocon this year disagrees, telling me that Django is still in it's very early youth and expects it to explode with popularity soon... I kinda wish I could share in his optimism.
|
# ? Dec 14, 2010 16:16 |
|
Hanpan posted:A friend of mine who went to Djangocon this year disagrees, telling me that Django is still in it's very early youth and expects it to explode with popularity soon... I kinda wish I could share in his optimism. I tend to agree with this. Django got somewhat lost under the Rails explosion (which seems to be dying out now), but I've noticed the name pop up more and more from layman and random job postings that I come across. The only shops that I've personally encountered that want to hang onto PHP are shops that don't really "get" development in the first place. Chop shops basically, which I've been through 2 in the past 4 years. The shops I've worked for (current company included) that do want to use Django realize it's value in both speed of development and maintainability. At my current company, my project managers love that I can both churn out a CMS (leveraging the admin site) as well as custom admin site tools in virtually no time, as well as the fact that the code is simple enough that they can read without knowing much Python.
|
# ? Dec 14, 2010 17:08 |
|
I've got a pretty strong bias (being a core-developer), but I think we're doing alright. The people who matter (IMO) know what Django can do, we've got solid growth, forward development, what's not to love.
|
# ? Dec 14, 2010 21:23 |
|
Ferg posted:I tend to agree with this. Django got somewhat lost under the Rails explosion (which seems to be dying out now), but I've noticed the name pop up more and more from layman and random job postings that I come across. Google trends supports that Django was somewhat lost under Rails, but also suggests that Django over-came Rails and is growing healthily. Either that or everyone just refers to it as 'Rails' now, which would make it impossible to compare with Django on google trends because 'Rails' is such a common word. http://www.google.com/trends?q=django,+ruby+on+rails&ctab=0&geo=all&date=all&sort=0
|
# ? Dec 15, 2010 00:41 |
|
Surface posted:Google trends supports that Django was somewhat lost under Rails, but also suggests that Django over-came Rails and is growing healthily. Either that or everyone just refers to it as 'Rails' now, which would make it impossible to compare with Django on google trends because 'Rails' is such a common word. Has anybody noticed a ramp up in popularity of Google App Engine lately? Maybe it's just be, but I feel like I've been noticing more chatter about it in the last few months. That would also be a big plus for Django, especially since it seems like nobody actually uses the GAE API. Factor in that the App Engine team has reached out to the Django team to get better integration, that's just more wood on the fire.
|
# ? Dec 15, 2010 00:54 |
|
Surface posted:Google trends supports that Django was somewhat lost under Rails, but also suggests that Django over-came Rails and is growing healthily. Either that or everyone just refers to it as 'Rails' now, which would make it impossible to compare with Django on google trends because 'Rails' is such a common word. Uh, not to disparage the framework, as I really do think it's the best out there and will soon become industry standard, but "Django" is probably still more frequently used in reference to the person than the project.
|
# ? Dec 15, 2010 02:35 |
|
What's everybody's favorite deployment tool? Right now our production setup consists of just 4 web servers (Ubuntu), so it's still manageable to do via ftp but I want to automate. And am I correct in that simply updating the .py files on the webserver doesn't make the changes go live immediately? I've always done a quick restart on Apache on each server, otherwise the changes seem to take several hours to kick in.
|
# ? Dec 17, 2010 17:11 |
|
Yeah, a graceful apache restart is generally needed, or in some environments you can pkill python and that'll take care of it.
|
# ? Dec 17, 2010 17:20 |
|
|
# ? May 21, 2024 00:13 |
|
fabric!
|
# ? Dec 17, 2010 22:19 |