All Templates / Starters
Django REST Template
Django Rest Framework Starter Template
Postgres
railwayapp-templates/postgres-ssl:latest
Just deployed
/var/lib/postgresql/data
django-rest-starter
Grey-A/django-rest-starter
Just deployed
Welcome to the Django REST + Postgres Starter! This guide will walk you through the steps to get started with the project after deploying the service. Before you begin, make sure you have deployed the template.
The SECRET_KEY
is a critical security parameter used by Django to secure cryptographic signatures and session data. To enhance the security of your project, it's essential to change the default SECRET_KEY
to a unique and secure value.
SECRET_KEY
variable and update it with your desired value.Example:
SECRET_KEY = 'your_secret_key_here'
Django uses Cross-Site Request Forgery (CSRF) protection to prevent malicious attacks. When deploying the project to Railway or a custom domain, you need to specify the trusted origins that are allowed to send POST, PUT, PATCH, or DELETE requests.
CSRF_TRUSTED_ORIGINS
variable and update it with the URLs of your Railway app or custom domain.Example:
CSRF_TRUSTED_ORIGINS = ['your_railway_app_url_here', 'your_custom_domain_url_here']
With the SECRET_KEY
and CSRF_TRUSTED_ORIGINS
updated, you can now run the development server to test your Django REST + Postgres Starter locally.
python manage.py runserver
The development server should start, and you can access your project at http://127.0.0.1:8000/
.
With the project set up and the development server running, you are ready to start building your API. The Django REST + Postgres Starter provides a solid foundation to create powerful RESTful APIs. You can define your models, serializers, views, and URLs to implement your desired functionality.
Refer to Django REST Framework documentation (https://www.django-rest-framework.org/) for detailed information on how to create APIs, handle authentication, permissions, and much more.
Congratulations! You have successfully set up the Django REST + Postgres Starter and made the necessary changes to enhance the security and compatibility with Railway or a custom domain. Now you can begin building your API and start your exciting development journey with Django and Postgres.
Happy coding! 🚀
Template Content
django-rest-starter
Grey-A/django-rest-starterDetails
GrandGale Technologies
Created on Aug 5, 2023
302 total projects
113 active projects
53% success on recent deploys
Python
Starters
More templates in this category
Django Monolith
A Django app connected to a Postgres database with Celery and Celery Beat.
Odogwu Machalla's Projects
37