Re: Multiple Database Setup

2019-10-30 Thread DANIEL URBANO DE LA RUA
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/

On Wed, 30 Oct 2019, 14:39 Rajat Chopra,  wrote:

> I wish to create a project with 2 apps.  Each app will have its own
> database - one for payments and another for statements.
>
> I have created a set of models within the models.py for the payments app
> and another set of models inside within the models.py for the statements
> app.
>
> When I run the command "python manage.py migrate --database=statements"
> how will Django know to look at the models.py file inside of the statements
> app and create those tables in the statements database ?
>
> In other words where do I put the code that connects the models inside of
> an app (statements/models.py) to the database that those models should be
> created and stored in?
> What would be an example of what this code will look like?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/06bf4cc7-7261-4ac8-95fb-d523528c77e2%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAO_yRT0aZjK%3D0AHU0U2wp1U16%3D1fH5MXx%3D6FpgxX0sVfNDnxeg%40mail.gmail.com.


Multiple Database Setup

2019-10-30 Thread Rajat Chopra
I wish to create a project with 2 apps.  Each app will have its own 
database - one for payments and another for statements. 

I have created a set of models within the models.py for the payments app 
and another set of models inside within the models.py for the statements 
app.

When I run the command "python manage.py migrate --database=statements" how 
will Django know to look at the models.py file inside of the statements app 
and create those tables in the statements database ?   

In other words where do I put the code that connects the models inside of 
an app (statements/models.py) to the database that those models should be 
created and stored in?
What would be an example of what this code will look like?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/06bf4cc7-7261-4ac8-95fb-d523528c77e2%40googlegroups.com.


Re: Database setup

2019-05-13 Thread Devender Kumar
You need to make model for that where managed = false in class meta of the 
model. 
even you can generate complete table model from the db.

On Friday, May 10, 2019 at 8:29:40 PM UTC+5:30, Soumen Khatua wrote:
>
> Hi Folks,
>
> I have one existing table in my database then how I can use the same table 
> in my models.py.
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b72208ad-4983-426b-8de3-664b4ba0a960%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-05-10 Thread Lucas G. Navarro
Hi Soumen, i think that what you need is this  [1]


Regards!

El vie., 10 may. 2019 a las 11:59, Soumen Khatua ()
escribió:

> Hi Folks,
>
> I have one existing table in my database then how I can use the same table
> in my models.py.
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WakznFSEwPXtisj9rz782HEKxEDVE10GC1nNtEL7dGMOg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABomRVUHmLMbMXXhN4bD7WxzgrmmB2Kt2M3A6p7_1nwNk6SdEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Database setup

2019-05-10 Thread Soumen Khatua
Hi Folks,

I have one existing table in my database then how I can use the same table
in my models.py.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WakznFSEwPXtisj9rz782HEKxEDVE10GC1nNtEL7dGMOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-22 Thread Sipum
Hi somen,

Just Open xampp control panel and run apache and mySQL sever.
then go to localhost/phpmyadmin in browser and there create a database as u 
do for php.

then in search DATABASE in settings.py file (which would be created when u 
create a project in django) do the below changes -
 
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'webapp', --> name of db which u created b4
'USER': 'root',--> user is root 
'PASSWORD': '',   > it is pasword less
'HOST': '127.0.0.1',---> this is for local host
'PORT': '3306',   > this port number u will get 
from xampp control panel where u start MYSQL
}


Hope it will help... Njoy



On Saturday, 20 April 2019 09:52:05 UTC+5:30, Soumen Khatua wrote:
>
> Hi Folks,
> How can I configure xampp server provided mysql database in django.
>
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b941ec4c-d348-4ce6-80de-bd433893b0b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-20 Thread Okware Aldo
So if you launch xampp and you are sure all the services are running.
services (Apache, MySQL, and PHP), xampp also ships with phpmyadmin a mysql
webbased interface. which you can launch by typing `localhost/phpmyadmin`
in any browser of choice.

Once the PHPMyAdmin interface is launched. using this tool you can create a
MySQL DB, create a user with password and attach the user to that database

if you have a database already you could use the default root user for
MySQL, there is usually no password. so you username: root and password
would be blank, I don't recommend this, it's not a good practice.

https://www.youtube.com/watch?v=1-81n_vuwug

On Fri, Apr 19, 2019 at 10:58 PM Soumen Khatua 
wrote:

> Yes I already install xampp server but what will be my password? Actually
> for development purpose xampp server not accept any password, I guess!!
>
>
> Thank you for your valuable time.
>
> On Sat, 20 Apr 2019, 10:48 Okware Aldo,  wrote:
>
>> Hey, If you have xampp installed, just create a database using
>> phpmyadmin, attach a user to that database.
>> then ensure you have a driver package installed and setup for django. eg.
>> pymsql has worked well for.
>> then make the necessary changes in django settings file.
>>
>>
>> On Fri, Apr 19, 2019 at 9:21 PM Soumen Khatua 
>> wrote:
>>
>>> Hi Folks,
>>> How can I configure xampp server provided mysql database in django.
>>>
>>> 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZ9FfDQi2dewUuL4W%2BV9XEsafK4Fmp-XiV72ySyNdYZGw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMEZma9ypAVxv%3DfMMs%2B0Q3CtzdoUNxC06M1t8QiT19s4-iE7Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-19 Thread Soumen Khatua
Yes I already install xampp server but what will be my password? Actually
for development purpose xampp server not accept any password, I guess!!


Thank you for your valuable time.

On Sat, 20 Apr 2019, 10:48 Okware Aldo,  wrote:

> Hey, If you have xampp installed, just create a database using phpmyadmin,
> attach a user to that database.
> then ensure you have a driver package installed and setup for django. eg.
> pymsql has worked well for.
> then make the necessary changes in django settings file.
>
>
> On Fri, Apr 19, 2019 at 9:21 PM Soumen Khatua 
> wrote:
>
>> Hi Folks,
>> How can I configure xampp server provided mysql database in django.
>>
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WZ9FfDQi2dewUuL4W%2BV9XEsafK4Fmp-XiV72ySyNdYZGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup

2019-04-19 Thread Okware Aldo
Hey, If you have xampp installed, just create a database using phpmyadmin,
attach a user to that database.
then ensure you have a driver package installed and setup for django. eg.
pymsql has worked well for.
then make the necessary changes in django settings file.


On Fri, Apr 19, 2019 at 9:21 PM Soumen Khatua 
wrote:

> Hi Folks,
> How can I configure xampp server provided mysql database in django.
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMEZma_4bR_yUbUTWJCB_JhmRXWqEHpgzGzQp24qCCr%3DG%3DjQvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Database setup

2019-04-19 Thread Soumen Khatua
Hi Folks,
How can I configure xampp server provided mysql database in django.

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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple Database Setup problem !?

2018-11-02 Thread 'Tom Evans' via Django users
Hi David

Your router isn't configured correctly. This applies to all the
allow_foo() methods, but see allow_migrate [1] as an example:

  Determine if the migration operation is allowed to run on the
database with alias db. Return True if the operation should run, False
if it shouldn’t run, or None if the router has no opinion.

Your routers *should* be having an opinion about whether that
app/model can be migrated on a specific database! For instance, you
say "the last app" should stay only on validations, but what your
ValidationRouter says is "If the app label is called fourth_model, run
migrations on this database", but it never checks what the database
is.

For ValidationRouter.allow_migrate you probably want something like this:

  def allow_migrate(self, ...):
  if app_label == "fourth_model":
  return db == "validations"
  elif db == "validations":
  return False

EG:
* if the app label is an app that should be in the validations DB,
allow migrate when the db is the validations DB
* if it isn't and the DB is the validations DB, don't allow migrations to it
* if neither of those things, this router doesn't care.

Similarly, for allow_relations() you should be returning False when
the models should not be related.

Incidentally, all python functions return None if the end of the
function is reached without an explicit return value, so you never
have to end your functions with an explicit "return None".

Cheers

Tom

[1] https://docs.djangoproject.com/en/2.1/topics/db/multi-db/#allow_migrate
On Tue, Oct 30, 2018 at 10:09 AM David Lubomirov
 wrote:
>
> Hello,
>
> In my project I have 3 applications, and I'm trying to split them across 2 
> databases.
>
> More specifically 2 of the apps and Django "auth" application should work 
> with the first database,
> and the last application should remain in the second database.
>
> These are the DB settings:
>
> DATABASE_ROUTERS = [
> '.PrimaryRouter',
> '.ValidationRouter'
> ]
>
> DATABASES = {
> 'default': {},
> 'primary': {
> 'NAME': 'primary',
> 'ENGINE': 'django.db.backends.postgresql',
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': 'localhost',
> },
> 'validations': {
> 'NAME': 'validations',
> 'ENGINE': 'django.db.backends.postgresql',
> 'USER': '',
> 'PASSWORD': '',
> 'HOST': 'localhost',
> }
> }
>
> Therefore these are the class routers:
>
> class PrimaryRouter:
> """
> Router to control all database operations for the following applications:
> - first_model
> - second_model
> - auth
> """
> def db_for_read(self, model, **hints):
> if model._meta.app_label == 'auth' or \
> model._meta.app_label == 'first_model' or \
> model._meta.app_label == 'second_model':
>
> return 'primary'
>
> return None
>
> def db_for_write(self, model, **hints):
> if model._meta.app_label == 'auth' or \
> model._meta.app_label == 'first_model' or \
> model._meta.app_label == 'second_model':
>
> return 'primary'
>
> return None
>
> def allow_relation(self, first_object, second_object, **hints):
> if first_object._meta.app_label == 'auth' or \
> second_object._meta.app_label == 'auth':
>
> return True
>
> if first_object._meta.app_label == 'first_model' or \
> second_object._meta.app_label == 'first_model':
>
> return True
>
> if first_object._meta.app_label == 'second_model' or \
> second_object._meta.app_label == 'second_model':
>
> return True
>
> return None
>
> def allow_migrate(self, db, app_label, model_name=None, **hints):
> if app_label == 'auth' or \
> app_label == 'first_model' or \
> app_label == 'second_model':
>
> return db == 'primary'
>
> return None
>
>
> class ValidationRouter:
> """
> Router to control all database operations for the following applications:
> - fourth_model
> """
> def db_for_read(self, model, **hints):
> if model._meta.app_label == 'fourth_model':
> return 'validations'
>
> return None
>
> def db_for_write(self, model, **hints):
> if model._meta.app_label == 'fourth_model':
> return 'validations'
>
> return None
>
> def allow_relation(self, first_object, second_object, **hints):
> if first_object._meta.app_label == 'fourth_model' or \
> second_object._meta.app_label == 'fourth_model':
> return True
>
> return None
>
> def allow_migrate(self, db, app_label, model_name=None, **hints):
> if app_label == 'fourth_model':
> return True
>
> return None
>
>
> When I run migration on the first database "primary", everything is working.
> But on the second database I'm getting 

Multiple Database Setup problem !?

2018-10-30 Thread David Lubomirov
Hello,

In my project I have 3 applications, and I'm trying to split them across 2 
databases.

More specifically 2 of the apps and Django "auth" application should work 
with the first database,
and the last application should remain in the second database.

These are the DB settings:

DATABASE_ROUTERS = [
'.PrimaryRouter',
'.ValidationRouter'
]

DATABASES = {
'default': {},
'primary': {
'NAME': 'primary',
'ENGINE': 'django.db.backends.postgresql',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
},
'validations': {
'NAME': 'validations',
'ENGINE': 'django.db.backends.postgresql',
'USER': '',
'PASSWORD': '',
'HOST': 'localhost',
}
} 

Therefore these are the class routers:

class PrimaryRouter:
"""
Router to control all database operations for the following 
applications:
- first_model
- second_model
- auth
"""
def db_for_read(self, model, **hints):
if model._meta.app_label == 'auth' or \
model._meta.app_label == 'first_model' or \
model._meta.app_label == 'second_model':

return 'primary'

return None

def db_for_write(self, model, **hints):
if model._meta.app_label == 'auth' or \
model._meta.app_label == 'first_model' or \
model._meta.app_label == 'second_model':

return 'primary'

return None

def allow_relation(self, first_object, second_object, **hints):
if first_object._meta.app_label == 'auth' or \
second_object._meta.app_label == 'auth':

return True

if first_object._meta.app_label == 'first_model' or \
second_object._meta.app_label == 'first_model':

return True

if first_object._meta.app_label == 'second_model' or \
second_object._meta.app_label == 'second_model':

return True

return None

def allow_migrate(self, db, app_label, model_name=None, **hints):
if app_label == 'auth' or \
app_label == 'first_model' or \
app_label == 'second_model':

return db == 'primary'

return None


class ValidationRouter:
"""
Router to control all database operations for the following 
applications:
- fourth_model
"""
def db_for_read(self, model, **hints):
if model._meta.app_label == 'fourth_model':
return 'validations'

return None

def db_for_write(self, model, **hints):
if model._meta.app_label == 'fourth_model':
return 'validations'

return None

def allow_relation(self, first_object, second_object, **hints):
if first_object._meta.app_label == 'fourth_model' or \
second_object._meta.app_label == 'fourth_model':
return True

return None

def allow_migrate(self, db, app_label, model_name=None, **hints):
if app_label == 'fourth_model':
return True

return None


When I run migration on the first database "primary", everything is working.
But on the second database I'm getting the following exception:


django.db.utils.ProgrammingError: relation "auth_user" does not exist


*The question *- do I need to also specify the "auth" Django application in 
the second DB router "validations",
or there's something wrong with my setup ?

According to Django docs for version 2.1, this kind of setup is working 
- https://docs.djangoproject.com/en/2.1/topics/db/multi-db/ .

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8eef7cfe-93ed-4322-ab84-09261e27f460%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-28 Thread Cai Gengyang


Hey guys, I am happy to announce that it finally works. The problem was 
that there was an additional 'qq' in my settings.py file on line 44.(no 
idea how it got there) I have posted my entire input / output here for 
viewing and discussion ...



CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls

manage.py mysite

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate

*Operations to perform:*

*  Synchronize unmigrated apps: *staticfiles, messages

*  Apply all migrations: *admin, contenttypes, auth, sessions

*Synchronizing apps without migrations:*

  Creating tables...

Running deferred SQL...

  Installing custom SQL...

*Running migrations:*

  Rendering model states...* DONE*

  Applying contenttypes.0001_initial...* OK*

  Applying auth.0001_initial...* OK*

  Applying admin.0001_initial...* OK*

  Applying contenttypes.0002_remove_content_type_name...* OK*

  Applying auth.0002_alter_permission_name_max_length...* OK*

  Applying auth.0003_alter_user_email_max_length...* OK*

  Applying auth.0004_alter_user_username_opts...* OK*

  Applying auth.0005_alter_user_last_login_null...* OK*

  Applying auth.0006_require_contenttypes_0002...* OK*

  Applying sessions.0001_initial...* OK*

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 
On Monday, September 28, 2015 at 1:50:18 PM UTC+8, Thomas wrote:
>
>
> On Sep 27, 2015, at 06:04, Cai Gengyang  
> wrote:
>
> This is my entire settings.py file
> …
>
>
> I’m not seeing the problem, but it is certainly there somewhere.
>
> Try removing pieces of the settings file until you can isolate the syntax 
> problem which is likely on or before line 45. Copy the original one aside 
> so you can go back to it and repair the problem once you figure out where 
> it is.
>
> hth
>
> - Tom
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/45e61d73-4bc8-4a95-a12f-3082f770a692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Tom Lockhart

> On Sep 27, 2015, at 06:04, Cai Gengyang  wrote:
> 
> This is my entire settings.py file
> 
> …

I’m not seeing the problem, but it is certainly there somewhere.

Try removing pieces of the settings file until you can isolate the syntax 
problem which is likely on or before line 45. Copy the original one aside so 
you can go back to it and repair the problem once you figure out where it is.

hth

- Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7A42C6CC-7DCE-4C0F-B7D2-6CA67C9F09D6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Cai Gengyang


This is my entire settings.py file


"""

Django settings for mysite project.


Generated by 'django-admin startproject' using Django 1.8.4.


For more information on this file, see

https://docs.djangoproject.com/en/1.8/topics/settings/


For the full list of settings and their values, see

https://docs.djangoproject.com/en/1.8/ref/settings/

"""


# Build paths inside the project like this: os.path.join(BASE_DIR, ...)

import os


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))



# Quick-start development settings - unsuitable for production

# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/


# SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = '6d9q_36l6ka7pkt=e1-r*ze_!tx0bst1i1^!6khpn19yj20^sg'


# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True


ALLOWED_HOSTS = []



# Application definition


INSTALLED_APPS = (

'django.contrib.admin',

'django.contrib.auth',

'django.contrib.contenttypes',

'django.contrib.sessions',

'django.contrib.messages',

'django.contrib.staticfiles',

)


MIDDLEWARE_CLASSES = (

'django.contrib.sessions.middleware.SessionMiddleware',

'django.middleware.common.CommonMiddleware',

'django.middleware.csrf.CsrfViewMiddleware',

'django.contrib.auth.middleware.AuthenticationMiddleware',

'django.contrib.auth.middleware.SessionAuthenticationMiddleware',

'django.contrib.messages.middleware.MessageMiddleware',

'django.middleware.clickjacking.XFrameOptionsMiddleware',

'django.middleware.security.SecurityMiddleware',

)


ROOT_URLCONF = 'mysite.urls'


TEMPLATES = [

{

'BACKEND': 'django.template.backends.django.DjangoTemplates',

'DIRS': [],

'APP_DIRS': True,

'OPTIONS': {

'context_processors': [

'django.template.context_processors.debug',

'django.template.context_processors.request',

'django.contrib.auth.context_processors.auth',

'django.contrib.messages.context_processors.messages',

],

},

},

]


WSGI_APPLICATION = 'mysite.wsgi.application'



# Database

# https://docs.djangoproject.com/en/1.8/ref/settings/#databases


DATABASES = {

'default': {

'ENGINE': 'django.db.backends.sqlite3',

'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),

}

}



# Internationalization

# https://docs.djangoproject.com/en/1.8/topics/i18n/


LANGUAGE_CODE = 'en-us'


TIME_ZONE = 'UTC'


USE_I18N = True


USE_L10N = True


USE_TZ = True



# Static files (CSS, JavaScript, Images)

# https://docs.djangoproject.com/en/1.8/howto/static-files/


STATIC_URL = '/static/'

On Sunday, September 27, 2015 at 8:34:35 PM UTC+8, Thomas wrote:
>
>
> On Sep 27, 2015, at 05:26, Cai Gengyang  
> wrote:
>
> Hi Tom,
>
> Following your latest instructions , I have posted my input and output 
> results here. Still getting an error message though it is a different one 
> this time ( a traceback error )
>
>
> Oh, much better :)
>
> You are now seeing a typo in your settings.py file. Without seeing more of 
> the file I can not guess at the exact place with the error, but perhaps you 
> have an extra or a missing single quote character in a preceeding line in 
> the file??
>
> hth
>
> - Tom
>
>
>
> CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder
>
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls
>
> manage.py mysite
>
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate
>
> Traceback (most recent call last):
>
>   File "manage.py", line 10, in 
>
> execute_from_command_line(sys.argv)
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 338, in execute_from_command_line
>
> utility.execute()
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>  
> line 303, in execute
>
> settings.INSTALLED_APPS
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  
> line 48, in __getattr__
>
> self._setup(name)
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  
> line 44, in _setup
>
> self._wrapped = Settings(settings_module)
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  
> line 92, in __init__
>
> mod = importlib.import_module(self.SETTINGS_MODULE)
>
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
>  
> line 37, in import_module
>
> __import__(name)
>
>   File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45
>
> 'django.middleware.csrf.CsrfViewMiddleware',
>
>

Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Gergely Polonkai
Hello,

that message is clear: line 45 in your settings.py has a syntax error. That
line, however, seem OK, so I guess the previous one is that; maybe a comma
is missing.

Best,
Gergely
On 27 Sep 2015 14:26, "Cai Gengyang"  wrote:

> Hi Tom,
>
> Following your latest instructions , I have posted my input and output
> results here. Still getting an error message though it is a different one
> this time ( a traceback error )
>
> CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder
>
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls
>
> manage.py mysite
>
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate
>
> Traceback (most recent call last):
>
>   File "manage.py", line 10, in 
>
> execute_from_command_line(sys.argv)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 338, in execute_from_command_line
>
> utility.execute()
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 303, in execute
>
> settings.INSTALLED_APPS
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
> line 48, in __getattr__
>
> self._setup(name)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
> line 44, in _setup
>
> self._wrapped = Settings(settings_module)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
> line 92, in __init__
>
> mod = importlib.import_module(self.SETTINGS_MODULE)
>
>   File
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
> line 37, in import_module
>
> __import__(name)
>
>   File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45
>
> 'django.middleware.csrf.CsrfViewMiddleware',
>
>   ^
>
> SyntaxError: invalid syntax
>
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$
>
>
>
> On Sunday, September 27, 2015 at 7:51:51 PM UTC+8, Thomas wrote:
>>
>>
>> > On Sep 27, 2015, at 04:39, Cai Gengyang  wrote:
>> >
>> > Hi Tom,
>> > So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite
>> folder ---> manage.py file. (using a Mac OS X Yosemite Version 10.10.2)
>> > This puts me in the same directory as the manage.py file.
>> > Then I key in the command  : $ python manage.py migrate
>>
>> The command must be typed from a terminal window, and afaik Finder has no
>> influence on the current working directory in that window.
>>
>> Use the Terminal app to open a command line window, then use “cd” or
>> “pushd” to go to “mysite folder” within that terminal window.
>>
>> If that is done correctly, then you should be able to type “ls” and see
>> manage.py in the resulting listing. Then try typing the python command
>> above.
>>
>> btw, I would strongly recommend using virtualenv for developing on your
>> Mac (and on any other system). There are many references to that in this
>> mailing list; do a google search to find a procedure for doing this.
>>
>> hth
>>
>> - Tom
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/278af114-1a2e-4c4b-ab90-f2c4814d7f4e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACczBULz2y%3D3VRY1SDoE%3DVZE0nQnYUDbmfiu2UJkurY2K79YiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Tom Lockhart

> On Sep 27, 2015, at 05:26, Cai Gengyang  wrote:
> 
> Hi Tom,
> 
> Following your latest instructions , I have posted my input and output 
> results here. Still getting an error message though it is a different one 
> this time ( a traceback error )

Oh, much better :)

You are now seeing a typo in your settings.py file. Without seeing more of the 
file I can not guess at the exact place with the error, but perhaps you have an 
extra or a missing single quote character in a preceeding line in the file??

hth

- Tom


> 
> CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder
> 
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls
> 
> manage.py mysite
> 
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate
> 
> Traceback (most recent call last):
> 
>   File "manage.py", line 10, in 
> 
> execute_from_command_line(sys.argv)
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 338, in execute_from_command_line
> 
> utility.execute()
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
>  line 303, in execute
> 
> settings.INSTALLED_APPS
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  line 48, in __getattr__
> 
> self._setup(name)
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  line 44, in _setup
> 
> self._wrapped = Settings(settings_module)
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
>  line 92, in __init__
> 
> mod = importlib.import_module(self.SETTINGS_MODULE)
> 
>   File 
> "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
>  line 37, in import_module
> 
> __import__(name)
> 
>   File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45
> 
> 'django.middleware.csrf.CsrfViewMiddleware',
> 
>   ^
> 
> SyntaxError: invalid syntax
> 
> CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 
> 
> 
> 
> 
> 
> On Sunday, September 27, 2015 at 7:51:51 PM UTC+8, Thomas wrote:
> 
> > On Sep 27, 2015, at 04:39, Cai Gengyang gmail.com 
> > > wrote: 
> > 
> > Hi Tom, 
> > So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite 
> > folder ---> manage.py file. (using a Mac OS X Yosemite Version 10.10.2) 
> > This puts me in the same directory as the manage.py file. 
> > Then I key in the command  : $ python manage.py migrate 
> 
> The command must be typed from a terminal window, and afaik Finder has no 
> influence on the current working directory in that window. 
> 
> Use the Terminal app to open a command line window, then use “cd” or “pushd” 
> to go to “mysite folder” within that terminal window. 
> 
> If that is done correctly, then you should be able to type “ls” and see 
> manage.py in the resulting listing. Then try typing the python command above. 
> 
> btw, I would strongly recommend using virtualenv for developing on your Mac 
> (and on any other system). There are many references to that in this mailing 
> list; do a google search to find a procedure for doing this.
> 
> hth 
> 
> - Tom
> 
> -- 
> 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 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/278af114-1a2e-4c4b-ab90-f2c4814d7f4e%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/BBB8DAA7-9914-4536-8BED-D639F3DD0D57%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Cai Gengyang
Hi Tom,

Following your latest instructions , I have posted my input and output 
results here. Still getting an error message though it is a different one 
this time ( a traceback error )

CaiGengYangs-MacBook-Pro:~ CaiGengYang$ cd mysite folder

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ ls

manage.py mysite

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ python manage.py migrate

Traceback (most recent call last):

  File "manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 338, in execute_from_command_line

utility.execute()

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 303, in execute

settings.INSTALLED_APPS

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 48, in __getattr__

self._setup(name)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 44, in _setup

self._wrapped = Settings(settings_module)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/__init__.py",
 
line 92, in __init__

mod = importlib.import_module(self.SETTINGS_MODULE)

  File 
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py",
 
line 37, in import_module

__import__(name)

  File "/Users/CaiGengYang/mysite/mysite/settings.py", line 45

'django.middleware.csrf.CsrfViewMiddleware',

  ^

SyntaxError: invalid syntax

CaiGengYangs-MacBook-Pro:mysite CaiGengYang$ 



On Sunday, September 27, 2015 at 7:51:51 PM UTC+8, Thomas wrote:
>
>
> > On Sep 27, 2015, at 04:39, Cai Gengyang  > wrote: 
> > 
> > Hi Tom, 
> > So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite 
> folder ---> manage.py file. (using a Mac OS X Yosemite Version 10.10.2) 
> > This puts me in the same directory as the manage.py file. 
> > Then I key in the command  : $ python manage.py migrate 
>
> The command must be typed from a terminal window, and afaik Finder has no 
> influence on the current working directory in that window. 
>
> Use the Terminal app to open a command line window, then use “cd” or 
> “pushd” to go to “mysite folder” within that terminal window. 
>
> If that is done correctly, then you should be able to type “ls” and see 
> manage.py in the resulting listing. Then try typing the python command 
> above. 
>
> btw, I would strongly recommend using virtualenv for developing on your 
> Mac (and on any other system). There are many references to that in this 
> mailing list; do a google search to find a procedure for doing this. 
>
> hth 
>
> - Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/278af114-1a2e-4c4b-ab90-f2c4814d7f4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Tom Lockhart

> On Sep 27, 2015, at 04:39, Cai Gengyang  wrote:
> 
> Hi Tom,
> So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite folder 
> ---> manage.py file. (using a Mac OS X Yosemite Version 10.10.2)
> This puts me in the same directory as the manage.py file.
> Then I key in the command  : $ python manage.py migrate

The command must be typed from a terminal window, and afaik Finder has no 
influence on the current working directory in that window.

Use the Terminal app to open a command line window, then use “cd” or “pushd” to 
go to “mysite folder” within that terminal window.

If that is done correctly, then you should be able to type “ls” and see 
manage.py in the resulting listing. Then try typing the python command above.

btw, I would strongly recommend using virtualenv for developing on your Mac 
(and on any other system). There are many references to that in this mailing 
list; do a google search to find a procedure for doing this.

hth

- Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/C37BDA8F-208C-4656-9C25-68479B07C444%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Cai Gengyang
Hi Tom,


So I click on Finder ---> Go ---> Home ---> 'Weiqi' folder ---> mysite 
folder ---> manage.py file. (using a Mac OS X Yosemite Version 10.10.2)

This puts me in the same directory as the manage.py file.

Then I key in the command  : $ python manage.py migrate, but I still get 
the same error message 

CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate --- 
input


/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
 
can't open file 'manage.py': [Errno 2] No such file or directory --- output 


Not sure where I am doing this wrongly ... zzz



Gengyang



On Sunday, September 27, 2015 at 7:12:54 PM UTC+8, Thomas wrote:
>
> > … 
> > However, when I try to run the following command : $ python manage.py 
> migrate to create the tables in the database, 
> > CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate 
>  input 
> > I get the following error message : 
> > 
> /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
>  
> can't open file 'manage.py': [Errno 2] No such file or directory  
> output 
>
> You need to be in the same directory as the file manage.py for the command 
> to work. For Django-1.8 that is likely to be one level above your 
> settings.py file. 
>
> hth 
>
> - Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/893c0597-de55-4f0a-94d7-829bcc76b3cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Tutorial(Database Setup Question)

2015-09-27 Thread Tom Lockhart
> …
> However, when I try to run the following command : $ python manage.py migrate 
> to create the tables in the database,
> CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate  
> input
> I get the following error message :
> /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
>  can't open file 'manage.py': [Errno 2] No such file or directory  output

You need to be in the same directory as the file manage.py for the command to 
work. For Django-1.8 that is likely to be one level above your settings.py file.

hth

- Tom

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/EB6F90BA-E19B-4A79-9DF0-3466F4C2AC6C%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Tutorial(Database Setup Question)

2015-09-27 Thread Cai Gengyang

Hello all !

So I am going through the (Database setup) chapter of this tutorial 
(https://docs.djangoproject.com/en/1.8/intro/tutorial01/) --- Its the 
section right after the first chapter on "Creating a project"


I opened up mysite/settings.py as per the instructions on the Django 
tutorial.


However, when I try to run the following command : $ python manage.py 
migrate to create the tables in the database,


CaiGengYangs-MacBook-Pro:Weiqi CaiGengYang$ python manage.py migrate  
input


I get the following error message :


/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python:
 
can't open file 'manage.py': [Errno 2] No such file or directory  output


Any idea how to solve this issue?


Thanks a lot !


Gengyang

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/774360f5-c240-40f9-8d61-80e11899ff8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Database setup Issue

2013-03-21 Thread Antoni Aloy
You have to create first the database in Postgresql, give it a name and a
password, and configure it to allow connections. Then you have to configure
the database settings with the database name, ip, user and password.

If you're doing the tutorial is much better to stay in sqlite3, so you'll
have less noise and you could focus on the tutorial itself.


2013/3/21 Kamalakannan Srinivasan 

> Hi,
>
> I installed PostgreSQL 8.4.16 and was trying to set up the database as
> specified in the tutorial under djangoproject.com. I gave the Engine name
> as 'django.db.backends.postgresql_psycopg2' and Name as 'PostgreSQL' and
> ran the python manage.py syncdb command. But it gave the error 'database
> PostgreSQL' does not exist.
>
> I even gave the name in different ways - in caps, in small cases,
> suffixing version number etc. But everything returned similar errors.
>
> Please help with a workaround.
>
> Thanks and regards,
> Kamal
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Database setup Issue

2013-03-21 Thread Kamalakannan Srinivasan
Hi,
 
I installed PostgreSQL 8.4.16 and was trying to set up the database as 
specified in the tutorial under djangoproject.com. I gave the Engine name 
as 'django.db.backends.postgresql_psycopg2' and Name as 'PostgreSQL' and 
ran the python manage.py syncdb command. But it gave the error 'database 
PostgreSQL' does not exist.
 
I even gave the name in different ways - in caps, in small cases, suffixing 
version number etc. But everything returned similar errors.
 
Please help with a workaround.
 
Thanks and regards,
Kamal

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Database setup

2012-10-30 Thread Jirka Vejrazka
Hi Markus,

  I don't think you mentioned what OS you use on your machine with Django.

  If it helps, I had this in my settings.py when connecting to MS SQL
database from Linux

'mssql': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'mdb',
'USER': USERNAME,
'PASSWORD': PASSWORD,
'OPTIONS': {
'driver': 'FreeTDS',
'encoding': 'latin1',  # see django-pyodbc issue #24
# UAPM uses SQL_Latin1_General_CP1_CI_AS
'dsn': 'mssql', # see /etc/odbc.ini
},

  There was some extra client libraries installed and a configuration
had to be do be done for system ODBC. Can't help you there, memory
failing :)

  HTH

   Jirka

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database setup

2012-10-30 Thread Markus Christen

>
> What i know now:
>  
>
-- 

>  
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'baan5c',
> 'USER': '***',
> 'PASSWORD': '*',
> 'HOST': 'MAURITIUS',
> 'PORT': '1433',
> }
> }
>
-- 

>  
> This will works, if my DB is a mysql. But I use MsSql.
> The pyodbc is installed and i made connects over it, to the DB. But for 
> settings.py, i cant find the base.py of this pyodbc.
> Any idea where i can find it?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/-SD8TV-mOV4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database setup

2012-10-29 Thread Tom Evans
On Mon, Oct 29, 2012 at 3:54 PM, Onyx Fields
<tenfingerguillot...@gmail.com> wrote:
> I wish I could help as well, but I just started with the tutorial (HERE),
> and I am not following the Database Setup either.  Perhaps someone who is
> more familiar with it could explain it in layman's terms for a noob like
> myself?
>

Are you also trying to set up an ODBC connection to Lotus Notes? If
not ,starting a thread about your own issues would be more
appropriate.

Cheers

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 unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database setup

2012-10-29 Thread Onyx Fields
I wish I could help as well, but I just started with the tutorial 
(HERE<https://docs.djangoproject.com/en/1.4/intro/tutorial01/>), 
and I am not following the Database Setup either.  Perhaps someone who is 
more familiar with it could explain it in layman's terms for a noob like 
myself?

On Monday, October 29, 2012 1:40:01 AM UTC-7, Markus Christen wrote:
>
> Good Morning
> First i made an odbc connect liek this:
>  
> -
> import pyodbc
> cnxn = pyodbc.connect('DRIVER={SQL 
> Server};SERVER=MAURITIUS;DATABASE=baan5c;UID=***;PWD=*')
> cursor = cnxn.cursor()
> cursor.execute("SELECT x.t_name, y.t_mail FROM tttaad20 as x, 
> tttcmf20 as y WHERE (x.t_name = y.t_name) AND (x.t_user = 'muster')")
> row = cursor.fetchall()
> if row:
>  print row
> 
> This gave me out the correct data (name + e-mail) from a user.
> I tryed now to use this database in the Admin site, but i'm to stupid to 
> implements this correct into the Database Setup.
> The server is not on my computer, it is in the same LAN
>  
> Can someone help me please?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/bzVq0jZqI4oJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database setup

2012-10-29 Thread Markus Christen
EDIT:
I have a second to implements. Its a Lotus Notes DB, and for the userauth 
there is a file on my computer.
I tryed it with  the odbc of IBM:
 
---
import pyodbc
conn = pyodbc.connect('DRIVER={Lotus Notes SQL Driver 
(*.nsf)};SERVER=Wind/Sefar;DATABASE=Kopie_SCHSales.nsf;UID=***/M/CHTHA/Sefar;PWD=*');
---
 
I can connect, but i cant read out data, thats my i try with this Admin 
Site.
Do someone know how to implements?
I know how to make Multiple DB's...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/uyf5Zc1AhB8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Database setup

2012-10-29 Thread Markus Christen
Good Morning
First i made an odbc connect liek this:
 
-
import pyodbc
cnxn = pyodbc.connect('DRIVER={SQL 
Server};SERVER=MAURITIUS;DATABASE=baan5c;UID=***;PWD=*')
cursor = cnxn.cursor()
cursor.execute("SELECT x.t_name, y.t_mail FROM tttaad20 as x, 
tttcmf20 as y WHERE (x.t_name = y.t_name) AND (x.t_user = 'muster')")
row = cursor.fetchall()
if row:
 print row

This gave me out the correct data (name + e-mail) from a user.
I tryed now to use this database in the Admin site, but i'm to stupid to 
implements this correct into the Database Setup.
The server is not on my computer, it is in the same LAN
 
Can someone help me please?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/a8cnBtTu1RYJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-27 Thread Sithembewena Lloyd Dube
Thanks Everett!

On Sat, Oct 23, 2010 at 4:24 AM, Everett  wrote:

> Thanks everyone for all your help! I found a binary for Python 2.7
> Here's a the link: http://www.codegood.com/archives/129
> Just in case someone stumbles upon these posts.
>
> On Oct 16, 3:58 pm, Karen Tracey  wrote:
> > 2010/10/16 Jonathan Barratt 
> >
> > > Hope you have visual studio installed! :p
> >
> > If you do not, or if you do not want to go to the trouble of building
> > MySQLdb from source, it is usually possible to find Windows binary
> packages
> > for MySQLdb by searching Google with terms like:
> >
> > mysqldb windows binaries python 2.7
> >
> > I have never built MySQLdb from scratch on Windows, I've always used
> > pre-built binaries. (Though I have also not yet bothered to find binaries
> > for Python 2.7...I have Windows boxes and use them for testing Django but
> I
> > do not actually do any Django development on them, and I have not had
> time
> > lately to do much Windows testing.)
> >
> > Karen
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-22 Thread Everett
Thanks everyone for all your help! I found a binary for Python 2.7
Here's a the link: http://www.codegood.com/archives/129
Just in case someone stumbles upon these posts.

On Oct 16, 3:58 pm, Karen Tracey  wrote:
> 2010/10/16 Jonathan Barratt 
>
> > Hope you have visual studio installed! :p
>
> If you do not, or if you do not want to go to the trouble of building
> MySQLdb from source, it is usually possible to find Windows binary packages
> for MySQLdb by searching Google with terms like:
>
> mysqldb windows binaries python 2.7
>
> I have never built MySQLdb from scratch on Windows, I've always used
> pre-built binaries. (Though I have also not yet bothered to find binaries
> for Python 2.7...I have Windows boxes and use them for testing Django but I
> do not actually do any Django development on them, and I have not had time
> lately to do much Windows testing.)
>
> Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-16 Thread Karen Tracey
2010/10/16 Jonathan Barratt 

> Hope you have visual studio installed! :p


If you do not, or if you do not want to go to the trouble of building
MySQLdb from source, it is usually possible to find Windows binary packages
for MySQLdb by searching Google with terms like:

mysqldb windows binaries python 2.7

I have never built MySQLdb from scratch on Windows, I've always used
pre-built binaries. (Though I have also not yet bothered to find binaries
for Python 2.7...I have Windows boxes and use them for testing Django but I
do not actually do any Django development on them, and I have not had time
lately to do much Windows testing.)

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-16 Thread Jonathan Barratt

On 17 ?.?. 2010, at 0:03, Everett wrote:

> Ok...I'm confused nowdo I have to build the bindings or just copy
> them into the site-packages directory?

I'm not sure this advice:

>> I recall having a similar problem. Get the MySQL bindings appropriate to
>> your Python version below and install to your site-packages folder:
>> 
>> http://sourceforge.net/projects/mysql-python/

Was taking into account the fact that your OS is Windows - it's not a simple 
install to site-packages for you I'm afraid...

I don't have a windows machine, and am using postgres with Django myself, but I 
did some digging for you on the project's forums and found this link which 
looks like it does the trick:

http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions

Hope you have visual studio installed! :p

Good luck!
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-16 Thread Everett
Ok...I'm confused nowdo I have to build the bindings or just copy
them into the site-packages directory?

On Oct 14, 4:26 am, Sithembewena Lloyd Dube  wrote:
> I recall having a similar problem. Get the MySQL bindings appropriate to
> your Python version below and install to your site-packages folder:
>
> http://sourceforge.net/projects/mysql-python/
>
> 2010/10/13 Everett 
>
>
>
>
>
>
>
> > On Oct 13, 2:34 am, Jonathan Barratt 
> > wrote:
> > > On 13 ต.ค. 2010, at 10:19, Everett wrote:
>
> > > > I'm running Django on Windows. When I edited the settings.py file for
> > > > the MySql database I'm running in an XAMPP package, the Django
> > > > development server throws a bunch of unhandled exceptions. It starts
> > > > out like this:
>
> > > 
>
> > > The most useful error message will be the last entry in the traceback
> > rather than the start of it. Please provide that message and we may have
> > more to go on.
>
> > > > Is this because of how I'm running the MySQL database? Or the
> > > > information in the settings.py file is off? Cause when I take all the
> > > > database settings out of the settings.py file the development server
> > > > runs fine.
>
> > > If there are no DB settings then obviously Django doesn't try to talk to
> > the DB, so yes that does suggest the problem is in the Django-DB
> > interaction.
>
> > > 
>
> > > > Any ideas?
>
> > > The first idea that pops into my head is that you may not have Python's
> > MySQL bindings installed (perhttp://
> > docs.djangoproject.com/en/dev/topics/install/#get-your-databas...), which
> > is available athttp://sourceforge.net/projects/mysql-python/
>
> > > If do already have that package installed then we'll just have to see the
> > most recent call that threw an exception...
>
> > > Best wishes,
> > > Jonathan
>
> > Ok I was just assuming Python already had the MySQL bindings.
> > So I've downloaded the MySQL-python-1.2.3.tar.gz, I decompressed it,
> > read that I needed easy_install or setuptools. So I installed
> > setuptools/easy_install but for some reason it won't install the MySQL-
> > python files. I tried getting easy_install to download it, wouldn't
> > work. I tried to get it to use the compressed version, still didn't
> > work. I'm guessing it's not working cause the easy_install needs an
> > egg file, yet there doesn't seem to be one in any of the directories.
>
> > As for the errors at the bottom of the thrown exceptions:
>
> > raise ImproperlyConfigured("Error loading MySQLdb module: %s" %e)
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > module: No module named MySQLdb
>
> > does that help?
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Regards,
> Sithembewena Lloyd Dubehttp://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-14 Thread Sithembewena Lloyd Dube
I recall having a similar problem. Get the MySQL bindings appropriate to
your Python version below and install to your site-packages folder:

http://sourceforge.net/projects/mysql-python/

2010/10/13 Everett 

>
>
> On Oct 13, 2:34 am, Jonathan Barratt 
> wrote:
> > On 13 ?.?. 2010, at 10:19, Everett wrote:
> >
> > > I'm running Django on Windows. When I edited the settings.py file for
> > > the MySql database I'm running in an XAMPP package, the Django
> > > development server throws a bunch of unhandled exceptions. It starts
> > > out like this:
> >
> > 
> >
> > The most useful error message will be the last entry in the traceback
> rather than the start of it. Please provide that message and we may have
> more to go on.
> >
> > > Is this because of how I'm running the MySQL database? Or the
> > > information in the settings.py file is off? Cause when I take all the
> > > database settings out of the settings.py file the development server
> > > runs fine.
> >
> > If there are no DB settings then obviously Django doesn't try to talk to
> the DB, so yes that does suggest the problem is in the Django-DB
> interaction.
> >
> > 
> >
> > > Any ideas?
> >
> > The first idea that pops into my head is that you may not have Python's
> MySQL bindings installed (perhttp://
> docs.djangoproject.com/en/dev/topics/install/#get-your-databas...), which
> is available athttp://sourceforge.net/projects/mysql-python/
> >
> > If do already have that package installed then we'll just have to see the
> most recent call that threw an exception...
> >
> > Best wishes,
> > Jonathan
>
> Ok I was just assuming Python already had the MySQL bindings.
> So I've downloaded the MySQL-python-1.2.3.tar.gz, I decompressed it,
> read that I needed easy_install or setuptools. So I installed
> setuptools/easy_install but for some reason it won't install the MySQL-
> python files. I tried getting easy_install to download it, wouldn't
> work. I tried to get it to use the compressed version, still didn't
> work. I'm guessing it's not working cause the easy_install needs an
> egg file, yet there doesn't seem to be one in any of the directories.
>
> As for the errors at the bottom of the thrown exceptions:
>
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" %e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
>
> does that help?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-14 Thread Greg Fuller
This can be a pain on windows, because there is usually no compiler
for setup to build the "binary" version of the adaptor.  The easiest
course of action is to find a binary for the version of python you are
running.  I haven't seen any for 2.7 yet but searching for "python
msqldb windows binary" will expose some binaries for earlier
versions.  I usually work on mac, but for my windows box at work I
reverted to an earlier version of python just to get mysql (and PIL)
working

On Oct 12, 10:19 pm, Everett  wrote:
> I'm running Django on Windows. When I edited the settings.py file for
> the MySql database I'm running in an XAMPP package, the Django
> development server throws a bunch of unhandled exceptions. It starts
> out like this:
>
> Unhandled exception in thread started by  0x01F69E70>
> Traceback (most recent call last):
> File "D:\Python27\lib\site-packages\django\core\managment\base.py",
> line 249 in validate
>
> Is this because of how I'm running the MySQL database? Or the
> information in the settings.py file is off? Cause when I take all the
> database settings out of the settings.py file the development server
> runs fine.
>
> Database settings:
>
> 'ENGINE': 'django.db.backends.mysql',
> 'NAME': 'djangodb',
> 'USER': 'admin',
> 'PASSWORD': ' ',
> 'HOST': 'localhost',
> 'PORT': ' ',
>
> Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 1:32, Everett wrote:
> 

> Ok I was just assuming Python already had the MySQL bindings.
> So I've downloaded the MySQL-python-1.2.3.tar.gz, I decompressed it,
> read that I needed easy_install or setuptools. So I installed
> setuptools/easy_install but for some reason it won't install the MySQL-
> python files. I tried getting easy_install to download it, wouldn't
> work. I tried to get it to use the compressed version, still didn't
> work. I'm guessing it's not working cause the easy_install needs an
> egg file, yet there doesn't seem to be one in any of the directories.

You don't mention what OS you're running, nor show us the commands, and their 
corresponding errors, that you have tried to install with so far. I've only 
dealt with postgres and Django, so Google will be of more help to you than I 
can, but perhaps with those missing details provided others on this list can 
help.

> As for the errors at the bottom of the thrown exceptions:
> 
> raise ImproperlyConfigured("Error loading MySQLdb module: %s" %e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
> 
> does that help?

It does confirm that the problem is the missing DB bindings...

Good luck,
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-13 Thread Everett


On Oct 13, 2:34?am, Jonathan Barratt 
wrote:
> On 13 ?.?. 2010, at 10:19, Everett wrote:
>
> > I'm running Django on Windows. When I edited the settings.py file for
> > the MySql database I'm running in an XAMPP package, the Django
> > development server throws a bunch of unhandled exceptions. It starts
> > out like this:
>
> 
>
> The most useful error message will be the last entry in the traceback rather 
> than the start of it. Please provide that message and we may have more to go 
> on.
>
> > Is this because of how I'm running the MySQL database? Or the
> > information in the settings.py file is off? Cause when I take all the
> > database settings out of the settings.py file the development server
> > runs fine.
>
> If there are no DB settings then obviously Django doesn't try to talk to the 
> DB, so yes that does suggest the problem is in the Django-DB interaction.
>
> 
>
> > Any ideas?
>
> The first idea that pops into my head is that you may not have Python's MySQL 
> bindings installed 
> (perhttp://docs.djangoproject.com/en/dev/topics/install/#get-your-databas...),
>  which is available athttp://sourceforge.net/projects/mysql-python/
>
> If do already have that package installed then we'll just have to see the 
> most recent call that threw an exception...
>
> Best wishes,
> Jonathan

Ok I was just assuming Python already had the MySQL bindings.
So I've downloaded the MySQL-python-1.2.3.tar.gz, I decompressed it,
read that I needed easy_install or setuptools. So I installed
setuptools/easy_install but for some reason it won't install the MySQL-
python files. I tried getting easy_install to download it, wouldn't
work. I tried to get it to use the compressed version, still didn't
work. I'm guessing it's not working cause the easy_install needs an
egg file, yet there doesn't seem to be one in any of the directories.

As for the errors at the bottom of the thrown exceptions:

raise ImproperlyConfigured("Error loading MySQLdb module: %s" %e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: No module named MySQLdb

does that help?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Database Setup

2010-10-13 Thread Jonathan Barratt
On 13 ?.?. 2010, at 10:19, Everett wrote:

> I'm running Django on Windows. When I edited the settings.py file for
> the MySql database I'm running in an XAMPP package, the Django
> development server throws a bunch of unhandled exceptions. It starts
> out like this:


The most useful error message will be the last entry in the traceback rather 
than the start of it. Please provide that message and we may have more to go on.

> Is this because of how I'm running the MySQL database? Or the
> information in the settings.py file is off? Cause when I take all the
> database settings out of the settings.py file the development server
> runs fine.

If there are no DB settings then obviously Django doesn't try to talk to the 
DB, so yes that does suggest the problem is in the Django-DB interaction.


> Any ideas?

The first idea that pops into my head is that you may not have Python's MySQL 
bindings installed (per 
http://docs.djangoproject.com/en/dev/topics/install/#get-your-database-running),
 which is available at http://sourceforge.net/projects/mysql-python/ 

If do already have that package installed then we'll just have to see the most 
recent call that threw an exception...

Best wishes,
Jonathan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Database Setup

2010-10-12 Thread Everett
I'm running Django on Windows. When I edited the settings.py file for
the MySql database I'm running in an XAMPP package, the Django
development server throws a bunch of unhandled exceptions. It starts
out like this:

Unhandled exception in thread started by 
Traceback (most recent call last):
File "D:\Python27\lib\site-packages\django\core\managment\base.py",
line 249 in validate

Is this because of how I'm running the MySQL database? Or the
information in the settings.py file is off? Cause when I take all the
database settings out of the settings.py file the development server
runs fine.

Database settings:

'ENGINE': 'django.db.backends.mysql',
'NAME': 'djangodb',
'USER': 'admin',
'PASSWORD': ' ',
'HOST': 'localhost',
'PORT': ' ',

Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django database setup problem

2007-10-04 Thread Joseph Heck

I'd recommend installing
http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/MySQL-python-1.2.0-1.i386.rpm

If I remember correctly, Fedora (RPM) has no trouble with using a
remote RPM file - so the following should do the trick:

rpm -Uvh 
http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/MySQL-python-1.2.0-1.i386.rpm

-joe

On 10/4/07, swati <[EMAIL PROTECTED]> wrote:
>
> Thanks Joe, I recompiled the python with zlib support and tried to
> install mysqldb, now I am not getting the error of zlib anymore. But
> got error with gcc compiler. Part of the error is something like,-
>
> 
> _mysql.c:2475: warning: passing argument 1 of âstrlenâ from
> incompatible pointer type
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: comparison between pointer and integer
> _mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: comparison between pointer and integer
> _mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: comparison between pointer and integer
> _mysql.c:2475: warning: passing argument 1 of âstrlenâ from
> incompatible pointer type
> _mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: statement with no effect
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: statement with no effect
> _mysql.c:2475: error: invalid operands to binary -
> _mysql.c:2475: warning: statement with no effect
> _mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2476: warning: passing argument 1 of âPyMember_GetOneâ from
> incompatible pointer type
> _mysql.c:2478: warning: passing argument 2 of âPyErr_SetStringâ from
> incompatible pointer type
> _mysql.c: At top level:
> _mysql.c:2486: error: syntax error before â*â token
> _mysql.c:2489: warning: function declaration isnât a prototype
> _mysql.c: In function â_mysql_ConnectionObject_setattrâ:
> _mysql.c:2490: error: âvâ undeclared (first use in this function)
> _mysql.c:2501: error: ânameâ undeclared (first use in this function)
> _mysql.c:2501: warning: passing argument 1 of âstrlenâ from
> incompatible pointer type
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: comparison between pointer and integer
> _mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: comparison between pointer and integer
> _mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: comparison between pointer and integer
> _mysql.c:2501: warning: passing argument 1 of âstrlenâ from
> incompatible pointer type
> _mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: statement with no effect
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: statement with no effect
> _mysql.c:2501: error: invalid operands to binary -
> _mysql.c:2501: warning: statement with no effect
> _mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2502: error: âselfâ undeclared (first use in this function)
> _mysql.c:2502: warning: passing argument 1 of âPyMember_SetOneâ from
> incompatible pointer type
> _mysql.c:2502: warning: passing argument 3 of âPyMember_SetOneâ from
> incompatible pointer type
> _mysql.c:2504: warning: passing argument 2 of âPyErr_SetStringâ from
> incompatible pointer type
> _mysql.c: At top level:
> _mysql.c:2511: error: syntax error before â*â token
> _mysql.c:2514: warning: function declaration isnât a prototype
> _mysql.c: In function â_mysql_ResultObject_setattrâ:
> _mysql.c:2515: error: âvâ undeclared (first use in this function)
> _mysql.c:2526: error: ânameâ undeclared (first use in this function)
> _mysql.c:2526: warning: passing argument 1 of âstrlenâ from
> incompatible pointer type
> _mysql.c:2526: error: invalid operands to binary -
> _mysql.c:2526: warning: comparison between pointer and integer
> _mysql.c:2526: warning: passing argument 2 of â__builtin_strcmpâ from
> incompatible pointer type
> _mysql.c:2526: error: invalid operands 

Re: django database setup problem

2007-10-04 Thread swati

Thanks Joe, I recompiled the python with zlib support and tried to
install mysqldb, now I am not getting the error of zlib anymore. But
got error with gcc compiler. Part of the error is something like,-


_mysql.c:2475: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: comparison between pointer and integer
_mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: comparison between pointer and integer
_mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: comparison between pointer and integer
_mysql.c:2475: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: statement with no effect
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: statement with no effect
_mysql.c:2475: error: invalid operands to binary -
_mysql.c:2475: warning: statement with no effect
_mysql.c:2475: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2476: warning: passing argument 1 of âPyMember_GetOneâ from
incompatible pointer type
_mysql.c:2478: warning: passing argument 2 of âPyErr_SetStringâ from
incompatible pointer type
_mysql.c: At top level:
_mysql.c:2486: error: syntax error before â*â token
_mysql.c:2489: warning: function declaration isnât a prototype
_mysql.c: In function â_mysql_ConnectionObject_setattrâ:
_mysql.c:2490: error: âvâ undeclared (first use in this function)
_mysql.c:2501: error: ânameâ undeclared (first use in this function)
_mysql.c:2501: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: comparison between pointer and integer
_mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: comparison between pointer and integer
_mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: comparison between pointer and integer
_mysql.c:2501: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: statement with no effect
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: statement with no effect
_mysql.c:2501: error: invalid operands to binary -
_mysql.c:2501: warning: statement with no effect
_mysql.c:2501: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2502: error: âselfâ undeclared (first use in this function)
_mysql.c:2502: warning: passing argument 1 of âPyMember_SetOneâ from
incompatible pointer type
_mysql.c:2502: warning: passing argument 3 of âPyMember_SetOneâ from
incompatible pointer type
_mysql.c:2504: warning: passing argument 2 of âPyErr_SetStringâ from
incompatible pointer type
_mysql.c: At top level:
_mysql.c:2511: error: syntax error before â*â token
_mysql.c:2514: warning: function declaration isnât a prototype
_mysql.c: In function â_mysql_ResultObject_setattrâ:
_mysql.c:2515: error: âvâ undeclared (first use in this function)
_mysql.c:2526: error: ânameâ undeclared (first use in this function)
_mysql.c:2526: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2526: error: invalid operands to binary -
_mysql.c:2526: warning: comparison between pointer and integer
_mysql.c:2526: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2526: error: invalid operands to binary -
_mysql.c:2526: warning: comparison between pointer and integer
_mysql.c:2526: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2526: error: invalid operands to binary -
_mysql.c:2526: warning: comparison between pointer and integer
_mysql.c:2526: warning: passing argument 1 of âstrlenâ from
incompatible pointer type
_mysql.c:2526: warning: passing argument 2 of â__builtin_strcmpâ from
incompatible pointer type
_mysql.c:2526: error: invalid operands to binary -
_mysql.c:2526: error: invalid operands to binary -
_mysql.c:2526: warning: 

Re: django database setup problem

2007-10-03 Thread Joseph Heck

You're on the right track - missing the MySQL python libraries. It
looks like Python is also missing the zlib libraries...

not sure which OS you're using, but there's probably an "apt-get
install ..." or "rpm -Uvh ..." command that will get you the MySQL
Python libraries that you need. Looking on an Ubuntu box, the package
I installed was:

"apt-get install python-mysqldb"

-joe

On 10/3/07, swati <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I am setting up first django project. When I set up django without any
> database settings, I could see the first welcome page from django.
> After this initial success, when I specify the database settings in
> the 'settings.py' and tried to run django, I am getting error,-
>
> "ImproperlyConfigured: Error loading MySQLdb module: No module named
> MySQLdb"
>
> I have downloaded python-mysql and tried installing it, where I am
> getting error,-
>
> ---
> Traceback (most recent call last):
>   File "setup.py", line 5, in ?
> import ez_setup; ez_setup.use_setuptools()
>   File "/home/djtstdir/MySQL-python-1.2.2/ez_setup.py", line 85, in
> use_setuptools
> import setuptools; setuptools.bootstrap_install_from = egg
> zipimport.ZipImportError: can't decompress data; zlib not available
> ---
>
> I have installed zlib also, but getting same error.
>
> I am working remotly on linux
> I am working as root
> I have apache, mysql, python 2.4, and mod_python installed in my
> machine.
>
> Any idea what I am missing out? Please help.
>
> Many Thanks,
> Swati
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django database setup problem

2007-10-03 Thread swati

Hi All,

I am setting up first django project. When I set up django without any
database settings, I could see the first welcome page from django.
After this initial success, when I specify the database settings in
the 'settings.py' and tried to run django, I am getting error,-

"ImproperlyConfigured: Error loading MySQLdb module: No module named
MySQLdb"

I have downloaded python-mysql and tried installing it, where I am
getting error,-

---
Traceback (most recent call last):
  File "setup.py", line 5, in ?
import ez_setup; ez_setup.use_setuptools()
  File "/home/djtstdir/MySQL-python-1.2.2/ez_setup.py", line 85, in
use_setuptools
import setuptools; setuptools.bootstrap_install_from = egg
zipimport.ZipImportError: can't decompress data; zlib not available
---

I have installed zlib also, but getting same error.

I am working remotly on linux
I am working as root
I have apache, mysql, python 2.4, and mod_python installed in my
machine.

Any idea what I am missing out? Please help.

Many Thanks,
Swati


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database setup

2007-07-14 Thread Carl Karsten

surfwizz wrote:
> I'm trying to do the django tutorial at 
> http://www.djangoproject.com/documentation/tutorial01/,
> but I don't know how to set up a database.  I do not have a dedicated
> server or web hosting at this time, and I want to do some work on
> setting up a website with database systems before I get web hosting.
> Can I make a database stored locally? if yes, how?

# settings.py
...
DATABASE_ENGINE = 'sqlite3'   # 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'foo'
...

That is all you need (for DATABASE settings)  syncdb will create the database 
for you (called 'foo' in your  project dir.  which is fine for now.)

All that other stuff postdd is correct, but probably over your head at this 
point, so don't worry about it if you didn't understand.


Carl K

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database setup

2007-07-14 Thread Tim Chase

> Sure you can. You might want to look at sqlite, as it's the
> easiest to set up. You can painlessly switch to a "better"
> database engine when going to production, though sqlite does
> quite well the job, even in production.

I second Christian's suggestion of using sqlite for its
minimal-fuss configuration (the OS permissions for the
web-server/django process on the database file are the
permissions you get).  It even has a ":memory:" database which is
handy for testing purposes (never touching a file).

I would add a small caveat to "painlessly":  it's painless unless
you try and monkey with the underlying SQL through either an
extra() call or hacking the ORM, both of which I do far too
regularly.  If you mess with either of these more obscure corners
of Django (okay, the extra() isn't obscured as it's right there
in the docs, but not many folks seem to know about it or use it),
you just have to be careful that your SQL is portable across the
various servers you expect to support.

However, if you avoid touching DB specific code, the Django ORM
does a rather good job of abstracting most of this stuff away so
your code becomes portable across DB engines.

-tim



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database setup

2007-07-14 Thread Christian Hoeppner

Sure you can. You might want to look at sqlite, as it's the easiest to 
set up. You can painlessly switch to a "better" database engine when 
going to production, though sqlite does quite well the job, even in 
production.



surfwizz escribió:
> I'm trying to do the django tutorial at 
> http://www.djangoproject.com/documentation/tutorial01/,
> but I don't know how to set up a database.  I do not have a dedicated
> server or web hosting at this time, and I want to do some work on
> setting up a website with database systems before I get web hosting.
> Can I make a database stored locally? if yes, how?
>
>
> >
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Database setup

2007-07-14 Thread surfwizz

I'm trying to do the django tutorial at 
http://www.djangoproject.com/documentation/tutorial01/,
but I don't know how to set up a database.  I do not have a dedicated
server or web hosting at this time, and I want to do some work on
setting up a website with database systems before I get web hosting.
Can I make a database stored locally? if yes, how?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---