Skip to content

tiwarikratika/Django-weather-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

This repository implements a weather app that uses Open Weather API and Django as a backend framework.

Workflow

The following is a basic workflow that you can use as a quick reference for developing a Django Project.

Setup

Within a new directory, create and activate a virtualenv. Install Django.
  • Create your project:
  • django-admin.py startproject

  • Create a new app
  • python manage.py startapp
  • Add your app to the INSTALLED_APPS tuple.
  • Add Basic URLs and Views
  • Map your Project’s urls.py file to the new app.
  • In your App directory, create a urls.py file to define your App’s URLs.
  • Add views, associated with the URLs, in your App’s views.py; make sure they return a HttpResponse object. Depending on the situation, you may also need to query the model (database) to get the required data back requested by the end user.
  • Templates and Static Files

    • Create a templates and static directory within your project root.
    • Update settings.py to include the paths to your templates.
    • Add a HTML file to the templates directory.
    • Update the views.py file as necessary.

    Models and Databases

  • Update the database engine to settings.py (if necessary, as it defaults to SQLite).
  • Create and apply a new migration.
  • Create a super user.
  • Add an admin.py file in each App that you want access to in the Admin.
  • Create your models for each App.
  • Create and apply a new migration.
  • Forms

    • Create a forms.py file at the App to define form-related classes; define your ModelForm classes here.
    • Add or update a view for handling the form logic - e.g., displaying the form, saving the form data, alerting the user about validation errors, etc.
    • Add or update a template to display the form.
    • Add a urlpattern in the App’s urls.py file for the new view.
      • User Registration

        • Create a UserForm
        • Add a view for creating a new user.
        • Add a template to display the form.
        • Add a urlpattern for the new view.

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages