Reputation: 1358
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
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?.
Upvotes: 2
Views: 8509
Reputation: 3145
I recently deployed a Django based project and found this tutorial to be very helpful and concise. Django virtualenv Apache2 mod_wsgi
And if you have CentOS, then you can install mod_wsgi as mentioned here: Django Deployment - Setup mod_wsgi on CentOS
Upvotes: 2
Reputation: 18022
Getting Django to run on Apache requires getting Python to interpret that, you can do this with WSGI. follow the tutorial found here:
https://code.djangoproject.com/wiki/django_apache_and_mod_wsgi
there are other methods to deploy this, you can find here:
https://docs.djangoproject.com/en/dev/howto/deployment/
Upvotes: 1
Reputation: 55962
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:8080
to 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.py
file 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/
Upvotes: 2