django-app
template gives you a full-stack Web App built with Django and Postgres
Setup
1
Create a virtual environment
2
Install phidata
3
Install docker
Install docker desktop to run your app locally
4
Export your OpenAI key
You can get an API key from here.
Create your codebase
Create your codebase using thedjango-app
template pre-configured with Django and PostgreSQL
django-app
with the following structure:
Set OpenAI Key
Set yourOPENAI_API_KEY
as an environment variable. You can get one from OpenAI.
Local Web App
Your codebase comes with a pre-configured Django application connected to a Postgres database. Run it using:View your Django App
Open localhost:8000 to view the Django App running locally.
Django Admin
Open localhost:8000/admin to view the Django admin site. Create an admin user by running:
Build your Web App
The Django Tutorials are a great place to learn about Django, play around and update your Web App to your use case. Here's how to create a simple chat application: 1. Create a new django appRead more about django apps here
chat
app/settings.py
chat/views.py
file to
chat/views.py
urls.py
in the chat folder:
chat/urls.py
app/urls.py
file to:
app/urls.py
chat/templates/chat
folder.
chat/templates/chat/base.html
chat/templates/chat/index.html

If needed, restart the django server using
phi ws restart dev:docker:app -y
Delete local resources
Play around and stop the workspace using:Next
Congratulations on running your Django App locally. Next Steps:- Run your Django App on AWS
- Read how to update workspace settings
- Read how to create a git repository for your workspace
- Read how to manage the development application
- Read how to format and validate your code
- Read how to add python libraries
- Chat with us on discord