Giter Site home page Giter Site logo

hello-django's Introduction

Hello-Django

Repo for playing with basic Django usage

This repository is for validating and demonstrating a basic Django installation. Your goal is to create a basic initial Django project - if you have Python and pip installed, this should be pretty straightforward.

python --version  # Should be >3
pip --version     # Should be >9

The requirements.txt file describes project dependencies, and pip can use it with:

pip install -r requirements.txt

Note that before doing this you may want to set up an environment with virtualenv (more details soon).

This will give you Django 2.0.2, which you can verify by running:

python -m django --version  # Should be 2.0.2

Now you can add your project! Django includes a command line tool django-admin that can be used to do this:

django-admin startproject hello

This will make a directory with various files in it, notably manage.py (which you will use to start the app and generally interact with it) and hello/settings.py (which controls the settings of the app). cd into hello and try running:

python manage.py runserver

If it works, you'll be able to load the page locally and should see something like this:

Screenshot of fresh Django project

If it doesn't, read the error, read the documentation, and ask for help. Common issues include needing to apply migrations (python manage.py migrate) and (if you're using Docker) needing to edit ALLOWED_HOSTS or set up the ports (you can specify port at runtime by e.g. python manage.py runserver 8000).

Once you have it working, add and commit your new project so we can check it out and give help/feedback. We'll be working on a much more substantial project soon, but if you can't wait you can follow the tutorial to keep adding features to this one.

hello-django's People

Contributors

odax avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.