Re: execute code at startup

2016-03-09 Thread Vernon D. Cole
I think if I were doing this, I would write a custom management command to update the tables, and run it at system startup time. Management commands are easy to debug and well documented. On Tuesday, March 8, 2016 at

Re: How to update a live / deployed Django project?

2016-02-10 Thread Vernon D. Cole
I have been through several variations on what you are doing. The solution which has worked best for me is to use SaltStack to control the update. It will pull your updates using git, apply as needed, and restart your servers. If you are building a new server (for testing or prototype

Re: Python Windows + Web +Mobile application: Kivy or Django

2016-02-05 Thread Vernon D. Cole
Kivy will do desktop and mobile, but web applications are a different animal completely. Since they run on a web browser, rather than directly on the computer operating system, your ability to interact with the user's environment is very limited. Anything complex must be written in JavaScript.

Re: installing django scripts on a web server

2015-12-18 Thread Vernon D. Cole
On Friday, December 18, 2015 at 4:55:16 AM UTC-7, maringire ringaz wrote: > > How do i install django-cms(or any other web app) on xampp or runserver > using pycharm > First, I would say that xampp is a non-starter, because it does not have support for Python. [besides that, I prefer nginx

Re: Django model for non web applications

2015-07-03 Thread Vernon D. Cole
Jeff: I think that Russell's answer might be more appropriate for your use case than Carl's. django.setup() calls settings.configure(), but also tries to pull in other application modules, which you might not want. On Thursday, July 2, 2015 at 6:50:20 PM UTC-6, Carl Meyer wrote: > > On

Re: how to do a django data migration on a massive Postgres data table (solved)

2015-05-27 Thread Vernon D. Cole
e django-user ML. > > I don't see the gist though, is the problem from me? > > On 05/22/2015 09:09 PM, Vernon D. Cole wrote: > > Django migrations are run in a single transaction (if your database is > capable of doing a rollback of DDL, as PostgreSQL is) so data migrations of &g

how to do a django data migration on a massive Postgres data table (solved)

2015-05-22 Thread Vernon D. Cole
Django migrations are run in a single transaction (if your database is capable of doing a rollback of DDL, as PostgreSQL is) so data migrations of large tables become impossible. I was able to solve this problem by having the migration run a no-wait subprocess which performs the data migration

Re: Converting bytes to unicode that works both in python2 and 3

2015-05-19 Thread Vernon D. Cole
if sys.version_info >= (3,0): def str2bytes(sval): return sval.encode("latin1") unicode = str else: def str2bytes(sval): if isinstance(sval, str): return sval return sval.encode("latin1") This is what I use to solve the opposite problem. It should

Re: data migrations for large tables on Postgres

2015-05-14 Thread Vernon D. Cole
ango would be happy? > > Johnf > > On 05/14/2015 02:43 PM, Vernon D. Cole wrote: > > I have learned the hard way this week that data migrations in django 1.8, > as wonderful has they are, do not scale. > > My test data table is now sitting at about 90,000,000 rows. I was ab

data migrations for large tables on Postgres

2015-05-14 Thread Vernon D. Cole
I have learned the hard way this week that data migrations in django 1.8, as wonderful has they are, do not scale. My test data table is now sitting at about 90,000,000 rows. I was able to add a "null=True" field in an instant, as documented. Then came my attempt to fill it -- I tried using

Re: setting up python 3.4.3 on window 7.

2015-04-03 Thread Vernon D. Cole
Multiple versions of Python will happily run side-by-side on Windows. I regularly have at least six versions installed for testing purposes. When you install Python 3.4, (using the standard installer from python.org) it will also install the Python Launcher for Windows. Using it, you will

Re: Config: DB or git?

2014-09-30 Thread Vernon D. Cole
12-factor is all the rage, and they have some very good ideas that ought to be followed. But insisting that environment variables are the only correct way of storing settings, is, well, just plain wrong. [ Note: I have 40 years of experience, I recognize a fad when I see it. ] All of those

Re: Language code issue - Django thinks default is en-us?

2014-06-20 Thread Vernon D. Cole
(*cough*) Excuse me, everyone, but many of the locale names mentioned in this discussion have been invalid. https://docs.djangoproject.com/en/1.6/topics/i18n/#term-locale-name says: > locale nameA locale name, either a language specification of the form ll > or a combined language and country

Re: ASP .NET web service and Django

2014-05-27 Thread Vernon D. Cole
Jani: Can you please provide a link to the "hacks" you mention for IronPython? I am preparing to run django with IronPython3 and any information on what people did to make IronPython work would be helpful. -- Vernon Cole On Monday, May 26, 2014 12:21:00 PM UTC+1, Jani Tiainen wrote: > >

Re: I can't connect Django with SQL Anywhere 11 Database

2014-04-14 Thread Vernon D. Cole
You would be best advised to contact whoever supports that driver. Their contact information ought to be on their github site. My guess (as a maintainer of a different 3rd party Windows database driver) is that they have not upgraded to django 1.6 yet. But that's only a wild guess. The other

Re: Django Windows Install Issues

2014-02-26 Thread Vernon D. Cole
On Tuesday, February 25, 2014 2:23:49 PM UTC-7, Joe Buty wrote: > > Hello, I am having trouble getting Django to work. I have installed python > and downloaded and unzipped the .tar file for django. I am using windows 8 > ugh and can not open the instal file. I read through the setup.py and I

Re: Python

2014-02-24 Thread Vernon D. Cole
Python is a programming language. The purpose of a programming language is to write applications. Django is an application written in the Python language. The purpose of django is to create, operate, and administer

Creating database in windows

2014-02-16 Thread Vernon D. Cole
Django on Windows is a poor stepchild of the real thing. If you are serious about using django then you really need to learn Linux at some point in time. I am amazed that something as complex as geodjango will even run in Windows. You have two choices: Either learn to use Windows command line

Re: DecimalField and SQL Server

2013-12-06 Thread Vernon D. Cole
Derrick: I just added your failing test pattern to the unit test for adodbapi, and it works correctly. Therefore I would conclude that the problem is in django-pyodbc, not in SQL Server itself. Micheal and I maintain the other SQL server backend, sqlserver_ado, so I am afraid that we can't be

Re: How to replace Django ORM with sqlalchemy

2013-12-03 Thread Vernon D. Cole
The maintainers of django have discussed this question. They all believe that it would be almost impossible to do. The two ORMs operate differently, so that there would not be a simple "replace operation A with operation B" type of conversion. The present ORM is too deeply embedded to be

Re: psycopg2._psycopg.cursor missing cursor.fetchnone/cursor.fetchall

2013-11-02 Thread Vernon D. Cole
One problem you are having is a typographical error: The cursor method is "Fetch One" not "Fetch None". On Friday, November 1, 2013 8:46:17 AM UTC+1, hjr1 wrote: > > Hi all. > > I am trying to use django.db.connection with psycog2 (postgres). I can run > something like

Re: Django 1.5 tutorial, part 1

2013-10-12 Thread Vernon D. Cole
You have a spelling error in INSTALLED_APPS: "pools" vs "polls". You want a survey, not a puddle of water. (This could be caused by an overly aggressive spelling corrector on your computer.) -- Vernon On Saturday, October 12, 2013 10:41:11 AM UTC-6, Enrico Battiston wrote: > > Hi, i'm a first

Re: unable to access django development server on firefox/chrome

2013-10-12 Thread Vernon D. Cole
Also make sure your browser is not trying to use a proxy. 127.0.0.1 should be an exception on the proxy setting. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: unable to access django development server on firefox/chrome

2013-10-12 Thread Vernon D. Cole
That's exactly how I do it using Firefox on my Ubuntu 13.04 workstation. I see nothing wrong in your explanation. Are you trying to access it from the same computer that the development server is running on? If so, then check to see whether you have a firewall running on your workstation

Re: Nginx versus Apache

2013-10-08 Thread Vernon D. Cole
If you are doing any of the hundred-odd things that Apache can do an Nginx cannot, then you will need to use Apache. But, if all you are doing is serving static files and handing all heavy lifting to django, then Nginx with uWSGI will do everything you need, and will do it with less resources.

Re: PyCons in Africa

2013-10-07 Thread Vernon D. Cole
It would be wonderful if this could be done. My question is: can it be done? The most populous nation in Africa (and therefore, we must presume, the one with the most Python programmers) is Nigeria. Getting an entrance visa here -- even a tourist visa -- is a challenging thing. It's not

Re: how to start learning Django in Windows Platform

2013-10-02 Thread Vernon D. Cole
You can run all of the tutorial stuff in Windows, and it's not a bad idea to learn things one-at-a-time. I would suggest, however, that if you are serious about using django, you need to learn Linux, too. The easiest way to do that would be to download the current Ubuntu desktop version, make

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-25 Thread Vernon D. Cole
ny method to provide something like a script >> to create a virtualenv, install the needed software and have a working >> environment in a few commands? Something like "vagrantfile for virtualenv" >> http://docs.vagrantup.com/v2/vagrantfile/index.html >> >>

Re: Using environment variables in settings.py - good practice? How to handle missing variables gracefully?

2013-09-20 Thread Vernon D. Cole
There is indeed a better way: Structured Settings. Turn the usual pattern of having settings.py import local_settings.py upside down. Call your specific setting (you can specify it be altering the DJANGO_SETTINGS_MODULE environment variable in your virtualenv activation script) and it will

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-17 Thread Vernon D. Cole
Answering the other half of your question: The choice of IDE is not nearly as important as its ease of integration with your dvcs. If you are already familiar with a good one, don't change. On my present project, my boss and I are both using PyCharm, and my other co-worker is using Eclipse,

Re: Recommended dev environment for a Django project deployed to Linode

2013-09-17 Thread Vernon D. Cole
I installed a client for my favourite distributed version control system on my Linode instance. I have a private repository on a public IP. (github, bitbucket, or launchpad will work, depending on your dvcs of choice -- I have used all three, and other times I have used a private dvcs host,

Re: export .csv file from database

2013-06-19 Thread Vernon D. Cole
I am guessing that your csv writer is outputting something that your spreadsheet is reading incorrectly. Try opening the csv with a text editer (a good one, like Notepad++) so that you can really see what is going on. Embedded commas or quotes inside a field are invitations for disaster, and

Re: django's database system

2013-06-06 Thread Vernon D. Cole
You can write a "django management command" which runs on a workstation. https://docs.djangoproject.com/en/dev/howto/custom-management-commands/ I use this a lot for command-line operation to do batch processing kinds of things. Since "django is just Python", there is nothing to prevent you

Re: saving latitude and longitude values in django

2013-06-04 Thread Vernon D. Cole
Saving the values is the easy part. The format you use depends on what you want to do with them. If you are only displaying them to users, CharField might be okay. If you are going to do any processing, you should probably convert them. My storage is done like this: gpsLatitude =

Re: how to import excel file into django models?

2013-06-02 Thread Vernon D. Cole
I have used two methods -- one works only on Windows, the other is cross platform -- and you have said nothing about your application so it is hard to advise... If you know Windows and SQL -- then use adobapi and open the spreadsheet as a table (see examples at

Re: Can I use Connector/Python instead of MySQLdb? And how?

2013-05-12 Thread Vernon D. Cole
On Saturday, May 11, 2013 7:43:40 PM UTC-6, icedr...@gmail.com wrote: > > I am using Python 3.3.1 and Django 1.5.1. MySQLdb doesn't support Python > 3, so I want to use Connector/Python instead. But I don't know how to do > this. > > Is it easy to do this? If it is, how can I do this? > >

Re: Can I use Connector/Python instead of MySQLdb? And how?

2013-05-12 Thread Vernon D. Cole
The core developers are working on the problem as we speak. I would suggest using either another database engine or Python 2.7 until they get it going. I am guessing a few weeks, but that is only a guess. If you do use Python 2.7 be sure to follow the suggestions to write your code as 3.3

Beta testers wanted for Linux access to Windows data stores.

2013-04-28 Thread Vernon D. Cole
If any of you have good Microsoft SQL Server connections, I could use some help testing. Adodbapi has been around a long time -- an old fork of it is used in django-mssql. This version is designed to replace that one. I have added a new module in the package to let a Linux box get to Windows ADO

Re: RuntimeError: maximum recursion depth exceeded in cmp

2013-03-24 Thread Vernon D. Cole
You have an error in your "models.py" file. Note that the last message was "Validataing models...". Is there anything in models.py? In your sample script you never modify it. On Friday, March 22, 2013 1:23:46 PM UTC-6, tarik setia wrote: > > >