Job opporunity for an experienced Django/Python software engineer - Corvallis, OR (Remote possible)

2019-07-25 Thread Nikolas Stevenson-Molnar
The Conservation Biology Institute (CBI) is a non-profit organization of scientists, GIS analysts, spatial modellers, and software engineers. Our software development team works closely with scientists and stakeholders to build software that helps them better understand and communicate their data,

Re: Djnago 1.9.5 with SQL SERVER 2012 connect??

2016-05-13 Thread Nikolas Stevenson-Molnar
It looks like djano_pyodbc doesn’t support Django 1.9 yet: https://github.com/lionheart/django-pyodbc/issues/109 If you don’t need 1.9, you could use Django 1.8 instead. _Nik > On May 13, 2016, at 1:05 AM, mandeep444

Re: Image Upload

2016-05-12 Thread Nikolas Stevenson-Molnar
Try removing this line: new_item.image = request.FILES['image’] That should already be handled for you by the form. > On May 12, 2016, at 6:30 PM, Jagdeep Sidhu wrote: > > In this i am getting the message "Image added successfully" but it not going > in the database >

Re: Why not working ?

2016-02-29 Thread Nikolas Stevenson-Molnar
Please be more specific. What isn't working? What is the desired vs actual result? On Monday, February 29, 2016 at 8:39:54 AM UTC-8, setivo...@gmail.com wrote: > > > my model > . > > class Translator(models.Model): > """ > Model for dictionaries tranlations >

Re: form dynamic javascript input in django

2016-02-28 Thread Nikolas Stevenson-Molnar
emove element containing the fields > $row.remove(); > }); > }); > > > -- > 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

Re: Debugging DJango app on production for High CPU Usage

2016-02-26 Thread Nikolas Stevenson-Molnar
is directly proportional to the load > (increases with the increase in load). Memory usage seems to be fine. > > Thanks. > > On Friday, February 26, 2016 at 3:32:23 AM UTC+5:30, Nikolas > Stevenson-Molnar wrote: >> >> Which cache backend are you using? Also, how's your memory

Re: Debugging DJango app on production for High CPU Usage

2016-02-25 Thread Nikolas Stevenson-Molnar
e. > > Thanks. > > > On Thursday, February 25, 2016 at 1:47:43 AM UTC+5:30, Nikolas > Stevenson-Molnar wrote: >> >> Just to be clear: is is the uwsgi process(es) consuming the CPU? I ask >> because you mention DB queries, which wouldn't impact the CPU of uwsgi

Re: Debugging DJango app on production for High CPU Usage

2016-02-24 Thread Nikolas Stevenson-Molnar
Just to be clear: is is the uwsgi process(es) consuming the CPU? I ask because you mention DB queries, which wouldn't impact the CPU of uwsgi (you'd see that reflected in the database process). On Tuesday, February 23, 2016 at 8:59:28 PM UTC-8, Web Architect wrote: > > Hi, > > We have an

Re: Missing button image

2016-02-17 Thread Nikolas Stevenson-Molnar
More information would be helpful here. Where are the missing images being loaded from? Are they static files related to your project? Are they static files hosted elsewhere? Are they images dynamically generated by a view? Do the images ever display correctly? (e.g., do they display in

Re: var1 = var2 = var3

2016-02-17 Thread Nikolas Stevenson-Molnar
The term is "chained assignment" (applied to other languages as well). https://en.wikipedia.org/wiki/Assignment_(computer_science)#Chained_assignment _Nik On Tuesday, February 16, 2016 at 12:06:10 PM UTC-8, anotherdjangonewby wrote: > > Hi, > > this may be a bit off-topic, but: > > How are

[Job] Software Engineer opening in Corvallis, Oregon

2016-01-20 Thread Nikolas Stevenson-Molnar
We are a non-profit organization of scientists, technicians, and software engineers - providing scientific and technical expertise to support the conservation and recovery of biological diversity. We rely heavily on Python and Django and are looking to hire an additional permanent, full-time

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
On Monday, January 4, 2016 at 3:39:22 PM UTC-8, Michal Petrucha wrote: > > Hi Nikolas, > > Thanks for your suggestion, unfortunately, I don't see how it helps in > my case. > > What I'm after is some kind of integration test: when I try to load a > page form the relying instance, verify that

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
HTTPretty may help with this. It will let you mock a response from the second server: https://github.com/gabrielfalcao/httpretty _Nik On Monday, January 4, 2016 at 2:50:05 PM UTC-8, Michal Petrucha wrote: > > Hi folks, > > I'd like to write some tests for a simple redirect-based SSO solution,

Re: Testing the interaction of multiple sites

2016-01-04 Thread Nikolas Stevenson-Molnar
HTTPretty may help with this. It will let you mock a response from the second server: https://github.com/gabrielfalcao/httpretty _Nik On 1/4/2016 2:49:34 PM, Michal Petrucha wrote: Hi folks, I'd like to write some tests for a simple redirect-based SSO solution,

Resolving circular dependencies when squashing migrations

2015-12-02 Thread Nikolas Stevenson-Molnar
I'm attempting to squash migrations on my Django 1.8 project and am running into a mess of circular dependencies. The docs suggest in this case to "break out one of the ForeignKeys in the circular dependency loop into a separate migration, and move the dependency on the other app with it." [1] 

Re: Turn off migrations completely in Django 1.7

2015-11-20 Thread Nikolas Stevenson-Molnar
Just unsubscribe from the list, and then subscribe again with the desired email. On 11/20/2015 5:15:07 PM, d...@gearscape.net wrote: On 2015-11-20 16:37, Frank Malina wrote: > RE: Carl Meyer >>> To my knowledge, out of the many hundreds of >>> thousands of Django users, you

Re: starting afresh

2015-09-22 Thread Nikolas Stevenson-Molnar
It's telling you that your default "date" value will be the same for every instance of "Journal" you create (essentially it'll be the time when the migration is created), when you probably intend it to be the time each Journal entry is created. Try changing default=timezone.now() to

Re: Django deployment

2015-09-15 Thread Nikolas Stevenson-Molnar
I second the nginx/gunicorn/django/supervisor stack. I've used it many times; it's relatively easy to get everything installed and set up, and all the involved components are ready for prime time. I think the "difficult to set up" sentiment is probably in comparison to something like PHP. So

Re: Security News?

2015-08-19 Thread Nikolas Stevenson-Molnar
Cool, thanks for the tips! I like Ars Technica, too. _Nik On 8/18/2015 3:55 PM, François Schiettecatte wrote: +1 on this. And I also follow http://arstechnica.com, they are usually pretty quick. François On Aug 18, 2015, at 5:30 PM, Shawn Milochik wrote: I've been

Security News?

2015-08-18 Thread Nikolas Stevenson-Molnar
A question for server admins: how do you stay on top of important security news (e.g., 0-day exploits like Heartbleed, Shellshock, GHOST, etc.)? Do you use feeds, listserves, blogs, Google alerts, Twitter, or some combination thereof? Just curious to see how others handle this. Personally, I

Re: Opening Django File

2015-07-14 Thread Nikolas Stevenson-Molnar
Yes, PyCharm is great. Also have a look at Sublime Text: https://www.sublimetext.com/ And for free, check out GitHub's Atom: https://atom.io/ _Nik On 7/14/2015 11:58 AM, Sadaf Noor wrote: There is a thing called IDE: https://en.wikipedia.org/wiki/Integrated_development_environment PyCharm

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Nikolas Stevenson-Molnar
If I understand correctly what you want, then I think sessions will help you here: https://docs.djangoproject.com/en/1.7/topics/http/sessions/ def view_1(self, request): request.session['display_key_list_updated'] = True def view_2(self, request): if

Re: Python Soap

2015-04-02 Thread Nikolas Stevenson-Molnar
-02 19:05 GMT+00:00 Nikolas Stevenson-Molnar <nik.mol...@consbio.org <mailto:nik.mol...@consbio.org>>: Did you switch to using suds-jurko? _Nik On 4/2/2015 10:10 AM, nadaei...@gmail.com <mailto:nadaei...@gmail.com> wrote: Thanks finally using this but

Re: Python Soap

2015-04-02 Thread Nikolas Stevenson-Molnar
se WebFault(fault, replyroot) suds.WebFault 2015-04-02 16:24 GMT+00:00 Nikolas Stevenson-Molnar <nik.mol...@consbio.org <mailto:nik.mol...@consbio.org>>: Have a look at this: https://bitbucket.org/jurko/suds/issue/23/ssl-certificate-verification _Nik On 4/

Re: Python Soap

2015-04-02 Thread Nikolas Stevenson-Molnar
:00 Nikolas Stevenson-Molnar <nik.mol...@consbio.org <mailto:nik.mol...@consbio.org>>: suds-jurko also seems to be actively maintained, so you may have luck with filing an issue for missing functionality. _Nik On 4/2/2015 9:05 AM, James Schneider wrote: Su

Re: Python Soap

2015-04-02 Thread Nikolas Stevenson-Molnar
anks Nikolas, Checking will come back to you. 2015-04-02 15:45 GMT+00:00 Nikolas Stevenson-Molnar <nik.mol...@consbio.org <mailto:nik.mol...@consbio.org>>: Take a look at suds-jurko: https://bitbucket.org/jurko/suds _

Re: Python Soap

2015-04-02 Thread Nikolas Stevenson-Molnar
Take a look at suds-jurko: https://bitbucket.org/jurko/suds _Nik On 4/2/2015 8:05 AM, nadaei...@gmail.com wrote: Hi All, What is the best library of python to consume wsdl soap with client certificate pfx and server certificate cer. BR -- You received this message because you are

Re: Python / Django slow ? Deciding my next technological stack

2015-03-02 Thread Nikolas Stevenson-Molnar
On 3/1/2015 7:13 AM, Benj wrote: Just a little questions guys: when a user upload a file to server, and that file is a litte big and takes 3 seconds to be uploaded... what's the proper way, if possible, not to block the entire system for these 3 seconds so the server can serve other users

Re: Python / Django slow ? Deciding my next technological stack

2015-02-25 Thread Nikolas Stevenson-Molnar
On 2/25/2015 6:27 AM, Tom Evans wrote: On Tue, Feb 24, 2015 at 11:30 PM, Benj wrote: Hi, i'm going to invest lots of time and energy in various web projects (mostly community web sites), and want to pick up a language / framework and invest heavily on it. I've spent a lot

Re: amazon s3 and django - Allow only the users from my website and not the anonymous users

2015-02-06 Thread Nikolas Stevenson-Molnar
It sounds like you want to use signed URLs. Since you're using storages, this should be the default if you use the "url" property. E.g., signed_url = status_obj.image.url Then keep the file itself private. No one will be able to access it without a signed URL, and you can control who gets a

Re: Turn off migrations completely in Django 1.7

2014-09-18 Thread Nikolas Stevenson-Molnar
You could always set your models to managed=False https://docs.djangoproject.com/en/dev/ref/models/options/#managed _Nik On 9/18/2014 2:04 PM, Anthony Tuininga wrote: Hi, I just upgraded my test environment to Django 1.7 and immediately noticed that mgirations appear to be a requirement.

Re: [ANNOUNCE] Django 1.7 released

2014-09-02 Thread Nikolas Stevenson-Molnar
+1 I've been trying out 1.7 for a new project and the migrations are awesome! _Nik On 9/2/2014 3:15 PM, Carlos Aguilar wrote: > congratulations!!! > > And thank you for a really good job! > > Best Regards > > > On Tue, Sep 2, 2014 at 4:13 PM, James Bennett

Re: hosting django app

2014-08-22 Thread Nikolas Stevenson-Molnar
WebFaction: https://www.webfaction.com Decent price and they handle some of the setup/deploy hassle for you. _Nik On 8/22/2014 1:25 AM, ngangsia akumbo wrote: > my boss uses php to build web apps > > he is n9ot very convince that django can be very cheap in hosting as php. > > is there any way

Re: mixing python , php and django

2014-08-14 Thread Nikolas Stevenson-Molnar
Well, there's always: http://animuchan.net/django_php/ _Nik On 8/14/2014 1:24 AM, ngangsia akumbo wrote: > I am working with a php guy in my office . > He is asking me how can we mix php and django? > Cos he want that when we have a project to do he should be able to > paticipate using php in

Re: How to log out a user

2014-08-12 Thread Nikolas Stevenson-Molnar
Unfortunately, you can't look up sessions by user, so you've have to load every active session and see if its for the user you wish to logout. Alternatively, you could create your own mapping of users to sessions, or add some middleware that verifies the user is active on every request, and signs

Re: Django Post Issue

2014-06-20 Thread Nikolas Stevenson-Molnar
The "name" attribute should be on the select tag. E.g: Foo _Nik On 6/20/2014 10:33 AM, G Z wrote: > I'm trying to post > customer_id > while generating a combo box with a loop from a database query. > I have the combo box generating and such, but the posted data does not > return the

Re: Use custom HTML to render forms

2014-04-11 Thread Nikolas Stevenson-Molnar
s like and > > On Tuesday, 1 April 2014 02:53:00 UTC+1, Nikolas Stevenson-Molnar wrote: > > It depends on what you want to do. If you want to override/replace > the form in base.html, then place the block tag around the form, > like so (in base.html):

Re: Use custom HTML to render forms

2014-03-31 Thread Nikolas Stevenson-Molnar
It depends on what you want to do. If you want to override/replace the form in base.html, then place the block tag around the form, like so (in base.html): {% block content %} ... {% endblock %} Any template extending from base.html which defines a "content" block will override

Re: Middleware being called twice for every request, help?

2014-03-19 Thread Nikolas Stevenson-Molnar
Ah yes. I missed/ignored the UUIDs entirely! _Nik On 3/19/2014 11:08 AM, Tom Evans wrote: > On Wed, Mar 19, 2014 at 5:50 PM, Nikolas Stevenson-Molnar > <nik.mol...@consbio.org> wrote: >> Are you making the request from a browser? If so, your browser is probably >>

Re: Middleware being called twice for every request, help?

2014-03-19 Thread Nikolas Stevenson-Molnar
Are you making the request from a browser? If so, your browser is probably making an extra request for the favicon. So if your middleware handles /all/ requests (even ones that ultimately result in 404) then it'll be executed twice. It will look like it's twice for one request, but it's actually

Re: Terrible performance when dropping into raw SQL Oracle

2014-02-26 Thread Nikolas Stevenson-Molnar
Is the case number the same when you run the query in SqlPlus as when you run it in Django? In other words, are you certain the query is /exactly/ the same? _Nik On 2/25/2014 2:09 PM, Shawn H wrote: > I've an app that has to drop into raw sql to run a query in a > different Oracle database. The

Re: I'm getting obsessed! Where should I put this code?

2014-02-09 Thread Nikolas Stevenson-Molnar
I'm not sure it makes sense to put something that raises a "BadRequest" type error in the model. That's more of an API exception. I'd say put it in the resource. If you find yourself repeating it a lot then put the validation in it's own function and/or use subclasses if appropriate. _Nik On

Re: Which Real Time Communications Protocol

2014-01-08 Thread Nikolas Stevenson-Molnar
las Stevenson-Molnar > <nik.mol...@consbio.org> wrote: >> The reason for this (someone please correct me if I'm wrong on this) is that >> Django isn't meant to hold connections indefinitely. Ideally you want to get >> a request and turn around a response as quick as possible.

Re: Why 'break' in BaseHandler.get_response() self._view_middleware loop?

2014-01-03 Thread Nikolas Stevenson-Molnar
That follows the stated behavior for "process_view" middleware: https://docs.djangoproject.com/en/1.6/topics/http/middleware/#process_view process_view is called before the request is passed on to the view function/class. The view is expected to return a response, so the only reason that the

Re: Which Real Time Communications Protocol

2013-12-30 Thread Nikolas Stevenson-Molnar
I would suggest using another framework or tool for this specific purpose. For example, I use the nginx-push-stream-module (https://github.com/wandenberg/nginx-push-stream-module) and have been happy with it. It's very lightweight, easy to use, and supports WebSockets and Long Polling. When I have

Re: Django Outbox Released

2013-10-31 Thread Nikolas Stevenson-Molnar
That's a great idea! I've had the same problem myself. I usually just use the console email backend but that's less useful with HTML emails. I will definitely check this out. Thanks, _Nik On 10/30/2013 8:36 PM, Paulo Gabriel Poiati wrote: > Hi guys, > > If you want a better way to debug and

Re: Looking for a way to detect changes in database records with low storage footprint

2013-10-09 Thread Nikolas Stevenson-Molnar
A hash should work fine. Alternatively, you could diff the two records, using something like difflib: http://docs.python.org/2/library/difflib.html _Nik On 10/9/2013 8:05 AM, DJ-Tom wrote: > Hi, > > a customer has requested a function to "compare" reports. > > So let's say I create a database

Re: Couple of random Error 500 issues

2013-09-20 Thread Nikolas Stevenson-Molnar
Two other options, depending on how much control you have over the server: 1) Use nginx instead of Apache (smaller memory footprint, leaving more for Python) 2) Use swap memory (http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/) ... not an option for shared hosting and certain types of

Re: Any API for dojo/jquery in django template language ?? For dojo i need urgently , thanks

2013-09-17 Thread Nikolas Stevenson-Molnar
I'm not sure I understand your question. You can use jQuery and/or Dojo in your Django template the same as you would anywhere else. If you want nice integration between Django forms and Dojo dijits, you might be interested in Dojango: https://github.com/klipstein/dojango/ _Nik On 9/16/2013 11:06

Re: Using an external Server to serve Static files - Development Server

2013-08-22 Thread Nikolas Stevenson-Molnar
estream/css/style.css > > On Wednesday, August 21, 2013 6:18:37 PM UTC-7, Nikolas > Stevenson-Molnar wrote: > > That should work... how are you referencing your static files from > your > templates? > > _Nik > > On 8/21/2013 6:09 PM, Ideo Rex wrote: &g

Re: Using an external Server to serve Static files - Development Server

2013-08-21 Thread Nikolas Stevenson-Molnar
That should work... how are you referencing your static files from your templates? _Nik On 8/21/2013 6:09 PM, Ideo Rex wrote: > Hello, > I have a different request that I couldn't find anywhere else on the > internet. I'm an intern who has built a Django Web Application for my > project

Re: Django installation on vanilla Mac OSX 10.8.2 mountain lion

2013-08-02 Thread Nikolas Stevenson-Molnar
Right: wget isn't necessary when you have a GUI. However, chances are you'll need gcc for something eventually (e.g., any package that isn't pure Python), so it's probably worth installing XCode /w command line tools package (incl. gcc) anyway. I agree it's a hassle to install everything else when

Re:

2013-07-22 Thread Nikolas Stevenson-Molnar
Ok. So if I understand correctly, your request should be to /myview/ /not /to /report/myview/ _Nik On 7/22/2013 12:32 PM, Harjot Mann wrote: > On Mon, Jul 22, 2013 at 10:22 PM, Nikolas Stevenson-Molnar > <nik.mol...@consbio.org> wrote: >> Is that your only URLs file, or is

Re:

2013-07-22 Thread Nikolas Stevenson-Molnar
Is that your only URLs file, or is there another one which includes that one? _Nik On 7/22/2013 12:43 AM, Harjot Mann wrote: > On Mon, Jul 22, 2013 at 3:16 AM, Nikolas Stevenson-Molnar > <nik.mol...@consbio.org> wrote: >> Please also provide your urls.py file(s). That's freq

Re:

2013-07-21 Thread Nikolas Stevenson-Molnar
Please also provide your urls.py file(s). That's frequently the culprit for 404 errors. _Nik On 7/18/2013 11:11 AM, Harjot Mann wrote: > http://tny.cz/ab1b86eb > Here are my views for creating pdfs but I am getting this error: > > HTTPError at /report/myview/ > > HTTP Error 404: Not Found > > >

Re: Django 1.5 runserver hangs in Chrome

2013-07-10 Thread Nikolas Stevenson-Molnar
(file_chunk_iterator(open(fullpath, 'rb')), content_type=mimetype) The iterator function looks like this: def file_chunk_iterator(f, size=1024): while True: chunk = f.read(size) if chunk: yield chunk else: return On 7/3/2013 5:39 PM, Nikolas Stevenson

Re: Django 1.5 runserver hangs in Chrome

2013-07-10 Thread Nikolas Stevenson-Molnar
Hi Sven, Thanks for the suggestion. Unfortunately, this didn't resolve the issue for me. Chrom is still hanging on that page. It loads most of the resources, then hangs indefinitely while requesting several images. If I close the tab, I get a stack trace in the Django log (connection aborted)

Re: Django 1.5 runserver hangs in Chrome

2013-07-03 Thread Nikolas Stevenson-Molnar
Also, while Chrome is spinning, I can open Firefox and load pages (including the problem page) just fine. So it's not that the server is overloaded or anything like that... _Nik On 7/3/2013 5:39 PM, Nikolas Stevenson-Molnar wrote: > I've just updated to Django 1.5 and am running into a prob

Django 1.5 runserver hangs in Chrome

2013-07-03 Thread Nikolas Stevenson-Molnar
I've just updated to Django 1.5 and am running into a problem when using Chrome with the Django devlopment server (and staticfiles). One particular page which loads a lot of static content /consistently/ hangs in Chrome (works fine in Firefox). This seems similar to two resolved issues:

Re: Inserting String from Visual Basic Express 2010 to Django SQLite3 Database

2013-07-03 Thread Nikolas Stevenson-Molnar
This might be helpful: http://zetcode.com/db/sqlitevb/ _Nik On 7/3/2013 12:08 PM, hiQ wrote: > I've been able to configure my Visual Basic Express 2010 to read > strings from certain measurement equipment. I also found a very cool > youtube video (http://youtu.be/Z3j-7309ITc ) which shows how

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
> return HttpResponse("hello, world") > > which returns > > *** > > > *** > [02/Jul/2013 15:51:07] "POST /blog/ HTTP/1.1" 200 12 > > > On Tuesday, July 2, 2013 3:34:47 PM UTC-6, Nikolas Steven

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
t; to parse all of this arbitrary data, and filter out the stuff that > fits into a form > > On Tuesday, July 2, 2013 3:08:10 PM UTC-6, Nikolas Stevenson-Molnar > wrote: > > That's the expected output, since your URL pattern to that view > doesn't contain any ar

Re: Class Based View returning blank post data

2013-07-02 Thread Nikolas Stevenson-Molnar
That's the expected output, since your URL pattern to that view doesn't contain any arguments. Take a look at the examples in https://docs.djangoproject.com/en/1.5/topics/http/urls/ ... the URL patterns with groups will have the matched values passed to the view function as arguments (named groups

Re: Django confusing issues DRIVING ME MAD. Please someone help?

2013-06-14 Thread Nikolas Stevenson-Molnar
Ok, so something is happening to the name "reverse" in the global scope between the time you're importing it at the top of the file and when get_absolute_url is called. Search the file for instances of "reverse". Are you importing anything else by that name? Or anything like "import foo as

Re: Django confusing issues DRIVING ME MAD. Please someone help?

2013-06-14 Thread Nikolas Stevenson-Molnar
It's hard to say without having the full source. If the data are different on dev and production, it's possible there's a different execution path, causing a problem on one but not the other. But you can tell it's not an import problem, as that would raise an import error. And it's not a problem

Re: Django confusing issues DRIVING ME MAD. Please someone help?

2013-06-14 Thread Nikolas Stevenson-Molnar
Guessing from the stack trace you provided, either "reverse" or "str" are None (since those are the only two function calls on that line). Is there anywhere you are doing something like reverse = blah or str = blah? Also, you could add a couple of debug statements prior to that call to confirm

Re: Suggestions on caching queries for a single request on a subset of Views?

2013-06-10 Thread Nikolas Stevenson-Molnar
I created a simple decorator for this purpose: http://djangosnippets.org/snippets/2874/ Wrap your expensive model methods with @auto_memoize and the results will be cached in memory for the duration of the request. _Nik On 6/10/2013 9:58 AM, Kurtis wrote: > I have two views which perform a ton

Re: How send data to UpdateView from javascript. (Django 1.5)

2013-06-07 Thread Nikolas Stevenson-Molnar
I assume that MatterUpdateView is a subclass of the generic UpdateView class. If so, that class expects an object pk (id) or slug to be included as part of the URL pattern, and yours doesn't include either. Your URL pattern should look something more like: r"^manage/(?P\d+)/update/" _Nik On

Re: Cant get to admin login page

2013-06-06 Thread Nikolas Stevenson-Molnar
And also did you uncomment the appropriate lines to enable the admin app? https://docs.djangoproject.com/en/1.5/intro/tutorial01/#activating-models _Nik On 6/6/2013 2:53 PM, Rebecca wrote: > I'm on part 2 of the django book tutorial > (https://docs.djangoproject.com/en/dev/intro/tutorial02/) and

Re: Cant get to admin login page

2013-06-06 Thread Nikolas Stevenson-Molnar
Did you configure your database in settings.py as described in part 1? _Nik On 6/6/2013 2:53 PM, Rebecca wrote: > I'm on part 2 of the django book tutorial > (https://docs.djangoproject.com/en/dev/intro/tutorial02/) and am > trying to get onto the admin login page in my browser. When I go to >

Re: django's database system

2013-06-05 Thread Nikolas Stevenson-Molnar
Have you had a look at SQLAlchemy? http://www.sqlalchemy.org/ _Nik On 6/5/2013 3:29 AM, heni yemun wrote: > Hi, > I'm starting to develop some python program to address some database > needs- this is for desktop usage not on the web. So i was wondering if > django's database system can be

Re: creating a realtime push notification service as in facebook and stackoverflow using redis

2013-06-04 Thread Nikolas Stevenson-Molnar
The nginx-push-stream-module is very easy to use: https://github.com/wandenberg/nginx-push-stream-module Just build nginx with the module, do a bit of configuration, then you're ready to push messages from your server, and subscribe to them via WebSockets or Long Polling from your client. _Nik

Re: linux or windows

2013-05-31 Thread Nikolas Stevenson-Molnar
Same here. In a perfect world I'd develop on Mac and deploy to Linux, as compiling anything on Windows is a pain and the command prompt is a sorry excuse for a shell (yes, I could use cygwin, and do at times...). Can't use pip to install anything with a compile step. Once you have everything

Re: django , python and ides

2013-05-31 Thread Nikolas Stevenson-Molnar
+1 for PyCharm. I know many here like Sublime Text also (though it's a super text editor, not an IDE). Neither are open source, but both work hard to earn the $$ you spend on them. _Nik On 5/31/2013 7:19 AM, Masklinn wrote: > On 2013-05-31, at 12:54 , tony gair wrote: >> Python and Django are

Re: Creating a "Django Course" and would like some feedback

2013-05-28 Thread Nikolas Stevenson-Molnar
Deployment in general is something you should be sure to cover. Especially when people are coming from the PHP world, deployment is quite different. It seems like there are often questions on this list around deployment problems, and they are often fairly trivial issues. _Nik On 5/28/2013 2:01

Re: site critique

2013-05-22 Thread Nikolas Stevenson-Molnar
The link is actually to an admin page. _Nik On 5/22/2013 2:53 PM, Nigel Legg wrote: > Site is asking for a username and password, so I can't look at it. > > Regards, > Nigel Legg > 07722 652866 > http://twitter.com/nigellegg > http://uk.linkedin.com/in/nigellegg > > > > On 22 May 2013 14:24,

Re: Variables inside the static tag

2013-05-20 Thread Nikolas Stevenson-Molnar
How about getting the path to the flags, then tacking on the filename outside the tag... {% static "assets/flags/" %}{{ request.LANGUAGE_CODE }}.gif _Nik On 5/20/2013 12:13 PM, Oscar Carballal wrote: > Hi, > > I'm migrating to the new static tag in my project, and I ran into a > problem, in

Re: Accessing foreign key objects reversely ??

2013-05-08 Thread Nikolas Stevenson-Molnar
Since you're using a foreign key, the relationship is one-to-many. I.e., one Profile to many Complaints. This means there is no "set" of profiles for a complaint. There /is/, however, a single Profile object related to each Complaint. In your case, it's "user". E.g: complaint.user _Nik On

Re: Accessing django development server from internet!

2013-05-07 Thread Nikolas Stevenson-Molnar
3 12:25 PM, Kakar Arunachal Service wrote: > Thank you for your reply! But coud you pls explain in detail how to > make it available over the internet. And i dont have a router, m > running it on my laptop. Pls advise. > > > On Tue, May 7, 2013 at 11:10 PM, Nikolas Stevenson-Moln

Re: Accessing django development server from internet!

2013-05-07 Thread Nikolas Stevenson-Molnar
Keep in mind that the Django development server is designed neither for security nor performance, so under no circumstances should you use it as a production server. With that said, assuming you're using this for//development purposes, change your manage.py runserver command to bind to the address

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
extending > them each, because you have to render one child template. > > Perhaps the best practice is to mix multiple views into one page, but > I have no experience with django so I don't know. > > Bahadir > > On Thursday, April 25, 2013 12:22:52 PM UTC-7, Ni

Re: How can I divide a page into multiple parts using multiple html files and django templates?

2013-04-25 Thread Nikolas Stevenson-Molnar
The include would probably help you here: https://docs.djangoproject.com/en/1.5/ref/templates/builtins/#include _Nik On 4/25/2013 11:56 AM, bilgehan.bal...@gmail.com wrote: > Hi, > > I want to divide a page into parts, such as sidenav.html, topnav.html > and so on such that the base.html is not

Re: debugging with pycharm

2013-04-22 Thread Nikolas Stevenson-Molnar
I assume you're running it in the debugger? Make sure you regular server isn't still running. Also, make sure your break point is on a line a line which does something (e.g., /not/ on a class/function definition, empty line, etc.) _Nik On 4/21/2013 10:14 PM, Mark Lybrand wrote: > I can't get

Re: "ImportError: No module named django"

2013-04-15 Thread Nikolas Stevenson-Molnar
Are you in the same directory as Django-1.5.1.tar.gz? _Nik On 4/15/2013 1:47 PM, Nathan Hall wrote: > I've never used pip or virtualenv. > > When I did this: tar xzvf Django-1.5.1.tar.gz > > I got this: > tar: Error opening archive: Failed to open 'Django-1.5.1.tar.gz' > > > > On Mon, Apr 15,

Re: "ImportError: No module named django"

2013-04-15 Thread Nikolas Stevenson-Molnar
This is likely the cause of the problem. You should always install packages with setup.py (as mentioned by the previous poster). I've found Mac OS X to have lots of "false" site-packages folders. setup.py will make sure it gets to the correct one. Also some packages may have extra installation

Re: Newbie using reverse() function

2013-04-11 Thread Nikolas Stevenson-Molnar
Hi Nick, The request object is always sent to a view, so from the perspective of "reverse", index has no args. Try removing the args= part of the reverse call and see if it works. _Nik On 4/11/2013 4:31 PM, Nick D wrote: > I'm trying to use the reverse() function to get back to my index, but >

Re: WSGIPythonPath and

2013-04-11 Thread Nikolas Stevenson-Molnar
Another direction might be to run a separate WSGI HTTP server (like gunicorn) and proxy to it from Apache. Saves the hassle of messing around with mod_wsgi. _Nik On 4/11/2013 3:20 PM, Joey Espinosa wrote: > > I had basically the same issue as you. > > With only one Django app deployed, it's easy

Re: Circular import problem

2013-04-11 Thread Nikolas Stevenson-Molnar
Circular import itself isn't a problem--Python will deal with that. Problems arise according to the order in which classes, etc. are loaded from each module and where the required classes are used. As the previous poster mentioned, you can get around this by moving one of the import statements

Re: Accessing list of dictionaries in jQuery

2013-04-08 Thread Nikolas Stevenson-Molnar
Larry Martell wrote: > I appreciate the suggestion, but using a hidden field sounds very > kludgy. Is there no other way? > > On Mon, Apr 8, 2013 at 6:01 PM, Nikolas Stevenson-Molnar > <nik.mol...@consbio.org> wrote: >> Injecting data into a template can be tricky. I woul

Re: Accessing list of dictionaries in jQuery

2013-04-08 Thread Nikolas Stevenson-Molnar
Injecting data into a template can be tricky. I would recommend doing two things: 1) Serialize your data to JSON in your view first using Python's json module. Something like this: >>> images_as_json = json.dumps(images) 2) Rather than trying to inject it directly into JavaScript, which can

Re: Implementing User login expiration

2013-04-05 Thread Nikolas Stevenson-Molnar
How about creating request middleware to sign out deactivated users? Something like: if request.user.profile.expired: logout(request) If you're concerned about the extra database hit per request, then maybe cache the expiration? expire_date = cache.get("%d_expire" % request.user.id) if not

Re: General Apache Deploy Strategy

2013-04-03 Thread Nikolas Stevenson-Molnar
Fabric is helpful for scripting deployment process: http://docs.fabfile.org/en/1.6/ _Nik On 4/2/2013 4:51 PM, Mike Dewhirst wrote: > On 3/04/2013 1:04am, Sells, Fred wrote: >> We use django for intranet applications. There is minimal coupling >> between applications and we generally dedicate a

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

2013-03-26 Thread Nikolas Stevenson-Molnar
Does anyone know what approach Rails takes to support for non-rel databases? _Nik On 3/26/2013 9:46 AM, Javier Guerra Giraldez wrote: > On Tue, Mar 26, 2013 at 11:10 AM, Donnie Darko wrote: >> I was wondering if there there was a plan to change Django's ORM to support >>

Re: [django-users] Limit uploaded image properties

2013-03-25 Thread Nikolas Stevenson-Molnar
I think you can get at a file's size with the 'size' attribute (in bytes). Conceivably you could stick it inside a "clean" method for your form and do it that way. class MyForm(forms.Form): ... def clean_image(self): image = self.cleaned_data['image'] if image.size >

Re: queryset minimization

2013-03-07 Thread Nikolas Stevenson-Molnar
bers of reg list, how to modify the code above? > > > Thanks again.. > > > -- > > > > > -- > > On Thursday, March 7, 2013 6:35:14 PM UTC+2, Nikolas Stevenson-Molnar > wrote: > > The biggest hit is probably going to be the reg.group call. You can

Re: queryset minimization

2013-03-07 Thread Nikolas Stevenson-Molnar
up')[0].group.name > this is 1 or 2 hit?? > > and an optional 10 points question: > 4) If I had two members of reg list, how to modify the code above? > > > Thanks again.. > > > -- > > > > > -- > > On Thursday, March 7, 2013 6:35:14 PM UTC

Re: queryset minimization

2013-03-07 Thread Nikolas Stevenson-Molnar
The biggest hit is probably going to be the reg.group call. You can optimize that by using select_related (), which will take what is currently 1 + (number of group registrations for the user) queries and turn it into 2 queries: reg = p.groupregistration_set.all().select_related('group') More on

Re: New to Django & Programming - Trying to work with the tutorial. How to edit mysite/settings.py

2013-03-04 Thread Nikolas Stevenson-Molnar
You need a text editor. Source code is plain text, so something like Notepad will work. But in practice, you'll want a source code editor. There are many out there, some free some paid. My personal favorites are Notepad++ (http://notepad-plus-plus.org/) on Windows and TextWrangler

Re: I need to play a wav file

2013-03-04 Thread Nikolas Stevenson-Molnar
Ah, hampster dance... that was all the rage in middle school :) _Nik On 3/4/2013 12:37 PM, Shawn Milochik wrote: > hampster dance, anyone? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: I need to play a wav file

2013-03-04 Thread Nikolas Stevenson-Molnar
Right. The Python code runs on your webserver, not the user's computer. So... you could probably play a sound your webserver, but that's not likely to do you much good ;) _Nik On 3/4/2013 12:37 PM, Shawn Milochik wrote: > On Mon, Mar 4, 2013 at 3:35 PM, frocco wrote: >> ok, I

  1   2   3   >