DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Frameworks
  4. Tutorial for a First Project Using Django

Tutorial for a First Project Using Django

Amjad Hossain takes us through creating his first project using Django. Let's see what happened!

Amjad Hossain user avatar by
Amjad Hossain
·
Sep. 29, 16 · Tutorial
Like (6)
Save
Tweet
Share
3.87K Views

Join the DZone community and get the full member experience.

Join For Free

Install Python

Pip is python installation and dependency packages management tool.

Before installation anything, the best practice is for all time to keep updated ubuntu packages.

coder@rock:~/PycharmProjects$ sudo apt-get update

Now Install pip using the following command:

I got the message that pip is already installed on my machine but which is a lower version that I don’t want to use but the OS itself depends on it.

To install the latest version of pip we define the Python version with installation command.

Pip upgrade problem, cause OS is dependent on Python version 2.7.

Virtualenv is a tool for creating isolated Python environment.

Virtualenvwrapper is an extension of virtualenv tool for creating and deleting virtual environments and making it easier to work on more than one project at the same time without getting any conflicts in their dependencies.

Create a new directory to place virtual environment, the Python in new virtual environment is effectively isolated from the python that was used to create it.

The newly created virtual environment has activation script. To activate use the following command.

To deactivate the virtual environment use the deactivate command.

Install django in our virtual environment, this installation command is suggested from Django, if you are getting the following error, please remove -e option.

Please use the following command to install successfully.

We have to find manage.py to create new project. Please use the following command to find manage.py and create new project.


Create a superuser of your website.

Finally, run the following command to run the lightweight server.

Do copy the server started URL “http://127.0.0.1:8000/” and see congratulations.

You can also log in as admin by adding /admin into URL.

Now login using super admin user credentials then you will be able to see the admin dashboard.

Django (web framework) Virtual environment Command (computing)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Data Mesh vs. Data Fabric: A Tale of Two New Data Paradigms
  • Understanding gRPC Concepts, Use Cases, and Best Practices
  • The Top 3 Challenges Facing Engineering Leaders Today—And How to Overcome Them
  • RabbitMQ vs. Memphis.dev

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: