Re: Problem setting up django server

2013-06-18 Thread Randy Baxley
Glad and sad that you are going through this.  Sad in that the process
seems too complicated.  Glad in that I have failed miserably in trying to
get virtualenv, vagrant, and other packages to install both in Windows and
in Xubunto.  I have run python27 and 33 without problems but even in the 27
directory the python command is not recognized in the terminal.


On Tue, Jun 18, 2013 at 11:31 AM, smy28  wrote:

> Okay, so I ran python manage.py shell and I got the following error:
> TypeError: Error when calling the metaclass bases
> __init__() keywords must be strings
>
>
> On Tuesday, June 18, 2013 11:10:10 AM UTC-4, Roberto wrote:
>>
>> Are you in a virtualenv? Can you run $python manage.py shell?
>>
>> Which version of python have you installed? Django v1.5 requires python
>> >= v2.6.5, and from your stacktrace it seems you just have v2.6.
>> https://docs.djangoproject.**com/en/1.5/faq/install/#what-**
>> are-django-s-prerequisites
>>
>>
>> On Tuesday, 18 June 2013 17:00:23 UTC+2, smy28 wrote:
>>>
>>> I just installed Django and I'm trying to initially set up the server,
>>> as detailed in the 'Part 1' Tutorial. I haven't configured any settings
>>> yet. Whenever I run the command "python manage.py runserver", I get the
>>> following message:
>>>
>>>
>>>
>>> Validating models...
>>>
>>> Unhandled exception in thread started by >> of >> object at 0x100592e90>>
>>> Traceback (most recent call last):
>>>   File "/Library/Python/2.6/site-**packages/django/core/**
>>> management/commands/runserver.**py", line 92, in inner_run
>>> self.validate(display_num_**errors=True)
>>>   File 
>>> "/Library/Python/2.6/site-**packages/django/core/**management/base.py",
>>> line 280, in validate
>>> num_errors = get_validation_errors(s, app)
>>>   File 
>>> "/Library/Python/2.6/site-**packages/django/core/**management/validation.py",
>>> line 35, in get_validation_errors
>>> for (app_name, error) in get_app_errors().items():
>>>   File "/Library/Python/2.6/site-**packages/django/db/models/**loading.py",
>>> line 166, in get_app_errors
>>> self._populate()
>>>   File "/Library/Python/2.6/site-**packages/django/db/models/**loading.py",
>>> line 72, in _populate
>>> self.load_app(app_name, True)
>>>   File "/Library/Python/2.6/site-**packages/django/db/models/**loading.py",
>>> line 96, in load_app
>>> models = import_module('.models', app_name)
>>>   File "/Library/Python/2.6/site-**packages/django/utils/**importlib.py",
>>> line 35, in import_module
>>> __import__(name)
>>>   File 
>>> "/Library/Python/2.6/site-**packages/django/contrib/auth/**models.py",
>>> line 21, in 
>>> from django.contrib.contenttypes.**models import ContentType
>>>   File 
>>> "/Library/Python/2.6/site-**packages/django/contrib/**contenttypes/models.py",
>>> line 127, in 
>>> class ContentType(models.Model):
>>>   File "/Library/Python/2.6/site-**packages/django/db/models/**base.py",
>>> line 97, in __new__
>>> new_class.add_to_class('_meta'**, Options(meta, **kwargs))
>>> TypeError: Error when calling the metaclass bases
>>> __init__() keywords must be strings
>>>
>>>
>>>
>>>
>>> Any ideas as to why this is?
>>> Thanks in advance!!
>>>
>>  --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Help in finding how to learn Django

2013-07-02 Thread Randy Baxley
Thank you for your list of things to learn Django.

I had already worked through dr chucks web site and MOOC, U of Toronto 
first and second course at Coursera, Rice's Interactive Python also at 
Coursera and most of Udacity CS 101 so was getting very familiar with 
python.  Working now through the Django book.  I have Xubunto and Windows 
on my desktop and laptop so I went through a lot of updates and then 
chapters one and two on both.  Working through chapter 3 this morning.  One 
really has to wade through a lot of options and be careful of which path 
they are on as well as very simple things like  http://127.0.0.1:8000/hello/ 
and not  http://127.0.0.1:8000.  Again, thank you.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Missing peice before best practises

2013-07-07 Thread Randy Baxley
I use a desktop at home and a laptop when I go attempting to hack in the 
open community.  The hack experiances always seem so messy to me.  Most 
recently I am trying to help with a project called SUMO but there are tons 
of download requirements outside of the python and django.  I have also 
tried to get any of the groups I have gone to to define a stack for hacking 
and vagrant, virtualenv and of course git and sudo.  Every new project 
seems to use dependencies that mean a lot of time downloading widgets that 
seem to do the same things if one asks but after a while why ask?  If it is 
too sloppy I will just concentrate on less messy projects.  I am tempted to 
play with flask but for now the django book examples are working though I 
will likely have to go through chapter four many multiples of times and am 
hoping soon to get some move towards being able to build the site I have my 
mind set on.

On Saturday, July 6, 2013 5:53:46 PM UTC-5, Sayth Renshaw wrote:
>
> Apologies Amirouche for the late reply.
>
> The documentation is good, but I like many apparently(based on tutorials 
> for other envs) prefer a hands on approach to a documentary approach. This 
> is the place where Django doesn't have much depth in its ecosystem. It has 
> no current books and no hands on tutorial other than GSWD which creates a 
> lot of lifting with installing ruby, vms, vagrant and so on just to start 
> with Django.
>
> Flask is starting to get a few tutorials popping up in real python for 
> web, 
> http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world,
>  
> and in the works the Picard flask kickstarter 
> http://www.kickstarter.com/projects/1223051718/practical-flask-book-project
> .
>
> I put my money where my mouth is and sponsor these kickstarters as there 
> is such a shortage of good info.
>
> As I would back you Amirouche if you started a Kickstarter to give Django 
> a good practical and hands on tutorial.
>
> Cheers
>
> Sayth
>
>
>
>
>
>
> On Thu, Jul 4, 2013 at 1:05 AM, Amirouche Boubekki 
> 
> > wrote:
>
>>
>>
>>
>> 2013/7/1 Sayth Renshaw >
>>
>>>
>>>
>>> On Monday, July 1, 2013, Tom Evans wrote:
>>>
 On Mon, Jul 1, 2013 at 11:37 AM, Sayth Renshaw  
 wrote:
 > Is that good though?
 >
 > Barring 2 scoops there is no new material to recognise and guide 
 users to
 > the new features of Django and to get beginner Django developers on 
 board
 > quicker.
 >
 > It leads to bits of info for each python framework but nothing
 > comprehensive.
 >
 > Sayth
 >

 Virtualenv, pip etc are not features of Django, they are features of
 python. It is right that Django mentions them in places, it is doubly
 right that it does not attempt to duplicate the fine documentation
 that pip and virtualenv possess themselves.

 Cheers

 Tom


>>> Agreed good tutorials would show steps and then point to resources for 
>>> further reading,
>>>
>>> At this point though it appears there is a scarcity of good tutorials 
>>> for current Django.
>>>
>>
>> pip+virtualenv[wrapper] is a pratice not something that will allow you to 
>> build a skyrocket as-is, you can live without it.
>>
>> The documentation is good, and overall ecosystem alive and active, what 
>> do you need more ? They are several CMS and admin apps, blog solutions 
>> etc... They are still improvements and stabilisation to be done on many 
>> (utility) apps... Everything I want to say is that outside the django 
>> tutorial, and anybooks you read, the best way to improve your skills it to 
>> [re]build something... 
>>
>> Time to time, I think about writring a set of tutorial about a CMS or 
>> Social Network from scratch, but experience says that except the actual 
>> code, the remaining issues are solved and well documented outside this 
>> virtual project, so this would, I think, have little value.
>>
>>
>>
>>
>> HTH,
>>
>> Amirouche
>>
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/f1RvG1vpVpg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Chapter 5 problems

2013-07-12 Thread Randy Baxley
randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py shell
Python 2.7.3 (default, Apr 10 2013, 05:46:21) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.db import connection
>>> cursor = connection.cursor()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py", 
line 324, in cursor
cursor = self.make_debug_cursor(self._cursor())
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", 
line 306, in _cursor
self._sqlite_create_connection()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", 
line 296, in _sqlite_create_connection
self.connection = Database.connect(**kwargs)
OperationalError: unable to open database file
>>> 
randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py validate0 
errors found
randy@randy-Inspiron-530s:~/dj/mfp/mysite$ 

I suspect my path and have tried several variations

DATABASES = {
'default': {
  #  'ENGINE': 'django.db.backends.mysql', 
'ENGINE': 'django.db.backends.sqlite3',
  #  'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 
'mysql', 'sqlite3' or 'oracle'.
'NAME': 'C:randy@randy/home/dj/mfp/mysite/mydb.db/', # Or path to 
database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '',# Empty for localhost through domain sockets or 
'127.0.0.1' for localhost through TCP.
'PORT': '',  # Set to empty string for default.
}

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Chapter 5 problems

2013-07-12 Thread Randy Baxley
that has been my first and my last variations but it is still throwing the
same error.


On Fri, Jul 12, 2013 at 1:55 PM, John  wrote:

> 'NAME' doesn't look like a path to a sqlite database file. I'd expect it
> to look more like:
>
> 'NAME': '/home/dj/mfp/mysite/mydb.db'
>
> John
>
> On 12/07/13 19:33, Randy Baxley wrote:
> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py shell
> > Python 2.7.3 (default, Apr 10 2013, 05:46:21)
> > [GCC 4.6.3] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)
> > >>> from django.db import connection
> > >>> cursor = connection.cursor()
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File
> > "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py",
> > line 324, in cursor
> > cursor = self.make_debug_cursor(self._cursor())
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
> > line 306, in _cursor
> > self._sqlite_create_connection()
> >   File
> >
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
> > line 296, in _sqlite_create_connection
> > self.connection = Database.connect(**kwargs)
> > OperationalError: unable to open database file
> > >>>
> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py validate0
> > errors found
> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$
> >
> > I suspect my path and have tried several variations
> >
> > DATABASES = {
> > 'default': {
> >   #  'ENGINE': 'django.db.backends.mysql',
> > 'ENGINE': 'django.db.backends.sqlite3',
> >   #  'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2',
> > 'mysql', 'sqlite3' or 'oracle'.
> > 'NAME': 'C:randy@randy/home/dj/mfp/mysite/mydb.db/', # Or path
> > to database file if using sqlite3.
> > # The following settings are not used with sqlite3:
> > 'USER': '',
> > 'PASSWORD': '',
> > 'HOST': '',# Empty for localhost through domain
> > sockets or '127.0.0.1' for localhost through TCP.
> > 'PORT': '',  # Set to empty string for
> > default.
> > }
> > --
> > 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 django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Chapter 5 problems

2013-07-12 Thread Randy Baxley
permissions for randy on mydb.db are read and write.


On Fri, Jul 12, 2013 at 3:05 PM, Jonathan Baker <
jonathandavidba...@gmail.com> wrote:

> Does the file have the correct permissions?
>
>
> On Fri, Jul 12, 2013 at 2:03 PM, Randy Baxley wrote:
>
>> that has been my first and my last variations but it is still throwing
>> the same error.
>>
>>
>> On Fri, Jul 12, 2013 at 1:55 PM, John wrote:
>>
>>> 'NAME' doesn't look like a path to a sqlite database file. I'd expect it
>>> to look more like:
>>>
>>> 'NAME': '/home/dj/mfp/mysite/mydb.db'
>>>
>>> John
>>>
>>> On 12/07/13 19:33, Randy Baxley wrote:
>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py shell
>>> > Python 2.7.3 (default, Apr 10 2013, 05:46:21)
>>> > [GCC 4.6.3] on linux2
>>> > Type "help", "copyright", "credits" or "license" for more information.
>>> > (InteractiveConsole)
>>> > >>> from django.db import connection
>>> > >>> cursor = connection.cursor()
>>> > Traceback (most recent call last):
>>> >   File "", line 1, in 
>>> >   File
>>> >
>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py",
>>> > line 324, in cursor
>>> > cursor = self.make_debug_cursor(self._cursor())
>>> >   File
>>> >
>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>> > line 306, in _cursor
>>> > self._sqlite_create_connection()
>>> >   File
>>> >
>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>> > line 296, in _sqlite_create_connection
>>> > self.connection = Database.connect(**kwargs)
>>> > OperationalError: unable to open database file
>>> > >>>
>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py validate0
>>> > errors found
>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$
>>> >
>>> > I suspect my path and have tried several variations
>>> >
>>> > DATABASES = {
>>> > 'default': {
>>> >   #  'ENGINE': 'django.db.backends.mysql',
>>> > 'ENGINE': 'django.db.backends.sqlite3',
>>> >   #  'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2',
>>> > 'mysql', 'sqlite3' or 'oracle'.
>>> > 'NAME': 'C:randy@randy/home/dj/mfp/mysite/mydb.db/', # Or path
>>> > to database file if using sqlite3.
>>> > # The following settings are not used with sqlite3:
>>> > 'USER': '',
>>> > 'PASSWORD': '',
>>> > 'HOST': '',# Empty for localhost through domain
>>> > sockets or '127.0.0.1' for localhost through TCP.
>>> > 'PORT': '',  # Set to empty string for
>>> > default.
>>> > }
>>> > --
>>> > 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 django-users+unsubscr...@googlegroups.com.
>>> > To post to this group, send email to django-users@googlegroups.com.
>>> > Visit this group at http://groups.google.com/group/django-users.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>> >
>>> >
>>>
>>> --
>>> 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 django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>  --
>> 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 django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Jonathan D. Baker
> Developer
> http://jonathandbaker.com
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Chapter 5 problems

2013-07-12 Thread Randy Baxley
randy@randy-Inspiron-530s:~/dj/mfp/mysite$ sqlite3
/home/dj/mfp/mysite/mysite/mydb.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

but at least now I know I have SQLite3 though I did not before you asked
that question.


On Fri, Jul 12, 2013 at 3:15 PM, John  wrote:

>  Can you open the file using sqlite on the command line:
>
> # sqlite3 /home/dj/mfp/mysite/mydb.db
>
> John
>
>
> On 12/07/13 21:08, Randy Baxley wrote:
>
> permissions for randy on mydb.db are read and write.
>
>
> On Fri, Jul 12, 2013 at 3:05 PM, Jonathan Baker <
> jonathandavidba...@gmail.com> wrote:
>
>> Does the file have the correct permissions?
>>
>>
>>  On Fri, Jul 12, 2013 at 2:03 PM, Randy Baxley wrote:
>>
>>> that has been my first and my last variations but it is still throwing
>>> the same error.
>>>
>>>
>>> On Fri, Jul 12, 2013 at 1:55 PM, John wrote:
>>>
>>>> 'NAME' doesn't look like a path to a sqlite database file. I'd expect it
>>>> to look more like:
>>>>
>>>> 'NAME': '/home/dj/mfp/mysite/mydb.db'
>>>>
>>>> John
>>>>
>>>> On 12/07/13 19:33, Randy Baxley wrote:
>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py shell
>>>> > Python 2.7.3 (default, Apr 10 2013, 05:46:21)
>>>> > [GCC 4.6.3] on linux2
>>>> > Type "help", "copyright", "credits" or "license" for more information.
>>>> > (InteractiveConsole)
>>>> > >>> from django.db import connection
>>>> > >>> cursor = connection.cursor()
>>>> > Traceback (most recent call last):
>>>> >   File "", line 1, in 
>>>> >   File
>>>> >
>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py",
>>>> > line 324, in cursor
>>>> > cursor = self.make_debug_cursor(self._cursor())
>>>> >   File
>>>> >
>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>>> > line 306, in _cursor
>>>> > self._sqlite_create_connection()
>>>> >   File
>>>> >
>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>>> > line 296, in _sqlite_create_connection
>>>> > self.connection = Database.connect(**kwargs)
>>>> > OperationalError: unable to open database file
>>>> > >>>
>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py validate0
>>>> > errors found
>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$
>>>> >
>>>> > I suspect my path and have tried several variations
>>>> >
>>>> > DATABASES = {
>>>> > 'default': {
>>>> >   #  'ENGINE': 'django.db.backends.mysql',
>>>> > 'ENGINE': 'django.db.backends.sqlite3',
>>>> >   #  'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2',
>>>> > 'mysql', 'sqlite3' or 'oracle'.
>>>> > 'NAME': 'C:randy@randy/home/dj/mfp/mysite/mydb.db/', # Or
>>>> path
>>>> > to database file if using sqlite3.
>>>> > # The following settings are not used with sqlite3:
>>>> > 'USER': '',
>>>> > 'PASSWORD': '',
>>>> > 'HOST': '',# Empty for localhost through domain
>>>> > sockets or '127.0.0.1' for localhost through TCP.
>>>> > 'PORT': '',  # Set to empty string for
>>>> > default.
>>>> > }
>>>> > --
>>>> > 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 django-users+unsubscr...@googlegroups.com.
>>>> > To post to this group, send email to django-users@googlegroups.com.
>>>> > Visit this group at http://groups.goo

Re: Chapter 5 problems

2013-07-13 Thread Randy Baxley
bump


On Fri, Jul 12, 2013 at 4:20 PM, Randy Baxley wrote:

> randy@randy-Inspiron-530s:~/dj/mfp/mysite$ sqlite3
> /home/dj/mfp/mysite/mysite/mydb.db
> SQLite version 3.7.9 2011-11-01 00:52:41
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite>
>
> but at least now I know I have SQLite3 though I did not before you asked
> that question.
>
>
> On Fri, Jul 12, 2013 at 3:15 PM, John wrote:
>
>>  Can you open the file using sqlite on the command line:
>>
>> # sqlite3 /home/dj/mfp/mysite/mydb.db
>>
>> John
>>
>>
>> On 12/07/13 21:08, Randy Baxley wrote:
>>
>> permissions for randy on mydb.db are read and write.
>>
>>
>> On Fri, Jul 12, 2013 at 3:05 PM, Jonathan Baker <
>> jonathandavidba...@gmail.com> wrote:
>>
>>> Does the file have the correct permissions?
>>>
>>>
>>>  On Fri, Jul 12, 2013 at 2:03 PM, Randy Baxley 
>>> wrote:
>>>
>>>> that has been my first and my last variations but it is still throwing
>>>> the same error.
>>>>
>>>>
>>>> On Fri, Jul 12, 2013 at 1:55 PM, John wrote:
>>>>
>>>>> 'NAME' doesn't look like a path to a sqlite database file. I'd expect
>>>>> it
>>>>> to look more like:
>>>>>
>>>>> 'NAME': '/home/dj/mfp/mysite/mydb.db'
>>>>>
>>>>> John
>>>>>
>>>>> On 12/07/13 19:33, Randy Baxley wrote:
>>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py shell
>>>>> > Python 2.7.3 (default, Apr 10 2013, 05:46:21)
>>>>> > [GCC 4.6.3] on linux2
>>>>> > Type "help", "copyright", "credits" or "license" for more
>>>>> information.
>>>>> > (InteractiveConsole)
>>>>> > >>> from django.db import connection
>>>>> > >>> cursor = connection.cursor()
>>>>> > Traceback (most recent call last):
>>>>> >   File "", line 1, in 
>>>>> >   File
>>>>> >
>>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/__init__.py",
>>>>> > line 324, in cursor
>>>>> > cursor = self.make_debug_cursor(self._cursor())
>>>>> >   File
>>>>> >
>>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>>>> > line 306, in _cursor
>>>>> > self._sqlite_create_connection()
>>>>> >   File
>>>>> >
>>>>> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
>>>>> > line 296, in _sqlite_create_connection
>>>>> > self.connection = Database.connect(**kwargs)
>>>>> > OperationalError: unable to open database file
>>>>> > >>>
>>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$ python manage.py
>>>>> validate0
>>>>> > errors found
>>>>> > randy@randy-Inspiron-530s:~/dj/mfp/mysite$
>>>>> >
>>>>> > I suspect my path and have tried several variations
>>>>> >
>>>>> > DATABASES = {
>>>>> > 'default': {
>>>>> >   #  'ENGINE': 'django.db.backends.mysql',
>>>>> > 'ENGINE': 'django.db.backends.sqlite3',
>>>>> >   #  'ENGINE': 'django.db.backends.', # Add
>>>>> 'postgresql_psycopg2',
>>>>> > 'mysql', 'sqlite3' or 'oracle'.
>>>>> > 'NAME': 'C:randy@randy/home/dj/mfp/mysite/mydb.db/', # Or
>>>>> path
>>>>> > to database file if using sqlite3.
>>>>> > # The following settings are not used with sqlite3:
>>>>> > 'USER': '',
>>>>> > 'PASSWORD': '',
>>>>> > 'HOST': '',# Empty for localhost through domain
>>>>> > sockets or '127.0.0.1' for localhost through TCP.
>>>>> > 'PORT': '',  # Set to empty string for
>>>

Re: Chapter 5 problems resolved

2013-07-13 Thread Randy Baxley
  File
> "/usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py",
> line 296, in _sqlite_create_connection
> self.connection = Database.connect(**kwargs)
> OperationalError: unable to open database file
>
> This one is resolved:

1. not sure why but I had to sudo sglite3

2. I changed permissions on the parent directory and everything below it
which did not resolve the problem.

3. I searched on operational error django and in overflow someone said they:

   'NAME': 'C:\\home\dj\mfp\myfile\myfile\mydb.db', # Or path to
database file if using sqlite3.
#'NAME': 'C://home/dj/mfp/myfile/myfile/mydb.db',

which worked and it did for me as well.  They were in Windows and I am in
Xubunto though I do have them installed on the same disk.

Thanks for the help and I am sure I will be back.

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Getting started with django( the new one is confusing , especially first episode)

2013-07-14 Thread Randy Baxley
http://docs.python-guide.org/en/latest/dev/virtualenvs.html

https://github.com/applicationsonline/librarian

http://docs.vagrantup.com/v2/why-vagrant/index.html

Now maybe you can help me by telling me what episode you are refering to?


On Sun, Jul 14, 2013 at 5:05 AM,  wrote:

> What is vagrant ?? how do i set it up,
> what is cheffile?
> what is virtual env???
>
> Please could someone explain these to me.
>
> Cheers!
> Naufal
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: create random string for username

2013-07-20 Thread Randy Baxley
The Django tutorial is not quite making it for me.  This is a very
complicated language and all the pieces seem to not match up for me.  This
I think is my fault and most of it seems to be in the use of the r hat for
root and exactly how that points to views, models and dbs.  I may get there
but it is not easy without someone to be a sort of guide.  Each time though
I go into settings or one of the other files they get a perception of being
more familiar and thus shorter.  While doing some of those I say a key set
to fals for allow profanity but not sure what all that filter has passed
through it.


On Sat, Jul 20, 2013 at 8:20 AM, Tim Chase
wrote:

> On 2013-07-18 20:53, Sivaram R wrote:
> >   While saving these forms instance,is it possible to create a
> > random string for username field.How to do this,any sample would be
> > great choice.
>
> You can.  Assigning random usernames isn't usually considered a very
> nice thing to do to users, but assuming you have a valid use-case
> for it, it's just simple Python:
>
>   import random
>   import string
>   def random_username(characters=string.ascii_lowercase, length=10):
> return ''.join(
>   random.choice(characters)
>   for _ in range(length)
>   )
>
> You might also want to post-process to check for profanity in it, as
> you you don't (usually) want to assign profanity as a username:
>
>   BAD_WORDS = [ ... ] # all in uppercase
>   while True:
> username = random_username()
> normalized_username = random_username.upper()
> for word in BAD_WORDS:
>   if word in normalized_username:
> break
> else: # note this is at the indentation level of the "for", not "if"
>   break
>   print "Username:", username
>
> It's not a perfect check, but it will eliminate the obviously
> problematic ones based on your black-list
>
> -tkc
>
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Learning how to build a web site for my python games and a blog

2013-07-27 Thread Randy Baxley
Is anyone working through The Django Book that would like to form a fb page
just for that or knows of a good tutorial where questions will get answers?

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Learning how to build a web site for my python games and a blog

2013-07-30 Thread Randy Baxley
I am trying to learn Django.  I have a good base in Python having worked 
several basic MOOCs and second level classes.  My major short term goal is 
to build a web site where I will have a blog on smoked brisket in Chicago 
and a place to rewrite my games built in the Rice University course 
Interactive Python Programming from Coursera.  Here is the final program 
from that class.  The reason for a rewrite is these are written on 
CodeSkulptor.

http://www.codeskulptor.org/#user16_nkeTb6O5Je_12.py

Here you will find The Django Book written by *Adrian Holovaty who wrote 
Django.*
*
*
http://www.djangobook.com/en/2.0/frontmatter.html

What I am wondering is if anyone else is working through it as well as I 
keep hitting road blocks and the answers I am getting here are not working 
for me in Xumbunto though that may not be the problem.  I have found that a 
group of folks working at the same time tend to hit on ideas in a fashion 
that is more to the point and on fb that it is easy to get back to the 
thread you want since there are not as many threads pertaining to other 
Django topics.

I was also asking if there is another Django tutorial that might be at more 
of a beginner level? 

On Saturday, July 27, 2013 8:57:45 AM UTC-5, Randy Baxley wrote:
>
> Is anyone working through The Django Book that would like to form a fb 
> page just for that or knows of a good tutorial where questions will get 
> answers?
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Learning how to build a web site for my python games and a blog

2013-07-31 Thread Randy Baxley
These are definitely good suggestions for going deeper in Python and C.  I 
am not real confident that the poll tutorial and vagrant are going to work 
for me though since my current sticking point is getting the NAME fielod to 
point to mydb.  It does something funny with the r hat which may be 
connected to my Xubunto being installed side by side with XP.

On Wednesday, July 31, 2013 5:22:52 AM UTC-5, Cal Leeming [Simplicity Media 
Ltd] wrote:
>
> Try this;
>
> http://learnpythonthehardway.org/book/next.html
> http://gettingstartedwithdjango.com/
>
> Cal
>
> On Tue, Jul 30, 2013 at 3:07 PM, Randy Baxley 
> 
> > wrote:
>
>> I am trying to learn Django.  I have a good base in Python having worked 
>> several basic MOOCs and second level classes.  My major short term goal is 
>> to build a web site where I will have a blog on smoked brisket in Chicago 
>> and a place to rewrite my games built in the Rice University course 
>> Interactive Python Programming from Coursera.  Here is the final program 
>> from that class.  The reason for a rewrite is these are written on 
>> CodeSkulptor.
>>
>> http://www.codeskulptor.org/#user16_nkeTb6O5Je_12.py
>>
>> Here you will find The Django Book written by *Adrian Holovaty who wrote 
>> Django.*
>> *
>> *
>> http://www.djangobook.com/en/2.0/frontmatter.html
>>
>> What I am wondering is if anyone else is working through it as well as I 
>> keep hitting road blocks and the answers I am getting here are not working 
>> for me in Xumbunto though that may not be the problem.  I have found that a 
>> group of folks working at the same time tend to hit on ideas in a fashion 
>> that is more to the point and on fb that it is easy to get back to the 
>> thread you want since there are not as many threads pertaining to other 
>> Django topics.
>>
>> I was also asking if there is another Django tutorial that might be at 
>> more of a beginner level? 
>>
>> On Saturday, July 27, 2013 8:57:45 AM UTC-5, Randy Baxley wrote:
>>>
>>> Is anyone working through The Django Book that would like to form a fb 
>>> page just for that or knows of a good tutorial where questions will get 
>>> answers?
>>>
>>  -- 
>> 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 django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.