Re: 1.5: syntax of AUTH_USER_MODEL
On Monday, October 29, 2012 11:09:11 AM UTC-4, Tomas Neme wrote: > > > This is, IMO, the biggest and most stupid problem in django core > design, because it stops you from having an otherwise completely legal > configurations, like having a 'cms.plugins.picture' app alongside a > 'myproject.custom.picture' one which might do something completely > different. I.E.: you can't have apps with repeated app labels even if > there's no python path conflict between them. > > I don't know what the reason behind this is. I know it allows you to > make a model part of any given app regardless of where it's located > (via Meta.app_label), but this could very easily be extended (in a > backwards-incompatible way, I'm afraid) to require to be the fully > qualified name of the app package > > > This is actually a good feature for Django to have. By enforcing app labels, you enforce data integrity at the application level, not just the database level. I used to think this was horrible as well until I built a work-around for it and then had all kinds of database integrity issues. In addition, if an application by the same name is being used in multiple places, you should instead manage the different use with URL patterns and not try to rig it otherwise. If it's a completely different application than the others, the option I choose is to rename the app's folder and update my INSTALLED_APPS accordingly. If you didn't write the application and it's not truly decoupled, you may have to make other changes. --Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/rgOnguKNJUQJ. 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 more options, visit this group at http://groups.google.com/group/django-users?hl=en.
API keys
I already searched the group and found one subject that sounds related (Google-style API keys, I believe was the name of it), but I wanted to do something specific and was wondering if anyone can give pointers in the appropriate direction. I'm building a site, the backend API managed via Django, the front end by php. I know it sounds weird, but we're approaching it from the standpoint of providing the API access as a service, similar to how Google allows access to their Maps API. Here's the specifics: * Django backend should provide nothing but an error should a site try to access it without an API Key * The API key should tie in to 1 or more URLs, so that we can make sure the site accessing it is the same that owns the key * API keys or URLs should be permissions-capable. That is, some URLs should have complete access to the data, whereas others may only have access to specific models or managers The trouble I'm running into is deciding whether this would be best suited as middleware or an auth backend. I know how to approach it with middleware, but I have a feeling I may end up having to kludge some stuff together for the permissions side. If it's an auth backend, I just need to do a bit more research to develop that, and figure out how to have the backend use a specific model for the API access itself, and the standard User model for the admin panel. Any help/pointers/etc. would be appreciated, especially if this has already been done and public domain or under a license we can work with. I wouldn't want to re-invent the wheel. If you have any questions on specifics, you can reply here or offlist. -- Michael King -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problems downloading django
On Dec 18, 2:13 pm, Michael K <mk...@arikel.net> wrote: > Still having the same issue. I'm on a windows machine, but even if I > use wget on one of the Solaris machines, the TAR is reported as having > no files and/or is corrupted. > > Is there another download location I can try? > > -- > Michael James, Thanks for the response on this, it made me think of something else to try - a different web browser. It seems Chrome beta doesn't like something about the delivery of the tar.gz. When I used IE, the file opened first try. I also realized the problem with the wget is the same as my SVN issue - except in this case, the Solaris machines are blocked from using the proxy server in question. Once I changed the environment to point to the appropriate one, I also got the file from there. Sorry to waste the bandwidth, but hopefully someone will search for download issues - and if they're running Chrome, they'll know what's up. -- Michael PS: Chrome version is 4.0.266.0 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problems downloading django
On Dec 18, 2:10 pm, Michael K <mk...@arikel.net> wrote: > On Dec 16, 4:10 pm, James Bennett <ubernost...@gmail.com> wrote:> On Wed, Dec > 16, 2009 at 2:13 PM, Michael K <mk...@arikel.net> wrote: > > > Should I take the silence to mean I should open a bug report? > > > I clicked the "download" link for Django 1.1.1, and the package > > downloaded. On finishing the download, I was able to checksum it and > > get the same results as the signed checksum document provided at the > > time of the > > release:http://media.djangoproject.com/pgp/Django-1.1.1.checksum.txt > > > Thus, the problem is most likely not with anything on > > djangoproject.com; instead, it's probably something related to your > > own Internet connection. > It's been a couple of days, I'll try it again. > > Thanks for the response! Still having the same issue. I'm on a windows machine, but even if I use wget on one of the Solaris machines, the TAR is reported as having no files and/or is corrupted. Is there another download location I can try? -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problems downloading django
On Dec 16, 4:10 pm, James Bennett <ubernost...@gmail.com> wrote: > On Wed, Dec 16, 2009 at 2:13 PM, Michael K <mk...@arikel.net> wrote: > > Should I take the silence to mean I should open a bug report? > > I clicked the "download" link for Django 1.1.1, and the package > downloaded. On finishing the download, I was able to checksum it and > get the same results as the signed checksum document provided at the > time of the > release:http://media.djangoproject.com/pgp/Django-1.1.1.checksum.txt > > Thus, the problem is most likely not with anything on > djangoproject.com; instead, it's probably something related to your > own Internet connection. > My first assumption was that it was my network connection, but I've had no issues downloading from any other site - just djangoproject.com. It's been a couple of days, I'll try it again. Thanks for the response! -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problems downloading django
On Dec 15, 2:01 pm, Michael K <mk...@arikel.net> wrote: > On Dec 15, 12:30 pm, Michael K <mk...@arikel.net> wrote: > > > I tried to download the TAR file(s) for releases, but I get a ~5Mb > > corrupted tar.gz from the website. Should I take the silence to mean I should open a bug report? -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: No module named urls (again)
On Dec 15, 3:18 pm, Pablo Solerawrote: > When I try to run the same server from eclipse, it seems that > something is not correct. > I got the error: ImportError at / "No module named urls" > I do have the urls.py on my application, and averything works fine out > of eclipse. > > Could it be a PATH problem? How could I debug it? Did you add your project path to the PYTHONPATH environment variable in your Run profile? That's what the problem sounds like - Eclipse's environment doesn't know to tell Python that your Django project needs to be in the PYTHONPATH. -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: problems downloading django
On Dec 15, 12:30 pm, Michael K <mk...@arikel.net> wrote: > I tried to download the TAR file(s) for releases, but I get a ~5Mb > corrupted tar.gz from the website. With this in mind, I tried the > SVN, and here's what that resulted in: > > svn: PROPFIND request failed on '/svn/django/trunk' > svn: PROPFIND of '/svn/django/trunk': Could not resolve hostname > `code.djangoproject.com': The requested name is valid and was found in > the database, but it does not have the correct associated data being > resolved for. (http://code.djangoproject.com) > > Here's the thing - I can browse it, so I think the "resolve hostname" > may be a misnomer. It says it can find it, but something's "missing". Discovered the SVN problem is proxy-server related (they don't allow the commands necessary for it to work). However, that still leaves me unable to download the release packages. Does anyone know of a mirror site that might let me download the packages? -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
problems downloading django
I don't know when this started, as I've not needed to download django in a while, but I've come across a strange issue. Pardon if this is going to the wrong place. I tried to download the TAR file(s) for releases, but I get a ~5Mb corrupted tar.gz from the website. With this in mind, I tried the SVN, and here's what that resulted in: svn: PROPFIND request failed on '/svn/django/trunk' svn: PROPFIND of '/svn/django/trunk': Could not resolve hostname `code.djangoproject.com': The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. (http://code.djangoproject.com) Here's the thing - I can browse it, so I think the "resolve hostname" may be a misnomer. It says it can find it, but something's "missing". Help? -- Michael -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: use Django's database layer for a regular python program?
It's currently being done for a server application, I don't see why it couldn't be used for a desktop application as well? Check out http://www.silverstripesoftware.com/blog/archives/51 and http://code.google.com/p/evennia/ The first is a desktop application that uses Django, I'm just not sure if it's using the database backend or not. The second is a MUD server that uses Django for data storage as well as the web services for MUD management. It should be as simple as creating a new project and ignoring the urls/ views part of the code, and just importing the models as normal. HTH, Michael On Jun 27, 7:09 am, ahlongxp <[EMAIL PROTECTED]> wrote: > I'm currently developing a desktop application, not a web application. > But I want to use django's models to store and retrieve data in > Database. Is it possible? How should I do it? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: admin css/images disappeared
On Jun 19, 5:55 am, "Evan Carmi" <[EMAIL PROTECTED]> wrote: > Hi, > > My admin css and images have disappeared. I am running django with > lighttpd. My settings contains: > - > # URL prefix for admin media -- CSS, JavaScript and images. Make sure to >use a > 39 # trailing slash. > 40 # Examples: "http://foo.com/media/;, "/media/". > 41 ADMIN_MEDIA_PREFIX = '/media/' > 42 > - > > My urls is: > - > from django.conf.urls.defaults import * > > urlpatterns = patterns('', > # Example: > (r'^polls/', include('binarymanipulations.polls.urls')), > # Uncomment this for admin: > (r'^admin/', include('django.contrib.admin.urls')), > (r'^date/', include('binarymanipulations.date.urls')), > (r'^blog/', include('binarymanipulations.blog.urls')), > (r'^contact/', include('binarymanipulations.contact.urls')), > (r'^comments/', > include('django.contrib.comments.urls.comments')), > ) > > - > > For an example the login screen: > > http://binarymanipulations.com/admin/ > > Any help would be greatly appreciated, > > Evan Evan, In your lighttpd configs, make an Alias for /media/ to your admin media itself. This should be found somewhere in django/contrib/ (in wherever you installed django). For info on Lighttpd aliases: http://www.cyberciti.biz/tips/configure-lighttpd-alias-mod_alias.html HTH, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Can a field get auto populated based on another field within the Admin?
On May 25, 2:28 pm, Greg <[EMAIL PROTECTED]> wrote: > I have three tables (Manufacturer, Collection, Style). I have 10 > manufacturers. Each manufacturer contains approx. 20 collection. > Each collection contains approx. 20 Styles. I was wondering if it's > possible when I'm adding styles I can select the manufacturer then my > collection (foreign key) field when drilled-down on shows only the > collections from the manufacturer I selected in the field above. I'm > thinking that this might require some javascript. > > Below are some of my tables > [snip] > > Thanks for any help Greg, You're right that this will require some javascript, but you shouldn't have to write much on your own. There's a couple of examples at: http://www.b-list.org/weblog/2006/07/31/django-tips-simple- ajax-example-part-1">The B-List: Django tips: A simple AJAX example, part 1 http://www.b-list.org/weblog/2006/08/05/django-tips-simple- ajax-example-part-2">The B-List: Django tips: A simple AJAX example, part 2 The basics of how it would work, is use the Javascript to make a call to a view that outputs it however you'd like - XML, JSON or even straight "option" fields - then have it replace the innerHTML attribute on the DOM object in question. Again, depending on the ajax toolkit you choose, you shouldn't have much javascript to write, and the python side of the code should be fairly self-explanatory. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Is it possible to redirect with POST data?
On May 3, 4:24 pm, "Bob T." <[EMAIL PROTECTED]> wrote: > Hi All, > > I have a situation where I would like a view to do a redirect to a URL > that is expecting POST (rather than GET) data. GET would be easy, but > how can I do a POST redirect? The URL I would be redirecting to is not > under my control, so I can't just change it to use GET data. > > Thanks, > Bob Bob, It entirely depends on what you're trying to do, but as you've described it, the only way I know of is using JavaScript on the view page that submits the POST data. If the target site was under your control, there'd probably be other ways of doing it. If I were an expert in JavaScript, I'd give you an example, but I believe HttpRequest is the place to start. HTH, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: operationalError 2002, mysql on osx 10.9
On May 2, 3:25 pm, Michael K <[EMAIL PROTECTED]> wrote: > > Try setting DATABASE_HOST to 'localhost' instead of blank. What OS > are you running this on? This will teach me to read the subject closely. I should have went with my gut feeling that it was Mac OS X :) Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: operationalError 2002, mysql on osx 10.9
On May 2, 10:09 am, Mark Phillips <[EMAIL PROTECTED]> wrote: > Being a newbie has its challenges... I know exactly what you mean. > The server is running mysql, I use phpMyAdmin and a couple of other > applications successfully with it. > There is an existing database of the same name as the new django > project. > I didn't find anything interesting in the logs, but then the django > logs are empty at the moment. > I did not find a file at "/tmp/mysql.sock" The error involving not being able to open the /tmp/mysql.sock usually has to do with host resolution OR the server being down (we've ruled that one out). Simply put, your mysql isn't listening on a UNIX socket, but an actually IP address (be it a normal one, or 127.0.0.1), but the application is trying to open the UNIX socket, instead of the IP socket. Try setting DATABASE_HOST to 'localhost' instead of blank. What OS are you running this on? HTH, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How to do this in Django?
On May 1, 12:38 pm, Pythoni <[EMAIL PROTECTED]> wrote: > Michael, > Thank you for your reply. > I agree the solution with DIVs instead of IFRAMEs would be nice. > But it needs AJAX. and you say a little AJAX. > Can you give me an idea how to use that little AJAX together with my > described problem? > Thank you > L. I'll give it a good stab. I'm not much of a JavaScript programmer, but I understand the concepts surrounding AJAX. Basically, your author links would call a javascript function that uses XMLHttpRequest to retrieve the data for the descriptions. It can either return XML for your javascript to parse, or it can just return the exact HTML you need for filling in the DIV. An example for this might be a simplified view template that just has the loop through the data to display the markup and actual data, then replace the innerHTML of the descriptions DIV with the data that's returned. Instant re- population. I believe Django has most of what you need to simplify the generation of the data already built-in. It's just a matter of figuring out how to glue the pieces together. I'd suggest looking at James' example (http://www.b-list.org/weblog/ 2006/07/31/django-tips-simple-ajax-example-part-1) for a start, and just keep in mind the concepts. The code part almost come naturally if you know anything about JavaScript. Hopefully, someone will read this and will be able to give you a better, with code, example than I have. :) HTH, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Using Django outside of Django
On Apr 30, 7:21 pm, Mike H <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm sure this has been discussed elsewhere, but common terms like > "using" "django" "models" and "scripts" make it hard to find! ;) > > I've written a nice multi-user mp3 jukebox for our office, it lets users > add tracks to their playlist and then interleaves the playlists so that > everyone gets a fair turn at getting their tracks played. It also > streams the mp3s to the machine in the office with the nice speakers > attached :) > > I'm currently running the streamer and playlist rotator by doing similar > to this : > > [EMAIL PROTECTED]:~/dukebox$ python manage.py shell < streamer.py > > I'm wondering if there is a less hackish way of interfacing with Django > outside of the context of a web request? > Mike, Joe's post is on the money. You shouldn't need to use the shell at all, but can directly import django's pieces directly in another script (such as your streamer.py). Check out http://code.evennia.com for some examples in that regard. It's a mud codebase that uses Django for its database backend and authentication. HTH, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: import problem
On Apr 29, 6:37 pm, kamil <[EMAIL PROTECTED]> wrote: > Hi Michael. You are right there was module named utils (coincidentally > same name as django module) in the nesh thumbnail app. > Problem resolved :) > Thank You Very Much for the time You dedicate me. > I feel in debt with U and I feel really happy to feel such a feedback > in django community. > Kamil, Glad I could help. The community's helped me quite a bit, I figured I should help were I could. Maybe someday, someone will have a question you can help with, eh? Thanks, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How to do this in Django?
On May 1, 5:47 am, Pythoni <[EMAIL PROTECTED]> wrote: > Julio and James, > Thank you both for your help. > I know that frames could be useful to help solve my problem but... > > Let's suppose this: > > height="30"style="height:10.8em" marginwidth="0" marginheight="0"> > > > height="60"style="height:4em"marginwidth="0" marginheight="0"> > > > where you can see two frames( iframes).One Authors ( list of > authors)and the other Descriptions( their replies). > As you can see each frame must consists source page DAuthors.html and > DDescriptions.html, that should be generated on fly( dynamically) > according to user's demand( depending on what he will want to see). What I would suggest, if you're using IFrames, is that you use different views for those "pages", and never call them from the site directly, except as iframes in another template. For example, you might have the following template files: DAuthors.html DDescriptions.html Display.html Display.html would have the template code needed for the view to work, including the iframe tags, which would look something like: along with any attribute tags. The "context" would be something like a record ID for the forum or whatever you're using this for. My only concern is that you seem to be wanting to have it change the Descriptions when you select an author? The best way (in my opinion) to do this, is use a little AJAX and use DIVs instead of IFRAMEs. Something like... {{ code to loop through authors }} http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: import problem
On Apr 24, 4:19 pm, kamil <[EMAIL PROTECTED]> wrote: > Thanx Michael for your attention. > I'm using todays build from svn trunk. > I started project from the beginning to eliminate possibility that its > something wrong with my code. > > when I run "python manage.py runserver" everything seams OK. > when I hit any page I got error I mentioned > Yes I'm runnung it as the same user as shell. I tried to run it as > root and it comes the same. > It starts to desesperate me. After tomorrow I got meeting with my > client to show him my project :¿ > and I'm stacked with this. > Help would be greatly appreciated > > Kamil, I did some deeper digging, and I don't seem to have a django.core.utils.text at all in the trunk. I'd check your urlconf's and make sure they're sane namespace-wise. That is, if you're trying to import a utils.text module in your urls.py, that's the likely culprit. The URLconf code can't resolve the module name for some reason. Do you have an app named "utils" in your project? If so, then there might be something else wrong (missing __init__.py, permissions, etc). If not, that's probably where your problem lies. You just might have put in the urlconf information incorrectly. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: import problem
On Apr 24, 5:41 am, kamil <[EMAIL PROTECTED]> wrote: > Hi. I'm using developement built-in django server. > Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) [GCC 4.1.2 > (Ubuntu 4.1.2-0ubuntu4)] on linux2 > on fresh Kubuntu Feisty (7.04) > Kamil, I'm assuming you're just running "python manage.py runserver" for your command line? Are you using Django 0.96, or the svn trunk? Sorry to add questions, I was hoping it would be a simple problem of too many Python binaries on a system. :) Are you getting an exception on the server output? And lastly, are you running the server as the same user you're running the python shell? Thanks, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Redirect middleware
On Apr 23, 10:13 am, plungerman <[EMAIL PROTECTED]> wrote: > greetings, > > i am attempting to do a simple redirect using django's redirect > middleware. everything works fine if you want to redirect from one > distinct URI to another, for example, > > /big/ --->http://www.example.com/labowski/ > > however, if you want to redirect to a child page in terms of the URI > structure, it does not seem to work for me. for example: > > /about/ --->http://www.example.com/about/broscoen/ > > what we have here, is an about page that is not finished, so we want > folks who request /about/ to go to a subpage but instead you see the / > about/ page. Steve, I've had a similar problem before, unrelated to redirect middleware, but related to urlconfs. What do your urlconfs look like for the about pages/sub-pages? Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: import problem
On Apr 22, 4:38 pm, kamil <[EMAIL PROTECTED]> wrote: > Hi. I installed Django on Python 2.5 > and I receive following error on the built in server: > > Exception Type: ImportError > Exception Value:No module named utils.text > Exception Location: /usr/lib/python2.5/site-packages/django/core/ > urlresolvers.py in _get_urlconf_module, line 178 > > however utils.text exist in Django directory and importing in shell > works fine. > Please help. Kamil, Can you paste the header you get when you start your Python interpreter? This almost sounds to me like you have more than one version of Python installed, or your library path settings are incorrect somewhere (probably in your web server configuration). Are you using mod_python to host the project? Lots of details missing before we can help much. Thanks, Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Poll tutorial question
On Mar 29, 9:03 am, Gilhad <[EMAIL PROTECTED]> wrote: > On Wednesday 28 March 2007 11:50, wheresdave wrote: > > > got it fixed. Whitespace was showing up before pass. found the setting > > in scite to show whitespace. > > Well, whitespaces in Python are pretty difficult to keep in line, if you are > used to other languages. > I personally use Tabs for intending and VIM editor and have it to make Tabs > visible like dark blue |--, Hey, do you mind sharing your .vimrc for that, probably best on dpaste.com ? -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Django on Windows for an intranet site
On Apr 19, 12:40 pm, jay graves <[EMAIL PROTECTED]> wrote: > I'm a Django newbie (1 week) but a long time (since early 2000) Python > programmer. > > I have an internal project for work and I'm proposing that we use > Django. > > Here are some general questions that I would like the community's > opinion on. > > 1. I have to use Windows 2003 server due to the fact that I have to > interface with an existing application through ODBC. I'm not tied to > IIS/MSSQL but would probably try to follow the recommendations > athttp://thinkhole.org/wp/django-on-windows/and utilize Apache/ > mod_python/PostgreSQL. This division of the company just upgraded > their infrastructure before I got involved and by default we are a > windows shop. The server I would use is the domain controller and > also runs Exchange. Any red flags here? The number of users is > really small. (<30) Having gotten my start as a sys admin, I'd raise a tentative red flag on this one. Since you're looking at a relatively small number of users, this may not be as much of an issue if the server has the iron to back this up. But... A PDC + Exchange is already a potential performance hog. Adding on another service (Apache or otherwise) could mean slow response times all around. The PDC might side of it might not suffer as much, but Exchange is a resource hog (and needs every bit it gets), and you may end up slowing down both Exchange and your Django application (whichever way you host it). Is the existing application on Windows using ODBC? If so, you're not necessarily stuck with Windows Server, as there are ODBC solutions for Linux/BSD, meaning you could put the Apache server on a separate piece of iron. All that being said, if the server hardware is fairly modern, and the user base stays level, it should handle it just fine. My only concern is you'd effectively have three different database platforms on one server, two of them backends for potentially resource-intensive services that I don't foresee the company getting rid of. :) The thinkhole.org HOWTO should get you up and running on the services side, either way. > 2. Should I stick with 0.96 or would 'trunk' be OK. I would really > like to use the newforms-admin stuff once it has merged but since I'm > new I'd like some advice. > I've readhttp://www.djangoproject.com/weblog/2007/apr/06/changes/and > since I'm writing brand new code I don't have any backwards compatible > issues to contend with and of course I would be careful when > 'updating' my Django working copy. There are some backwards incompatible issues coming down the pipe from the newforms-admin branch, and some of them aren't documented yet. If you use 0.96, you'll find yourself refactoring a bit when the next release comes out, but it's a safe bet. On the other hand, using trunk means that you have the latest and greatest, and will be able to adjust your code more incrementally, rather than all-at-once, I believe. Lastly, if you used the newforms-admin branch, you should end up with less refactoring in the end, once it's merged into trunk. I've not looked at it intensely, yet, so I could be off base a little on how much refactoring you'll have to do. > The site would need to go 'live' around Aug 1. Any gut feel on how > much 'churn' there will be in the API during now until then. From > everything I've read, Django has tried really hard to minimize API > incompatibilities and personally I'm not that worried about it but > would like some feedback. >From what I've seen over the past couple of years, there isn't a whole lot of "ZOMG, my project is DOOMED!" churn in the API. Most of your update fixes should come in the way of editing a single file when a new backwards-incompatible change comes around, though that's not always the case. The new admin stuff would require model definition changes as well as some minor edits to your url definitions, and some probably others, as some of the differences are not documented yet, as I said before. > This is a very high profile project internally and I'm excited about > using Django/Python. If this initial project goes well, there will be > alot more candidate projects for Django at my company. Getting > justification for the first one is the hardest but once it's an > 'existing' technology it's an easier sell for new projects. My concerns with performance could mean a lot here. The API churn not so much, if you keep up with things and make sure you have a good Test/ QA system in place. If the performance is horrible because of the server you're stuck with, they could blame Django, ruining any chance of it coming up again in the future. I proposed Rails for an application once that was supposed to have dedicated iron - at the last minute, they decided to host is shared. It hurt the performance of the application, and despite my pointing out that the server was already over-loaded before the application went on it, they blamed it entirely on Rails.
Re: build problem with databrowse
On Apr 18, 1:57 pm, [EMAIL PROTECTED] wrote: > Hi all, > > I checked out a fresh copy of django-svn with databrowse contrib app included. > > I run 'python setup.py sdist' or 'python setup.py bdist_rpm' and the > templates-folder of databrowse is missing. > > Can somebody verify this ? > > Regards, > Dirk Dirk, It seems to exist for me, I was able to do a setup.py sdist without a problem on 5030. According to svn, the folder's been there since 5011. Do you have a traceback? -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django comparison
On Apr 19, 10:39 am, Tim Chase <[EMAIL PROTECTED]> wrote: > This was the contrib that Adrian unveiled at PyCon2007 that had a > room full of applause. I beleve he referred to it as giving "the > treatment" or "the works" to your data. It allows easy > exploration of a data-set, as it will create views wherein your > data gets automatically linked and displayed saving tons of work. > I have a feeling this is going to become a killer-app for Django. > > I missed its entry into contrib/ but look forward to toying with it! > > -tkc Further reason to bemoan missing PyCon this year. The worst part is, I'm originally from the Dallas area, so it's not like I didn't have other excuses to go - just couldn't get the time off. I agree, this is the one thing that was kinda missing (though not missed) from Django. I have the perfect use for this. Now all we need is a more advanced (additional contrib, maybe?) permissions system. I've tried a few approaches experimentally, but nothing seems to look or feel right, just yet. I have a project that could be refactored and reduced in size if there were an "ownership" concept in the auth module. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Doctest isn't running (0.96)
On Apr 19, 10:17 am, Michael K <[EMAIL PROTECTED]> wrote: > On Apr 19, 9:03 am, "Ryan Alexander" <[EMAIL PROTECTED]> wrote: > > There's an easier (django) way to do this: > > def __str__(self): > return self.day.get_day_display() > > This will return the second value of the tuple, "Sunday" if it were > "6". > that should be: return self.get_day_display() Dunno how that extra "day" got in there. Must be the daylight savings change. :) -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django comparison
On Apr 19, 9:31 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 4/19/07, Nicola Larosa <[EMAIL PROTECTED]> wrote: > > > > > Michael K wrote: > > > The best part is, if you put together the models first, the clients can > > > start adding and manipulating content before you're done with all of the > > > functionality - just give them access to the admin panel, if you want. > > > The next step is doing away with a predefined model altogether. Semantic > > web CMS, anyone? ;-) > > Have you looked at trunk/django/contrib/databrowse yet? :) Wow, I don't update since 49xx, lo and behold, there's a new module in contrib! Just briefly looking over it, it looks like it wraps models for some black magic data browsing? And what's this? A plugin hook? :) -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Doctest isn't running (0.96)
On Apr 19, 10:02 am, "Ryan Alexander" <[EMAIL PROTECTED]> wrote: > Solved my own problem, admitting to my own stupidity for the sake of > posterity and search engines. > > The problem was that one of the lines in the test had an extra space > in it before the prompt, (I was using tabs btw, I don't know how it > got there.) > > Anyway, that extra space made the whole thing be not recognized. I'm a dork. > IT WAS THIS LINE!! Gaaah. > > > >>> wed Hah! I would have never known or caught that, but it's good to know / now/ that doctest is that sensitive (understandably so), for my own future reference. :) -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Doctest isn't running (0.96)
On Apr 19, 9:03 am, "Ryan Alexander" <[EMAIL PROTECTED]> wrote: > Here's the code at the top of my models.py file: [snip] > def __str__(self): > if self.day is None: > return 'undefined' > else: > return WEEKDAY_CHOICES[int(self.day)][1] There's an easier (django) way to do this: def __str__(self): return self.day.get_day_display() This will return the second value of the tuple, "Sunday" if it were "6". The DB api documents get_FOO_display() here: http://www.djangoproject.com/documentation/db_api/#get-foo-display > class Meta: > ordering = ("day",) > > yet when I do the: > > python manage.py test > > command, it says Ran 0 tests in 0.000s > > Is there something I didn't set up properly? I followed the > instructions on the django site?! I'm not entirely sure, as I've only used unittest at this point, but I think you have to call the doctest.test_mod() in your models.py, or in tests.py at some point. Have you tried directly testing the models individually? Like: python manage.py test dayofweeks HTH, -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Spanish tutorial
On Apr 19, 9:07 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > +1 > > " > A veces da la impresión de que hay un concurso del tipo ¡Con XXX monto > una aplicación del tipo YYY en ZZZ minutos ! ó ¡Mi framework lava más > blanco! > > No vamos a entrar en el juego. > " > > Thank you. :) A fair shake is better than no shake at all, I say. :) -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: selecting a framework ,
On Apr 19, 9:17 am, gops <[EMAIL PROTECTED]> wrote: > Hi , > > I want to develop a ERP for very small business ( two - three use + > customer : normally not more than 10 people using the erp ) , I know a > little bit of php , but i am interested in django as my platform , > > my question is , is there any such system available which i can look > at to get some idea , from where to start... ??? > > Thanks . I don't know if any applications already exist for Django, but there should at least be some pieces ready-to-go out there. Django would be well-suited for such a project, I'd think, simply because of how tightly you can integrate the models. The admin backend should pretty much do most of what you need for data collection for the ERP, leaving the views being the bulk of your work in all likelihood. Check out http://www.djangobook.com for some good examples and a head start on Django. Having come from a PHP background myself, I can say you'll find Python quite a bit more strict on how you format your code, but you should be able to pick up on how to do things fairly quickly. You said you know a little bit of PHP, how much is a little bit? To get started in Django, you'll need to learn a little bit of Python - to really harness the power of it, you'll want to learn a lot. Most of it, luckily, you will learn as you go. If you don't know any Python at all, definitely check out the tutorials on python.org. They will help. Since you said this is for a small business, this shouldn't be an overwhelming project to do in Django. Honestly, I'd be terrified of building an ERP from scratch in PHP for an enterprise of any size. Not so much using Django - most of the horrid SQL and web logic is already done for you. As a starting point, again, I'd take a look at the examples on the book and main websites, and probably www.djangosnippets.org for some more code examples. Start small and simple, make releases often, and try to avoid feature bloat. If you work incrementally, you should end up with a sturdy ERP in no time. Lastly, I'm certain folks here would be more than happy to take a look at bits of code and help with errors. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django comparison
On Apr 19, 9:23 am, Nicola Larosa <[EMAIL PROTECTED]> wrote: > Michael K wrote: > > The best part is, if you put together the models first, the clients can > > start adding and manipulating content before you're done with all of the > > functionality - just give them access to the admin panel, if you want. > > The next step is doing away with a predefined model altogether. Semantic > web CMS, anyone? ;-) > > -- > Nicola Larosa - [EMAIL PROTECTED] Oh just the thought of it makes my head hurt. >.< Although if something like that gets worked on, I wouldn't mind helping where I can. :) (Assuming the work hasn't already been done!) What can I say? I'm a masochist at heart. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Spanish tutorial
On Apr 19, 5:36 am, David Asorey Álvarez <[EMAIL PROTECTED]> wrote: > I've written a tutorial in Spanish, maybe it could interest to some of > you. > This document lives at:http://davidasorey.net/static/django-tutorial/ > > Best, > > -- > Davidhttp://davidasorey.net > > P.S.: Excuse my poor syntax. I can deal with English in "read-only" > mode. Your English is better than my Spanish (and probably my own English) - from what I can comprehend, the tutorial looks very thorough and well done! -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: django comparison
On Apr 18, 9:40 pm, M Harris <[EMAIL PROTECTED]> wrote: > On Wednesday 18 April 2007 14:22, [EMAIL PROTECTED] wrote:> For what it's > worth, I found Django to be LESS work than Mambo/Joomla, > > just because I wasted an ungodly amount of time trying to make Mambo > > do what I wanted. > > Did you get on-board with the Django book, or something else? > > -- > Kind regards, > > M Harris <>< The book is a very good place to start. The development team has managed to take all of the different sorts of documentation and examples spread over the main site and crunch it down into digestible pieces. I wish the book had been around when I first started playing with Django. :) I can say I used Mambo before the split, and have toyed with Joomla afterwards and Django has proven far more intuitive to use for building custom applications. Like the house analogy, if you only need it for a simple CMS, Joomla may be your best bet. If you want to add features and have complete control, however, Django would be better. Not to mention, the zen of Django is specifically content management at a very abstract level - you define what content is, and it manages the rest. You just fill in the blanks as to how it looks and functions. The best part is, if you put together the models first, the clients can start adding and manipulating content before you're done with all of the functionality - just give them access to the admin panel, if you want. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Discussion on django-job-at-wefi
Pablos, Are you still looking to fill out the team? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
stackless and django
I have a strange question. If I'm using a stackless version of python, could I, in theory, use channels and tasklets within a django application/project? I can't think of any problems, and I've not experienced any issues with using the stackless binary to run manage.py, but I'm kind of wondering (aloud, I suppose) if one could, say, kick off a bunch of database updates (or generate a report) with a tasklet, returning back to the django app immediately with a message of "Processing in the backend..." or somesuch, without the whole process breaking. The way I understand stackless, it would probably start blocking at the end of the execution of the request, waiting for the tasklet to finish, but I'm guessing there might be a way around that. Either way, I'm going to play around with it this weekend, just wanted to get the thoughts of others. -- Michael --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: myghtyboard forum problem
On Mar 8, 6:41 pm, "zehi" <[EMAIL PROTECTED]> wrote: > All Right. It seems to be a problem somewhere else: > > Both, localy and on server I run python 2.5. It looks like, that > diamanda installation procedure is calling older python version > 2.4 ??? Is it possible? > > sample: > > [EMAIL PROTECTED] raw]$ python manage.py syncdb > [EMAIL PROTECTED] raw]$ cd .. > [EMAIL PROTECTED] django_current_python_25]$ export > DJANGO_SETTINGS_MODULE=raw.settings > [EMAIL PROTECTED] django_current_python_25]$ export PYTHONPATH=$PWD > [EMAIL PROTECTED] django_current_python_25]$ django-admin.py syncdb > Traceback (most recent call last): > File "/home2/zehi/bin/django-admin.py", line 5, in ? > management.execute_from_command_line() > File "/home2/zehi/lib/python2.4/django/core/management.py", line > 1238, in execute_from_command_line > translation.activate('en-us') [snip] This alone tells me that your djang-admin.py is using python2.4, unless you have your ~/lib all messed up. :) Check the django-admin.py source's shebang (first line) and see if it's calling 2.4 specifically? Other than that, it still sounds like a database problem for the first part. I'd still consider looking at your table's defaults. This latest error looks like Python can't find your modules, which, again, appears to be because of the version you think you're running not being the version you're actually running. :) > It's over my head yet. Somebody has experience with that? > Everything is typically over my head when it comes to Django, but I'm getting there. :) Best bet: focus more on Python than the "Django Way" and it will make more sense as you learn. -- Michael http://tsal.arikel.net --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---