Skip to content

A repository to brush on couple of django rest framework concepts and creating powerful and robust APIs with it for applications, deployed on render and using managed database connection from neon.tech

Notifications You must be signed in to change notification settings

Dhruv97Sharma/re-learning-drf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Relearning DRF

This is a simple DRF project for learning django rest framework capabilities from the official documentation tutorial here.

Features

  • Django 3.0+
  • Uses venv - the officially recommended Python packaging tool from Python.org.
  • Development, Staging and Production settings with django-configurations.
  • Get value insight and debug information while on Development with django-debug-toolbar.
  • Collection of custom extensions with django-extensions.
  • HTTPS and other security related settings on Staging and Production.
  • Procfile for running gunicorn with New Relic's Python agent.
  • PostgreSQL database support with psycopg2.
  • Using Neon Tech PostgreSQL managed DB neon.tech.

How to install

$ source .env
$ python -m venv venv
$ source ./venv/bin/activate
$ pip install -r requirements.txt
$ python manage.py migrate
$ python manage.py runserver

Environment variables

Since I am using neon tech postgres managed DB for this example, this is how you would need to setup the database url variable in a .env file. The DATABASE_URL variable loads the correct settings, you can add the url to your DB here

export DATABASE_URL=postgres://<your_username>:<your_password>@<db_branch_id>.us-east-2.aws.neon.tech/drf_tutorial_db?options=endpoint%3D<db_branch_id>

With this you can setup your neon tech db with the name 'drf_tutorial_db' and add your db url here.

Deployment

It is possible to deploy to Heroku or to your own server.

License

The MIT License (MIT)

About

A repository to brush on couple of django rest framework concepts and creating powerful and robust APIs with it for applications, deployed on render and using managed database connection from neon.tech

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published