I’m following a Django tutorial and I bought a 1 month subscription to webfaction.com to practice some web programming.
The tutorial is telling me to type python manage.py syncdb at the application directory, which for me is: D:\Users\yangs\Downloads\Django-1.3.1\Django-1.3.1\build\scripts-2.7\mysite
But I get an error message that reads:
_msql_exceptions.OperationalError: (1045, "Access denied for user 'flammenmeer_'@'c-68-38-119-33.hsd1.nj.comcast.net' (using password: YES)")
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'flammenmeer_', # Or path to database filw
'USER': '', # Not used with sqlite3.
'PASSWORD': 'my_password', # Not used with sqlite3.
'HOST': 'flammenmeer.webfactional.com', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
'USER': 'flammenmeer_',
}
}
Can anyone tell me why I’m getting this error message? Thank you in advance!
edit: I also tried:
- web329.webfaction.com for host
- I made a new database without the underscore named flammenmeer
So all webfaction databases will be named [account name]_aname and the whole thing has to be under 16 characters. So if your username is “flammenmeer” you already have 12 characters used including the underscore. So for your example, let’s pretend you create a database in the admin panel named “test”, your database name will be flammenmeer_test. Also, your username is the same as the database name. And lastly, you don’t need to define the host, the localhost default will suffice.
Edited to provide info on how to run django on webfaction, not local computer
You can’t access a webfaction database externally unless you pay for a static IP address. It sounds like you’re running the Django tutorial on your local computer, not on Webfaction (based on the location of your project being a D drive).
Make sure you’ve created a database in the Webfaction control panel with whatever 4 character name after “flammenmeer_” that you want, an example would be “flammenmeer_test”
Download Putty (the very first “Putty.exe” link on that page)
In Putty, connect to flammenmeer@[machine name].webfaction.com (machine name would be something like “web312” and will be the same machine that you created the database on. Your final product might look something like flammenmeer@web312.webfaction.com
Install Django on your webfaction account
Create a directory for your django scripts
Create a new Django Project
Edit your settings (you are going to want to learn VIM
Carry on with the Django Tutorial 🙂
Hope that helps.