Re: getting unique id

2022-11-23 Thread Thomas Lockhart
Why not use the existing Django AutoField? - Tom > On Nov 23, 2022, at 8:56 AM, Larry Martell wrote: > > I have an app that needs to get a unique ID. Many threads run at the > same time that need one. I would like the IDs to be sequential. When I > need a unique ID I do this: > > with

Re: Anyone help?

2022-10-15 Thread Thomas Lockhart
You don’t run model files directly, but rather through manage.py which references your settings.py file. ./manage.py hth - Tom > On Oct 15, 2022, at 1:07 PM, It's ShAdAn wrote: > > Got error > > > /usr/bin/python3.9 > /home/user/PycharmProjects/pythonProject4/mycham/abcd/models.py >

Re: Adding csv as models

2022-09-23 Thread Thomas Lockhart
This is a very broad question so perhaps you are the stage of choosing the tools. The workflow, handling historical data, managing updates and replacement data, etc are things to consider for a production system so you’ll need to deal with those design questions. For my most recent system I

Re: JSON files. How is it done?

2022-09-22 Thread Thomas Lockhart
This will create a JSON file of the specified name for data from a time range specified in the URL. Re-reading your post, it seems that perhaps you don’t actually want a physical file but rather some JSON data to populate your browser window.Then Django Rest Framework will do what you want

Re: Averaging timestamp deltas with Django ORM

2022-09-07 Thread Thomas Lockhart
Something like qs.aggregate(delay=Avg(F(“approved_at”) - F(“created_at”)))[“delay”] where I cribbed the technique from https://stackoverflow.com/questions/50219652/django-queryset-get-avg-of-2-fields hth -

Re: Two list on one page

2022-08-24 Thread Thomas Lockhart
Lay out your template to include both lists, then define get_context_data() in your view to have two lists of objects to show in your template. Get farther along and it will be easier for us to answer specific questions. hth - Tom > On Aug 24, 2022, at 12:34 PM, Matheus Bon wrote: > > What

Re: Setting up Celery with Python

2022-08-06 Thread Thomas Lockhart
Django and celery need a message server to communicate. You’ve configured one but it does not seem to be running. - Tom > On Aug 5, 2022, at 8:56 PM, Madhusudhan Reddy wrote: > > Hi Team, > > What's wrong...? > 09-19-34.png> 2022-08-06 09-18-44.png> > > -- > You received this message

Re: Search option in website

2022-07-23 Thread Thomas Lockhart
You can implement a robust search using something like elastic search or whatever seems to be the best choice currently (haven’t done one in a few years). Hth - Tom > On Jul 23, 2022, at 9:39 AM, Mahendra wrote: > > Hi to all, > How to implement Search option in website.please any one guide

Re: Added new column to model and run migrations but not applied to database table

2022-07-03 Thread Thomas Lockhart
Sorry that you are having continued problems. Your first report was almost a year ago and did not end up getting resolved but all the history on your thread is missing here so we can’t help with this information. “Migrations were not added” might indicate that your development server is out of

Re: Django 1.5 app had subclasses without tables without proxy and now 1.6 won't sync with proxy

2022-04-05 Thread Thomas Lockhart
(Used 1.5 but don’t remember a thing :) ) Yes, what Steven says. If you try moving through each version then you will end up understanding a *lot* more about the application, but it sounds painful. Your specific question seems to indicate that you would want your subclasses to actually share

Re: Search & replace an object in the database

2022-01-21 Thread Thomas Lockhart
Yes this exactly. A couple of possible additions: I’ve had great luck using python and SQL queries to manipulate a database including converting from other schemas and merging duplicate records. Make a test database from your backup, and beat it up with your scripted code until you are happy

Running tests fails in the test runner call_command

2021-12-21 Thread Thomas Lockhart
I’ve got a 3.2.10 installation and haven’t run my unit tests in a long time. When I try now, I get a failure which seems to trace back to the test runner itself: TypeError: Unknown option(s) for check command: databases. Valid options are: all, debug, force_color, help, names, no_color,

Re: Declarative mechanism for Django model rows

2021-12-08 Thread Thomas Lockhart
I may be completely misunderstanding your use case, but just in case… You can have different views in your application, and if you don’t want to expose the data as separate pages then you might consider django-rest-framework to provide data in various ways, including across models. You’ll end

Re: __init__() got an unexpected keyword argument 'on delete' when make migrations

2021-12-05 Thread Thomas Lockhart
Please use polite language. Thank you. - Tom > On Dec 5, 2021, at 5:21 PM, Anurag Agarwal wrote: > > Why are you fucking passing the args > On_delete in manytomany . Class > >promotion = models.ManyToManyField(Promotions, on_delete=models.CASCADE) > > > On Sun, Dec 5, 2021, 21:09 Samuel

Re: TypeError: 'str' object is not callable

2021-08-30 Thread Thomas Lockhart
Just guessing that you need to write messages.success = “Your ad is successfully posted” But without more information from you that is only a guess. How is messages.success defined? - Tom > On Aug 30, 2021, at 8:57 PM, Salima Begum > wrote: > > Hi all, > In my project for each

Re: how does Django handle outbound requests?

2021-06-27 Thread Thomas Lockhart
It is quite often recommended to keep it simple and then optimize if you need to. The optimization woiuld be to decouple the external request using a queue, then provide a response to the client separately. Just as you suggest. You can also design your API to allow this optimization, without

Re: How does django-admin work?

2021-05-31 Thread Thomas Lockhart
Welcome to Django! Django does not add django-admin to your path. Rather, when Django is installed it (sometimes) happens to be installed into a place which is already in your path. Otherwise, you need to add it to your path or use a packaging system such as anaconda which helps do that for

Re: How to fix this error

2021-05-24 Thread Thomas Lockhart
A “not null constraint failed” is in the error message. So you have a field which is not being set and the database itself is complaining. It looks like you have extended the user profile to include a foreign key to “babyinfo” and that is empty apparently. Either change the model to allow a

Re: Creating dynamic chart / graphs with Django

2021-05-15 Thread Thomas Lockhart
Django integration is fairly easy with Bokeh. For very large datasets you will want to also use Datashader and Holoviews so that high-density data gets rendered with meaningful interpolations. hth - Tom > On Apr 12, 2021, at 7:16 AM, Lars Liedtke wrote: > > Hey, > > this is quite good

Re: Server balance

2021-05-15 Thread Thomas Lockhart
You will find a lot of useful information just by searching for “scaling Django”. Then you can ask specific questions here. hth - Tom > On May 14, 2021, at 9:29 PM, Shashank Vijendra > wrote: > > If suddenly Users are increased for our site our site capacity is lets take > 1000 > so what

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Why use Q? afaict simple filter syntax should get you what you want. Booking.objects.filter(organization_id=request.user.organization_id, booking_time__range= (start_date, end_date)) Not sure if this will get you closer to the query you expect. You might also find it useful to use "./manage.py

Re: View / Query Set not showing with filter

2021-03-19 Thread Thomas Lockhart
Almost certainly start_date and end_date are not what you expect. Do the types match? In any case print them out and see what you are actually getting. hth - Tom > On Mar 19, 2021, at 6:00 AM, Manuel Buri wrote: > > Hi, > > I am having this query set in my view: >

Re: Python libraries for visualisations

2021-03-15 Thread Thomas Lockhart
If you are working with larger scientific datasets then bokeh may be of interest. For my cases all of the code is done in python. hth - Tom > On Mar 14, 2021, at 9:49 PM, GEETHANJALI S P > wrote: > > Hi..How to build a dashboard using django and python libraries for creating >

Re: Library for calculating distance between ZIP codes

2021-02-16 Thread Thomas Lockhart
Pre-calculating is pretty expensive: 81939*81938/2 = 3,356,958,891 entries make a pretty big table. Calculating on the fly is probably not horribly expensive and you could calculate and save, thereby caching values which have been used before. Anyway, geodjango might be what you need. Plus the

Re: Problem with Postgresql-11.9 ??

2020-10-12 Thread Thomas Lockhart
No one has answered yet, so here is some useless info… I’ve been using various combinations of Postgres and Django (currently 12.4 and 3.1.2, respectively) and would think I would have stumbled on this at some point when using postgresql-11. But I probably haven’t tried 11.x with 3.1.2

Re: HELP With Scraping and Storing Data to DB from a Search Engine!!

2020-09-13 Thread Thomas Lockhart
Use Python and Beautiful Soup for scraping in an external program. Then send the results to your Django app using the Django Rest Framework JSON API. If you need your scraping program to get candidate sites from your app, then use the DRF API to get those. hth - Tom > On Sep 13, 2020, at

Re: Django 3.1 release candidate 1 released

2020-08-04 Thread Thomas Lockhart
Mariusz announced the final release a few hours before you posted this. To this same email list ;) - Tom > On Aug 3, 2020, at 10:14 PM, 'Nikhilanj Venkata Pelluri (Software > Development)' via Django users wrote: > > Hi, > Has the final version for v3.1 been released ? > > On Monday,

Re: Python 3.8 Installed, yet Django 1.11 is Automatically Being Installed on Mac

2020-06-08 Thread Thomas Lockhart
virtualenv or (probably even better) conda (Anaconda) will be easier environments to manage. I know that MacPorts will also have the packages you’ll need. hth - Tom > On Jun 8, 2020, at 7:37 PM, arhoon io wrote: > > Hello, > > I have installed and successfully confirmed that Python 3.8

Re: gdal installed still

2020-05-12 Thread Thomas Lockhart
It looks like you are running on Windows which I’m not familiar with. But most likely your gdal installation is in a different Python installation than your django installation. - Tom > On May 12, 2020, at 3:53 AM, mick wrote: > > django.core.exceptions.ImproperlyConfigured: Could not find

Re: Creating test databases in parallel

2020-04-01 Thread Thomas Lockhart
If you are trying to optimize the test flow, then you may want to spend some time shrinking your test databases to a more manageable size. Or have two sets; abbreviated and full, with the larger one to exercise your (unknown) edge cases. hth - Tom > On Apr 1, 2020, at 2:25 AM, cool-RR wrote:

Re: Postgre sql problem

2019-09-06 Thread Thomas Lockhart
You need the python-devel package installed for the version of python you are running. - Tom > On Sep 6, 2019, at 12:49 PM, Elmaco7 wrote: > > Hello, I'm trying to use Postresql with my django project, but when i try to > install psycopg2(with this command 'pip3 install psycopg2') this

Re: form.is_valid() is always return false please help

2019-08-22 Thread Thomas Lockhart
Post your form code please. - Tom > On Aug 22, 2019, at 12:56 PM, Shubham Chauhan > wrote: > > form.is_valid() is always return false please help > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and

Re: Print data from Database in Django

2019-05-05 Thread Thomas Lockhart
Your context variable for all students is “stud”. Try changing that to “Student” as you refer to it in your template. - Tom > On May 5, 2019, at 7:09 AM, anchal agarwal wrote: > > I want to display the name of all the students from the Student model using > cards , i have set it all up but

Re: MySQL CRUD

2019-02-25 Thread Thomas Lockhart
A good way to get started is to follow the Django tutorial on the polling app. The mailing list will be happy to answer specific questions you might have. Good luck! - Tom > On Feb 25, 2019, at 10:12 AM, Darshan Gohel > wrote: > > How to Create tables using Django ? > And how to insert

Re: Django timezone problem

2019-02-06 Thread Thomas Lockhart
If you want this to happen without the user registering and giving you an address, you could use a geolocation and ip address database. I think yahoo and google both provide these services (I used yahoo because their terms of service were less restrictive). If the user allows the browser to

Re: Deprecating model field (Deleting model field, but keeping DB column)

2017-07-05 Thread Thomas Lockhart
> On Jul 4, 2017, at 8:39 PM, tay...@cedar.com wrote: > > I am having some trouble figuring out the best way to remove model fields in > Django. If I remove a field from a model and then run makemigrations, it > creates a RemoveField operation in a migration. That is great, but if I > decide

Re: Where is all the time going?

2017-05-22 Thread Thomas Lockhart
On 5/22/17 10:12 PM, Bernd Wechner wrote: James, If you have the fortitude and kind heart to look at it, sure the code base (just checked in) is here: https://github.com/bernd-wechner/CoGs it's the Create view on the Session model that is taking 30s to render, no other model, and that

Re: Postgis - as an afterthought?

2015-10-25 Thread Thomas Lockhart
On 10/25/15 11:20 AM, Joakim Hove wrote: Hello, I have started developing a Django application. Currently it is not ready for it, but in the future I see that I would probably like to use the GeoDjango application/extension. Will I be able to add that a later stage, or do I need to design the

Re: migration error "geo_db_type" when using postgres as second database for geodjango

2015-09-14 Thread Thomas Lockhart
On 9/14/15 7:10 PM, Wenyao Xue wrote: Thanks, I guess I have to wait for 1.9 to release then 在 2015年9月15日星期二 UTC+8上午12:21:58,Tim Graham写道: This is a bug that will be fixed in Django 1.9. https://github.com/django/django/commit/0cc059cd104cdb70340bd08e597d403d80dc42a6

Re: can i use sqlite for big project?

2015-06-26 Thread Thomas Lockhart
On 6/25/15 7:08 AM, Arindam sarkar wrote: i need to develop a job portal . is there any problem if i use sqlite ? coz i am having problem to setup mysql or postgresql . please help. As others have suggested, use Postgres from the start. Spend a few minutes to understand the setup; it will be

Re: How to prevent label wrap in Django Administration

2015-04-19 Thread Thomas Lockhart
On 4/19/15 4:21 AM, Bernd Wechner wrote: I'm just playing around with Django and have cut a simple model and all is working fine. The Django administration tool works a charm, and I can move onto some views and forms. But what puzzles me immensely is why editing a tuple looks like this (with

Re: Can't save input to database

2014-12-30 Thread Thomas Lockhart
On 12/30/14 11:42 AM, Ronis wrote: Hi guys, I can't save the input from a custom form to database. I don't know what I am missing. I'm not sure either. But the html form you posted looks a *lot* like any template you might find in a django deployment. If it were me I'd look harder at just

Re: Newbie: Complete environment setup(virtualenv, pip, eclipse, git...)

2014-07-19 Thread Thomas Lockhart
On 7/19/14 6:41 PM, Martin Torre Castro wrote: Hello, my name is Martin and I'm a computer engineer from Spain. I'm going to start a new project with a colleague and I decided to use Django because we searched for free opensource tools and I'm in love with Python. We have made a couple of

Re: urls not maching

2014-07-13 Thread Thomas Lockhart
On 7/13/14 7:19 AM, ngangsia akumbo wrote: no am not using two slashes, i just want my block links to output the content details but i keep having the error above i need some help here You are getting some help here. The details you have provided so far seem to indicate that you are providing

Re: Django Database Switching Issue

2014-07-11 Thread Thomas Lockhart
On 7/11/14 11:30 AM, G Z wrote: Thomas, I have no cache setup, Django is all set to default right now there is no local_settings file I have actually changed every settings file that exist for django to match my production db yet still the wrong data. Well, you will have to give more details

Re: Django Database Switching Issue

2014-07-11 Thread Thomas Lockhart
On 7/11/14 9:27 AM, G Z wrote: So I tracked down an issue, whenever I change my database from development to production which have the same exact schema it still uses the data from development although my settings.py file is set to the production database and it even swtiches the user I have to

Re: How to create Union in Django queryset

2014-04-17 Thread Thomas Lockhart
On 4/16/14 11:51 PM, Shoaib Ijaz wrote: I don't want use SQL query in django OK. You *could* have class B inherit from class A: class B(A): link = models.IntegerField(blank=True, null=True) and then do your query on A: ulist = A.objects.all() hth - Tom On

Re: populating my postgres with openpyxl

2014-03-27 Thread Thomas Lockhart
I keep getting this error, saying that there is 0207.xlsx is not there, but it is in the directory. File "hsdata.py", line 34, in wb = load_workbook(filename = fname, use_iterators=True) File

Re: Bus Error on Development Server

2014-02-28 Thread Thomas Lockhart
On 2/28/14 6:16 PM, Gkpetrak wrote: Hello, I was trying to process Images with some python scripts, when I receive bus error. After that I had many bus errors on different programs. Finally I tried to start django' development server, and I received the same error. The "after that I had many

Re: Terrible performance when dropping into raw SQL Oracle

2014-02-26 Thread Thomas Lockhart
On 2/26/14 2:41 PM, Shawn H wrote: Because this worked so well, I've gone directly to cx_Oracle in my django view and used that to get the result in the 4 seconds. There is definitely a problem with the Django implementation - I wonder if perhaps the indexes on the tables aren't being used

Re: windows perl (3.3) stops printing output to console

2014-02-09 Thread Thomas Lockhart
On 2/9/14 1:13 AM, Mike wrote: I am working through the Django tutorial. Python was working. Python directory is still in my PATH. I made it through part 2 up until I tried to add the TEMPLATE_DIRS statement into mysite\settings.py. I don't know where the source of Django is so in the

Re: Decompression Failed

2014-01-29 Thread Thomas Lockhart
On 1/29/14 2:23 PM, James Kinsley wrote: I have just downloaded Python 2.7.6 on my Mac (running OSX 10.7.5 and I tried to download Django, but it keeps failing to decompress - any ideas ? Thanks. You may have already seen mention of virtualenv and pip wrt Django development. I think there is a

Re: NameError "SignUpAdmin"

2014-01-02 Thread Thomas Lockhart
On 1/2/14 7:02 PM, Eddie29 wrote: Hi Guys, I am really new to Django and Python. I have recently started learning them from a course on Udemy and I got stuck on the first example, making a web app. I'm not sure what I have done wrong but when I run my Django server it comes up with a

Re: Installing Django

2013-12-12 Thread Thomas Lockhart
On 12/12/13 1:55 PM, Frederick Miller wrote: For Windows XP, should Django be installed under the Python27 folder? Or should Django be on the root of the C: drive? I have no experience with Windows installations, but for other platforms virtualenv and pip are a real help for getting

Re: Does not generate the password hash my User

2013-12-05 Thread Thomas Lockhart
On 12/5/13 3:55 PM, Ricardo wrote: Hi Thomas. Even entering rende_value = False does not. The password keeps popping up as text. did not quite understand how that password1 is inserted before the check password2. I could not see this problem. You have found the limits of my knowledge. If it

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Thomas Lockhart
On 12/4/13 9:18 AM, Matt Schloepp wrote: I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been

Re: Python shell displays Segmentation Fault: 11 after upgrade to Mavericks OS

2013-10-24 Thread Thomas Lockhart
On 10/24/13 2:34 PM, Don Fox wrote: ... Segmentation fault: 11 This type of thing just started after upgrade. I assume there's a connection. I found a similar symptom with another application after doing piecemeal updates in MacPorts packages, and my problems went away with a more

Re: django sample (without admin site)

2013-10-18 Thread Thomas Lockhart
On 10/18/13 10:04 AM, Sanjaya Vitharana wrote: Hi, I am newbie to django looking for a simple sample. I'd suggest picking up a package built on top of Django. Maybe Mezzanine (I've enjoyed working with that). But there are several which will get you going quickly. hth

Re: having trouble with virtualenvwrapper - need to run 'source ~/.profile' every time.

2013-10-16 Thread Thomas Lockhart
On 10/16/13 8:29 AM, Jimmy Pants wrote: ...every time I open a terminal, that is. As I understand it, .profile is the file to edit in Linux Mint, and it does exist, with some basic code in it, in my home dir. So, per this tutorial

Re: Using unique_together with foreign key fields which may be None

2013-10-01 Thread Thomas Lockhart
On 10/1/13 6:36 AM, Derek wrote: We encountered the same problem for a complex model ... we ended up defining "acceptable" default values that are used instead of None/NULL, but essentially mean the same thing to the user. (We are using MySQL which adopts the same approach as Postgresql - I

Re: Workflow/tools assistance

2013-09-12 Thread Thomas Lockhart
On 9/12/13 6:44 AM, Sayth Renshaw wrote: On Thursday, September 12, 2013, Germán Larraín wrote: Some comments: * why use sqlalchemy if Django has its own ORM? * you mentioned parsing SQL entries; watch out! * if you are starting a new project, I seriously recommend you to

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
my question a little clearer, lol. I'm not sure how to ask what I want to know. But again, THANKS for the help Tom! On Mon, Sep 9, 2013 at 7:48 PM, Thomas Lockhart <tlockhart1...@gmail.com <mailto:tlockhart1...@gmail.com>> wrote: Tom, thanks so much for the reply. . .Yes,

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
Tom, thanks so much for the reply. . .Yes, that was a typo, it should've been "/articles" not "/article". I know this is going to be a stupid question, but why do my "urlconf" paths need to have "/articles" in it as you said? There are three steps in the interpretation of the

Re: URL Mapping Confusion

2013-09-09 Thread Thomas Lockhart
On 9/9/13 3:30 PM, Chris Kavanagh wrote: I haven't used this group in a long time, so I hope I do everything correctly. If I don't, I apologize in advance. I thought I understand the way django uses URL's in the urlconf to match URL's, but I was wrong. Here's my question: Here's my urlconf.

Re: Django installation on vanilla Mac OSX 10.8.2 mountain lion

2013-08-02 Thread Thomas Lockhart
On 8/2/13 7:41 AM, Sithembewena Lloyd Dube wrote: Hi everyone, I just began using a new Mac at work (running OSX 10.8.2 Mountain Lion) and it seems such a mission to install Django. Python 2.7.2. is already installed. Following the official Django installation instructions, I get no further

Re: Getting Started with Mac OS X

2013-07-14 Thread Thomas Lockhart
On 7/14/13 1:26 PM, Mando wrote: Hi, This is the way I have it set up my osx $ sudo pip install virtualenv $ virtualenv --distribute pytho_projects $ source python_projects/bin/activate $ (python projects) pip install django $ django-admin.py startproject myblog and that should get you past

Re: RSS combinator

2013-03-07 Thread Thomas Lockhart
On 3/7/13 7:24 PM, Lachlan Musicman wrote: Hola, > > Does anyone know of a django app that would take a number of rss > feeds and turn it into a single blog feed/stream? I'm using feedjack and I think it has features to amalgamate the feeds; I use it to subscribe to feeds then choose sets of

Re: Model method versus overriding save()

2012-12-08 Thread Thomas Lockhart
On 12/8/12 5:37 AM, Derek wrote: Rather than use a trigger (which is DB-specific and also hard to debug because not part of your code base), suggest you use signals[1]. Hmm. Triggers have advantages over application-level code where they can be used. They are likely more efficient (no data

Re: need help with postgres installation and set-up for doing tutorials

2012-11-21 Thread Thomas Lockhart
*On 11/21/12 5:58 AM, Luisa Beck wrote:** * *Thank you for your thoughts! I have a few follow-up questions: * * * *The reason that I’m trying to figure out postgres is that I’m helping some folks with a development project and they’re using postgres. I’m trying to do the tutorial with that so

Re: Incorrect Python Version Being Used

2012-11-06 Thread Thomas Lockhart
On 11/6/12 7:09 AM, Bestrafung wrote: I have been running into this problem for a long while trying to setup my first Django project and I keep coming back to this problem. I am relatively new when it come to Linux, I'm learning but still have a long way to go. I am using CentOS 5.8 cPanel

Re: My "Contributors" page Conundrum

2012-09-20 Thread Thomas Lockhart
On 9/20/12 5:28 PM, JJ Zolper wrote: Anyone have any ideas? Yes, Melvyn did. hth - Tom Thanks! JJ Zolper On Tuesday, August 28, 2012 2:24:03 AM UTC-4, Melvyn Sopacua wrote: On 28-8-2012 6:58, JJ Zolper wrote: > My problem is that I want each

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Thomas Lockhart
On 9/14/12 10:07 AM, Bob Aalsma wrote: Well, I have tried your suggestion in all places I could think of and none of those helped: the createsuperuser kept returning the same error message. I posted this as a reply some 24 hours ago. Yes, with no details of what "all the places I could think

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-14 Thread Thomas Lockhart
On 9/14/12 3:47 AM, Bob Aalsma wrote: SOLVED by Tom Evans: insert unset LC_CTYPE ; export LANG="nl_NL.UTF-8" into .bash_profile That is a solution, but depends on who is running and whether it is a login shell. I strongly recommend adding the lines I mentioned earlier to the top of your

Re: newbie: patch required? procedure? [closed ticket 16017 / createsuperuser]

2012-09-13 Thread Thomas Lockhart
On 9/13/12 10:37 AM, Bob Aalsma wrote: Hmm, I'd seen this solution in http://keeyai.com/2012/02/17/django-deployment-create-superuser-fails-with-locale-error/ but was reluctant to use this as " I have no idea if this causes any negative side effects." A running system is not usually

Re: not picking up new template

2012-09-12 Thread Thomas Lockhart
On 9/12/12 8:27 AM, Larry Martell wrote: On my Mac, I changed a template, and the change was picked up, no problem. I checked my change into git, went to another machine, a CentOS box, pulled the change down, but django is not picking it up. I've tried everything I can think of - bounced the

Re: Django and LDAP

2012-09-11 Thread Thomas Lockhart
On 9/11/12 2:49 PM, Ivan Pavlović wrote: Thank you Mike for your answer. I started this topic, because i have an assignment at my Faculty, which requires connection between Django and an LDAP (assistant insisted on 389ds). I installed Django, enabled admin, logged in through Firefox. I can't

Re: Django newbie with issues

2012-09-11 Thread Thomas Lockhart
On 9/11/12 6:29 AM, Morrti wrote: Hi, We did try things with v1.5, but that also failed. Looking further it seems that my branch on git was wrong. Moving to the correct one for 1.1 has seemed to have corrected things, well we got past that issue. I'm going to continue with the tutorial now

Re: newbie: which settings file? ["settings.DATABASES is improperly configured. "]

2012-09-10 Thread Thomas Lockhart
On 9/10/12 11:30 AM, Bob Aalsma wrote: I'm in Chapter 5 of the tutorial, configuring the database. I think I've done everything correct to set the DATABASE_ENGINE = 'sqlite3'. Then I check the settings and see an error: ImproperlyConfigured: settings.DATABASES is improperly configured.

Re: Django admin runs out of memory with ForeignKeys to large tables

2012-09-05 Thread Thomas Lockhart
On 9/5/12 6:00 AM, Mattias Linnap wrote: I've found two solutions: setting "editable=False" in the model's field definition (which removes the field completely from admin), or adding it to readonly_fields list in the ModelAdmin (which keeps the data visible). Perhaps it will be possible to

Re: Right approach to create simple CRM

2012-09-02 Thread Thomas Lockhart
... 3. Get opensource CRM and configure for your needs. 4'. ... and add plugins if needed. hth - Tom -- 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

Re: Do I understand the support schedule correctly?

2012-08-06 Thread Thomas Lockhart
I'd be interested in hearing other opinions about this. Out there in > the "real world" (™), how long does Long Term Support have to be in > order to be practically useful? Two years to be able to stick with a single version? Just fine imho. A few points you have probably heard before:

Re: PostGIS 2.0.0 problems

2012-08-03 Thread Thomas Lockhart
On 8/3/12 3:39 PM, Oleg Korsak wrote: looks like GeoDjango is dead, it is not solved for almost half of the year Really? What is the use case requiring a version 2.0.0? Seems that the previous 1.x version works as advertised. And typically folks don't jump on a x.0.0 of anything, expecting to

Re: No timezone support for TimeField?

2012-07-31 Thread Thomas Lockhart
On 7/31/12 1:34 PM, Tejinder Singh wrote: Django 1.4 does not store aware times for TimeField, it only does for DateTimeField. Its really annoying, as python datetime.time object does support TZINFO just like datetime.datetime objects. I wonder if it is a bug? Btw i have tested it on postgres

Re: how to make template for startapp and startproyect?

2012-07-24 Thread Thomas Lockhart
On 7/24/12 11:24 AM, kase wrote: hello.. i wish make my templates for django-admin.py startproyect and startapp but i dont know how, and i dont find documentation to explain how to make it (i find documentation from how to use, but not how to make) There may be a better way suggested by

Re: Newbie -- issue with psycoppg2

2012-07-21 Thread Thomas Lockhart
On 12-07-21 3:57 AM, Quincy Kwende wrote: create a database using PostgreSQL Try googling "create a database using PostgreSQL" The first hit is the chapter you want in the Postgres docs. hth - Tom -- You received this message because you are subscribed to the Google Groups

Re: Query Distance from User

2012-07-15 Thread Thomas Lockhart
On 7/15/12 4:41 PM, JJ Zolper wrote: Yeah I'm trying to get GeoDjango set up as we speak. GeoDjango sounds awesome. I have postgresql and Im trying to install postgis but im getting this: FIx your errors in the configure step before bothering to try building. In this case you need libxml2

Re: Hello!

2012-07-14 Thread Thomas Lockhart
On 7/14/12 12:04 PM, Shubz wrote: Hi! I'm new to Python and Django. I feel like I'm jumping in deep end, but I have previous PHP and Java knowledge so what the hey. I was wondering if anybody could be kind enough to point me in the right direction to a broken down tut on installation for Mac?

Re: ForeignKey problem

2012-07-06 Thread Thomas Lockhart
On 12-07-06 10:14 AM, Soviet wrote: Thanks, but damn, isn't that overly complicated (for me). Using through looks like a easier way, but then I have to add Wheel four times and can't just type '4' in some field, since I don't need it to exist in database four time, just an information that

Re: If using South, does it even matter what the underlying database is?

2012-07-06 Thread Thomas Lockhart
On 12-07-06 8:56 AM, Houmie wrote: Today I have started my first steps into postgresql, since its recommended by the Django team. I came across several issues, that I solved patiently one by one. (disclaimer: I'm a Postgres homer) These issues *should* come up with a well-designed database.

Re: 1.4: Emails to BCC addresses not sent

2012-07-06 Thread Thomas Lockhart
... If that fails as well, I guess a ticket is in order, but like I said "works for me" (in version 1.4). If that doesn't fail, then make sure cco is filled. fwiw it works for me too in 1.4 using virtualenv. Thanks Melvyn for the simple example. - Tom -- You

Re: Foreign Key needs quotes?

2012-07-02 Thread Thomas Lockhart
... So I wanted to know, which is the right way to go or it does not matter? I prefer without quotes for most cases. But for cases when a model is not yet defined (for example, you want to define a foreign key to a model which comes later in the source file) then you need to use the quotes to

Re: am new bird to django,need some suggestion...please please do reply friend..

2012-07-02 Thread Thomas Lockhart
On 7/2/12 10:38 AM, manish girdhar wrote: h i will try my best.actually i have already read that documentation but when i went to make application,then i got problem in using filter functions..and this kind of functions are not mentioned in the documentation.thats why i was facing

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 6/27/12 11:48 AM, David Wagner wrote: Looking at that I think I may need to add a foreignkey to cert_types relating to person since a person can have multiple certification types (NRA Instructor, CCL Instructor, etc). No. See below. On Wed, Jun 27, 2012 at 11:40 AM, David Wagner

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 8:02 AM, David Wagner wrote: Thanks for all the replies and I think I'm getting it now but it gets more complex too. So NRA Licenses is essentialy going to become a type of several certifications. For instance. NRA Instructor * Home Firearm Safety Instructor * Refuse to be

Re: ManyToManyField is this right?

2012-06-27 Thread Thomas Lockhart
On 12-06-27 6:57 AM, David Wagner wrote: I'm a self taught programmer who hasn't done much of anything for years so please forgive me if this question is naive. I have a hard time sometimes understanding some of the lingo used by trained programmers. With that said, I'm having trouble

Re: ForeignKey problem

2012-06-25 Thread Thomas Lockhart
On 12-06-25 10:02 AM, Adrian Bool wrote: On 25 Jun 2012, at 17:53, Soviet wrote: Thank you kind sir for your fast response, that worked brilliantly. Can I be cheeky and ask why does it work? :) Magic! ;-) The mechanism must involve deferred resolution of the second model by passing the

Re: Custom SQL for creating django tables

2012-06-25 Thread Thomas Lockhart
On 12-06-25 1:35 AM, Mina Farid wrote: Hello guys, I am connection from django to Apache Derby. I am using IBM DB2 driver backend. Django tables are created in DB2 syntax, which is not very compatible with Derby. Is there any way that I can force django to customize the creation of SQL to a

Re: Creating permalink for blog tags that have the Post class as foreign key

2012-06-25 Thread Thomas Lockhart
On 12-06-24 7:18 PM, Matthew Meyer wrote: After making some changes debugging in the shell revealed, I have gotten it to work, thanks!!! So what was the solution??!!! - Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: New to DJANGO

2012-06-21 Thread Thomas Lockhart
On 12-06-21 9:37 PM, LJ wrote: I started out learning Django using the "Writing your first Django app" article: https://docs.djangoproject.com/en/dev/intro/tutorial01/ This is a very well-written tutorial that goes through each part in detail. +1 anyone starting with Django is wasting time if

Re: Oracle: blank, null, and empty_strings_allowed

2012-06-20 Thread Thomas Lockhart
On 6/20/12 3:33 AM, Melvyn Sopacua wrote: On 20-6-2012 0:49, André Pang wrote: The idea is to try to ensure that no empty strings make it to the database, so you're not allowed to insert them into the database. You can ensure this at the Django (ORM) layer right now with blank=True for the

  1   2   >