Lepus Lepus - 1 year ago 114
Python Question

Set up a Django Project with Mamp?

I just downloaded a newer version of MAMP (3.2.1) and i noticed that this Version has Python installed and also seems to handle SQLite Databases.

Shouldn't I be able to manage Django Projects with it?

Where and how would i install it?

I found some Posts in the Web (before my new MAMP release) where People already trying to get MAMP + Django to work with MySQL but those seemed more complicated to me then the usual setup with Virtualenv + SQLite/Postgres.
I'm pretty new to django but starting a project at the time seems quite simple to me.

If Django would work with MAMP together what would be the advantages?

Anyone has already experiences or useful links?

Answer Source

OK i gues working with MAMP MySQL has the advantage that i can easy import/export Database with php MyAdmin tool. Anyway based on tanorix answer here how for me Django worked with MAMP MySQL Database:

DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.mysql', 
      'NAME': 'projectdb',                   
      'USER': 'root',
      'PASSWORD': 'root',
      'HOST': '/Applications/MAMP/tmp/mysql/mysql.sock',
      'PORT': '8888',
  }
}

Then

python manage.py migrate