Django Workflow: The Basics

Ripple News • 17th Aug, 15

 
 

Once you’ve gotten the hang of Django and feel that you’ve grasped a good understanding of it, you’ll find yourself falling into a sort of rhythm.  One of the things you’ll find yourself wondering about is what sort of workflow is good when it comes to Django.  To help you out, here’s a hands-on workflow for any Django app that you happen to be working on at the moment:

  • Create a new project and a new app
  • Edit settings and fix the following:

- Database settings

                                - Installed apps

                                - Media and admin paths

                                - Add CSS and JS paths

  • Edit url.py in the project folder

- uncomment the admin paths

  • Create a new url.py in the mainapp folder

- create a path which will display a view called home  

 
  • Create a folder for new templates
  • Create a base.html file within the templates folder
  • Edit the views.py file
  • Create a media folder within the project folder (this is one level up from the mainapp folder)
  • Edit the mdoels.py file
  • Run syncdb
  • It’s at this point that you should be able to access both your homepage as well as your admin page which will output your work by running the development server

This process should be applicable to any new Django project which you’re getting started on, moving the basics out of the way so that you can get going with the actual coding within your views.py file.  Although things are easy when you get started with a new project, changing the database structure could be a bit more challenging.  Keeping in mind a workflow such as this will allow you to tango with Django in no time!  You can leave a comment below if there’s anything that you’d like to add here, or even let us know what any problems you’ve encountered with Django.  

 

Back to Blog