Re: Django deployement Apache

2017-08-28 Thread Vernon Swanepoel
You can just copy the static files out of Django and into the static files in your project itself. -- 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 to

Re: Django deployement Apache

2017-08-26 Thread Vernon Swanepoel
knows exactly what you've got running, but if you stick with it, you'll get it working. Regards, Vernon On Saturday, 26 August 2017 21:31:34 UTC+1, sarfaraz ahmed wrote: > > Hey Team, > > Please someone help. > I am still getting error > > * ImportError: No module named djang

Re: Build Django Blog

2017-08-26 Thread Vernon Swanepoel
n/1.11/topics/testing/> - if you're building something that's going to be growing in complexity, taking a TTD approach is going to save you a lot of headaches in the long run. A fun book to work through is "Test-driven development with Django <https://www.obeythetestinggoat.com/>"

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
n quit working, and I was able to regain control using Salt. The demo uses PostgreSQL -- I will send you my mariadb state if you wish. -- Vernon Cole On Wednesday, February 10, 2016 at 1:50:22 AM UTC-7, Tobias Dacoir wrote: > > We've build a small web application using Django 1.8 over the

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 Tia

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: Trying to set up hashed versioning in Django for static files

2014-03-10 Thread Vernon Burt
That seemed to do it.. I definitly learned a lot about serving these files. Thank you to both Tom and Camilo, you helped me a lot! Thanks again, Vernon Burt On Monday, March 10, 2014 6:02:30 AM UTC-7, Tom Evans wrote: > > On Mon, Mar 10, 2014 at 1:02 AM, Vernon Burt > <charg.

Re: Trying to set up hashed versioning in Django for static files

2014-03-09 Thread Vernon Burt
or javascript loads. I'm wondering if I'm misusing the css tags I'm testing with. An example from my base template: {% load static %} Thank you for your time, Vernon Burt On Thursday, March 6, 2014 8:08:07 PM UTC-8, Vernon Burt wrote: > > Hello all, > > I've pretty quikly fou

Trying to set up hashed versioning in Django for static files

2014-03-06 Thread Vernon Burt
Hello all, I've pretty quikly found out in my DJango adventure that I need to have some kind of versioning for my static css and javascript files. After talking to some web developers I was directed to use Django's CachedStaticFilesStorage app to append an md5 hash to the static files path.

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
be much more help to you. -- Vernon Cole On Friday, December 6, 2013 6:59:11 AM UTC-7, Derrick Jackson wrote: > > Hi Michael, > > I'm using django-pyodbc 0.10 > > On Friday, December 6, 2013 8:42:00 AM UTC-5, Michael Manfre wrote: >> >> Which database backend are you

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

dates DateQuerySet includes time

2013-10-15 Thread Chad Vernon
I'm trying to use the dates QuerySet method but I am getting different values in the template: view: timecards = Timecard.objects.all() dates = Timecard.objects.dates('date', 'day', order='DESC') template: {% for tc in timecards %} {{ tc.date }} {% endfor %} Oct. 14, 2013 {% for d in dates

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:

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
which may be blocking port 8000. If you are trying to see it from another computer, then your server needs to listen on other ports. Try "python manage.py runserver 0.0.0.0:8000" -- Vernon On Saturday, October 12, 2013 11:02:40 AM UTC-6, gitrookie wrote: > > hi > > I have

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
enough attendees get there to be worthwhile? I am not saying "don't try" but there are some hurdles to overcome. I have joined the mailing list and will help out if I can. -- Vernon Cole eHealth Africa .org On Friday, October 4, 2013 5:13:44 PM UTC+1, Daniele Procida wrote: > &

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: django-celery connects to localhost but not by ip

2013-09-20 Thread Chad Vernon
gt; $(PYTHON) $(MANAGER) celery worker -l debug -E -B -n > 'local-worker' \ > --pidfile=celeryworker.pid > }}} > > It is highly verbose, but might help you to visualize what is going on. > > [] > > > On Fri, Sep 20, 2013 at 1:23 AM, Chad Vernon <chadv...@gmail.com

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: django-celery connects to localhost but not by ip

2013-09-19 Thread Chad Vernon
t; Look in the RabbitMQ logs. Did the request make it to RabbitMQ? > > John > > On Sep 19, 2013, at 7:34 PM, Chad Vernon <chadv...@gmail.com > > wrote: > > I am using djcelery and rabbitmq. Everything runs fine when the > BROKER_HOST is localhost but when I change it

django-celery connects to localhost but not by ip

2013-09-19 Thread Chad Vernon
I am using djcelery and rabbitmq. Everything runs fine when the BROKER_HOST is localhost but when I change it to the ip of the machine it no longer runs. Basically I am trying to be able to run python commands on a separate machine to be picked up by the RabbitMQ server on a different machine.

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: Calling ffmpeg doesn't work on apache server

2013-07-15 Thread Chad Vernon
, ovnicraft wrote: > > > > > On Wed, Jun 19, 2013 at 6:01 PM, Chad Vernon <chadv...@gmail.com > > wrote: > >> I'm trying to use ffmpeg to generate a thumbnail for a video. It works >> just fine when I call it from a python shell and when I test it in "pyth

Re: Calling ffmpeg doesn't work on apache server

2013-06-20 Thread Chad Vernon
e. > > John > > On 20/06/13 00:48, Chad Vernon wrote: > > One last observation: > > I think it has something to do with the apache user permissions. I'm > running the mod_wsgi daemon process with myself as the user and I need to > specify the full path to ffmpeg (

Re: Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
totally confused now. I'm an apache/django beginner so bear with me please! On Wednesday, June 19, 2013 4:12:02 PM UTC-7, Chad Vernon wrote: > > Looks like it has something to do with calling subprocess from the server > because this gives the same error: > > response = subproce

Re: Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
Looks like it has something to do with calling subprocess from the server because this gives the same error: response = subprocess.check_output(['which', 'ls']) Anyone have any suggestions? On Wednesday, June 19, 2013 4:01:30 PM UTC-7, Chad Vernon wrote: > > I'm trying to use

Calling ffmpeg doesn't work on apache server

2013-06-19 Thread Chad Vernon
I'm trying to use ffmpeg to generate a thumbnail for a video. It works just fine when I call it from a python shell and when I test it in "python manage.py shell". However when I try to run from the apache server running locally, I get an error: # normally I call subprocess.call, but for debug

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
villages.) The python code which does the import is implemented as a set of manage.py command scripts. -- Vernon Cole On Saturday, June 1, 2013 3:21:33 AM UTC-6, Ali hallaji wrote: > > > -- You received this message because you are subscribed to the Google Groups "Djang

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: > > >

Re: Announcing new django project

2013-01-31 Thread Chad Vernon
Very nice! I'll probably try it out in my current project. On Thursday, January 31, 2013 9:25:06 PM UTC-8, h3 wrote: > > Hi everybody, > > I would like to introduce you my latest project: django-editlive > > It can make any database object editable in template with a simple > template tag. > >

Re: F function?

2013-01-31 Thread Chad Vernon
Nevermind, found it! Was having a hard time searching for "F" :) https://docs.djangoproject.com/en/1.4/topics/db/queries/#query-expressions On Thursday, January 31, 2013 9:10:39 PM UTC-8, Chad Vernon wrote: > > I was looking at this snippet: > > http://djangosnippets.org/s

F function?

2013-01-31 Thread Chad Vernon
I was looking at this snippet: http://djangosnippets.org/snippets/1560/#comments And on this line: ReportField.objects.filter(order__range=range).update(order=F('order')+shift) What is the F in F('order')? Thanks! Chad -- You received this message because you are subscribed to the Google

get_absolute_url goes to ../../../r/14/1/

2013-01-21 Thread Chad Vernon
I'm implementing the get_absolute_url method on one of my models. @models.permalink def get_absolute_url(self): return ('viewProject', (), {'projectSlug' : self.slug}) My url has: url(r'^(?P[-\w]+)/$', 'assetlibrary.views.viewProject', name='viewProject'), However, in the

jquery multi file uploads in single post

2013-01-14 Thread Chad Vernon
I'm creating an asset management system with Django and I'm using this jquery multi-file uploader: http://blueimp.github.com/jQuery-File-Upload/ I want to be able to get all uploaded files in a single POST request instead of each file having it's own request so I can count all the files as a

Re: Access local network locations

2013-01-07 Thread Chad Vernon
Never mind. I think it's a permissions issue. Thanks! On Monday, January 7, 2013 5:04:06 PM UTC-8, Chad Vernon wrote: > > Hello! > > I'm working on a local django site and I've set up a post-save signal > where when an entry is initially saved, I want to copy a template directo

Access local network locations

2013-01-07 Thread Chad Vernon
Hello! I'm working on a local django site and I've set up a post-save signal where when an entry is initially saved, I want to copy a template directory structure somewhere. This template directory structure lives on a local network location. However I can't seem to access it through my local

RE: Django asset management and dynamically created databases

2012-12-23 Thread Chad Vernon
:59 PM To: django-users@googlegroups.com Subject: Re: Django asset management and dynamically created databases On 24/12/2012 8:10am, Chad Vernon wrote: > Hi there, > I'm designing a database for an animation studio to track assets across > multiple shows. We potentially would want

Django asset management and dynamically created databases

2012-12-23 Thread Chad Vernon
Hi there, I'm designing a database for an animation studio to track assets across multiple shows. We potentially would want each show to have its own database, however we would want functionality to search for assets across all shows. I am exploring the use of django as the main framework for

Re: Hello World with Django

2012-09-19 Thread Vernon Cole
127.0.0.1 is -- by definition -- your local computer. You need to substitute the actual address of your remote server. On Sunday, September 16, 2012 3:24:02 PM UTC-6, python@hotmail.com wrote: > > > Hi, > > Can someone help me in this question? > > >

Re: Slow application performance...

2009-01-02 Thread vernon
ent server technologies, multithreaded vs. single threaded processes, etc... short of taking an operating systems class? :) I'd like to understand and experiment without necessarily having to wait for the "perfect setup" to eventually emerge, but I'm feeling a little out of my league.

Slow application performance...

2009-01-01 Thread vernon
Hi everyone, When I was first experimenting with Django on my local machine with the bundled webserver, one of the things I was really impressed by was the speed — everything was instantaneous. Listing things in the DB, modifying and saving changes etc... I finally decided to deploy the

Serializing QuerySets and Python objects best practices

2008-12-23 Thread vernon
ment.objects.all()} Right now, I'm just running serializer.serialize on each of the query sets and constructing the JSON string myself, but I have more complicated use case where that becomes messy. Is there a clean way to do this? Best, Vernon --~--~-~--~~~---~--~-