I am of the PHP background and just have started to learn Django and Python (and loving it). I always used to install WAMP server for PHP development.
Now I dont know how do I configure Django to use PostgreSQL i.e how to make both communicate with each other. I have run some ‘hello world’ scripts with django. Curretly I have installed Python, django and PostgreSQL. here is the version information
- Python : 2.7.2 & 3.2 (i have installed both)
- Django : 1.3.1
- PostgreSQL : 9.1.2
- Apache : 2.2 (..this is from WAMP server)
- Os : Ms Windows 7 32-bits (x86)
Since django has builtin development server is it at all necessary to have apache installed and use it instead of that one? If we use the built-in server how we are supposed to configure it for PostgreSQL?.
It is not necessary to have apache installed to develop on django. In fact it is often easier to use the development server because it is single threaded, lightweight, and extremely easy to use.
python manage.py runserver 0.0.0.0:8080to run on localhost port 8080, and your code is easily debuggable.In django you dont configure your server for a database. You configure your project for a database. All database configurations are kept in the
settings.pyfile located in your main project. Page one of the tutorial explains how to set up a database for your django prject. YOu have to specify, database name, host, port, user and password in your settings.py file.https://docs.djangoproject.com/en/dev/intro/tutorial01/#database-setup
I would suggest walking through the django tutorial as it addresses most of the issues in setting up development on a new django project.
https://docs.djangoproject.com/en/dev/intro/tutorial01/