-
Run syncdb command to sync models to database and create Django's default superuser and auth system
$ python manage.py migrate
-
Run Django
$ python manage.py runserver $IP:$PORT
-
Create superuser for with admin role for the application
$ python manage.py createsuperuser
-
Install postgresql
$ sudo apt-get update
$ sudo apt-get install python-pip python-dev libpq-dev postgresql postgresql-contrib
-
Install psycopg2
$ sudo pip install psycopg2
-
Start service
$ sudo service postgresql start
-
Create database and role
$ sudo su - postgres
$ psql
$ CREATE DATABASE udaan;
$ CREATE USER udaanuser WITH PASSWORD 'password';
$ ALTER ROLE udaanuser SET client_encoding TO 'utf8';
$ ALTER ROLE udaanuser SET default_transaction_isolation TO 'read committed';
$ ALTER ROLE udaanuser SET timezone TO 'UTC';
$ GRANT ALL PRIVILEGES ON DATABASE udaan TO udaanuser;
-
Query Database
$ psql -h localhost -d udaan -U udaanuser -W
$ \q
-
Auth
$ python manage.py startapp auth_api
-
rest framework
$ sudo pip install djangorestframework
-
Wrote models and applied Make migrations
$ python manage.py makemigrations
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
prisar/assignment_2u
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
udaan hiring challange
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published