Skip to content

Latest commit

 

History

History
97 lines (65 loc) · 1.57 KB

File metadata and controls

97 lines (65 loc) · 1.57 KB

Django-render

Django Project Setup for Render

Step 2: Install the required packages

pip install -r requirements.txt

Step 3: Create a new app

python manage.py startapp appname

Step 4: Add the app to the INSTALLED_APPS setting in settings.py

INSTALLED_APPS = [
    ...
    'appname',
]

Step 5: Create a model in the app

# user_visit/models.py

from django.db import models

class Model(models.Model):

Step 6: Create a view in the app

# user_visit/views.py

Step 7: Create a template for the view

Step 8: Add a URL to the app in urls.py

# backend/urls.py

from django.urls import path

urlpatterns = [
    ...

]

Usage

Once your project is deployed, you can access it at the following URL.

Step 9: Render

  1. Create a Render project.

  2. Add a web service to your Render project.

  3. In the "Build Command" field, enter the following command.

./build.sh
  1. In the "Start Command" field, enter the following command.
gunicorn backend.wsgi:application
  1. In the "Env Vars" field, add the following environment variables.
DATABASE_URL=postgresql://localhost/modlinkproduction
SECRET_KEY=your-secret-key
WEB_CONCURRENCY=4
  1. Deploy your project.
https://your-project-name.onrender.com

Contributing

Contributions are welcome! Please see the contributing guidelines for more information.

License

This project is licensed under the MIT license. See the LICENSE file for more information.