Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 563
Lepus Avatar asked Apr 24 '15 20:04

Lepus


People also ask

Can Mamp run Python?

MAMP PRO installs Python in your /Applications/MAMP/Library/bin/python directory. MAMP PRO will not make any changes to the Python build that is pre installed on your Mac. The Apple-provided build of Python is installed in /usr/bin/python .


1 Answers

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 
like image 140
Lepus Avatar answered Oct 09 '22 15:10

Lepus