Mika/Notes: Difference between revisions

From WikiDotMako
(added Django p&s)
Line 24: Line 24:


3. Log back into mysql as user (now has all privileges) and try creating a new database again.
3. Log back into mysql as user (now has all privileges) and try creating a new database again.
===Django===
*Tried setting up Django on my computer by following this [http://itpro.nikkeibp.co.jp/article/COLUMN/20081031/318265/?ST=develop&P=4 tutorial]
'''Problem:'''
It worked mostly ok but I couldn't go further than the second to the last coding box on page 4. I kept getting long error messages.
'''Solution'''
[http://docs.djangoproject.com/en/dev/intro/tutorial02/ Django tutorial about django.contrib.admin]
1. Check if I typed in the correct codes.
2. Check if the output are the same everwhere:
Although the codes were correct, they didn't create all the necessary things, so it couldn't find the index.html.
* I went to setting.py to specify:
** the absolute path for Template_Dir. Don't forget the , after '/path/' .
** two additional Installed_Apps: myprj_myapp (where I save my project) and django.contrib.admin . Run python manage.py syncdb afterwards.
This created myapp_post and django_admin_log in mysql database.

Revision as of 19:53, 28 November 2009

Computer Stuff

MySQL

Problem:

mysql> create database newdatabase;

ERROR 1044 (42000): Access denied for user 'user'@'localhost'...

Solution:

mysql

1. Check grants for 'user'@'localhost' in mysql:

mysql> show grants for 'user'@'localhost';

2. Log into mysql as root (has all privileges) and change grants for a specific user:

mysql> grant all privileges on *.* to 'user'@'localhost';

Query OK, 0 rows affected (0.00 sec)

3. Log back into mysql as user (now has all privileges) and try creating a new database again.

Django

  • Tried setting up Django on my computer by following this tutorial

Problem:

It worked mostly ok but I couldn't go further than the second to the last coding box on page 4. I kept getting long error messages.

Solution

Django tutorial about django.contrib.admin

1. Check if I typed in the correct codes.

2. Check if the output are the same everwhere:

Although the codes were correct, they didn't create all the necessary things, so it couldn't find the index.html.

  • I went to setting.py to specify:
    • the absolute path for Template_Dir. Don't forget the , after '/path/' .
    • two additional Installed_Apps: myprj_myapp (where I save my project) and django.contrib.admin . Run python manage.py syncdb afterwards.

This created myapp_post and django_admin_log in mysql database.