a user registration and login logout system using Django and Postgresql Database
virtualenv venv
. This will a create a vitual environment called "venv" that helps with controlling dependencies.(For windows runmkvirtualenv venv
)source venv/bin/activate
. (For windows runworkon venv
)
(while in the activated virtual environment)
pip install -r requirements.txt
NOTE: After installing dependencies, pip-tools is also installed. You can now use it to manage package dependencies of your project.
Add a new package to requirements.txt and run the following command to auto-update requirements.txt file
pip freeze > requirements.txt
Run the following command to sync your virtualenv
pip-sync
This will install/upgrade/uninstall everything necessary to match the requirements.txt contents.
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
- Download postgresql setup form https://www.postgresql.org/download/
- Download pgadmin setup from https://www.pgadmin.org/download/
- Start pgadmin and make a new database.
There are a couple of security settings to setup manually. Open the DjangoProject/settings.py file and change USER and PASSWORD here:
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'database name', #change this with your database name 'USER': 'postgres', #change this with your postgresql username. default is 'postgres' 'PASSWORD': 'postgresql password', #change this with your postgresql password 'HOST': 'localhost', } }