Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fdp_template

This repository contains devcontainer configuration files for a Flutter + Django & PostgreSQL project.
The devcontainer is compatible with both GitHub Codespaces and a locally running devcontainer.

Usage

  1. Create a new repo from this template.

Important: The automated project structure setup will fail if the repo name contains non-alphanumeric characters (aside from underscores).

  1. Specify package versions (ignore for default versions):
    • Specify the desired Flutter version using the FLUTTER_VERSION environment variable in .devcontainer/Dockerfile.
    • Specify the desired Django version in requirements.txt.
    • All other package versions will likely require modifying the base image used by the Dockerfile.
  2. (Optional) If the devcontainer will be run locally, install the Dart Debug Extension.
  3. Create a devcontainer either locally or with GitHub Codespaces.

If asked to manually locate the Flutter SDK path, enter /usr/local/flutter/.

Running the App

Use the command palette (CTRL+SHIFT+P) to search and select "Run Task" to see a list of configured tasks.

Local devcontainer

  1. Run the "Start Backend" task to start the Django web server.
  2. Navigate to the debug side bar and launch the "Flutter Run Debug" configuration.
  3. Once the Flutter web server has started, open localhost:3000 in a browser to view the Flutter app.
  4. Activate the Dart Debug extension.
  5. (Optional) Open localhost:8000 to access Django web interfaces.
  • To hot reload the Flutter app, press CTRL+S (even if autosave is enabled; this can be changed in the VSCode settings).

GitHub Codespace

  1. Run the "Start Servers" task to start both the Flutter and Django web servers.
  2. Once the Flutter web server has started, Open localhost:3000 in a browser to view the Flutter app.
  3. (Optional) Open localhost:8000 to access Django web interfaces.
  • To hot restart the Flutter app, press r in the task terminal.

Tips

  • If you receive an HTTP 401 status code when attempting to access Flutter via port 3000 in Codespaces, try making the forwarded port public.
  • If you are unable to access the Django web interface, try removing port 8000 from VSCode's list of forwarded ports, and then adding it back manually.
  • Use the "Django Migrate" task to automatically apply database migrations.
  • The Flutter web server can be launched independently from Django with the "Start Frontend" task.
  • Follow the comments in .devcontainer/devcontainer.json and .devcontainer/docker-compose.yml to port forward PostgreSQL.

About

Flutter + Django & PostgreSQL Template

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages