Skip to content

Conversation

superasperatus
Copy link

@superasperatus superasperatus commented Sep 10, 2020

For all PRs

For new stacks

@netlify
Copy link

netlify bot commented Sep 10, 2020

Deploy request for awesomestacks accepted.

Accepted with commit b87383e

https://app.netlify.com/sites/awesomestacks/deploys/5f59c879026a7900087210cc

@balajirajput96
Copy link

Import the necessary libraries

import os
import django

Set the project directory

project_dir = os.path.dirname(os.path.abspath(file))

Create a Django project

django.setup(project_dir)

Create a new app

os.system('python manage.py startapp digital_marketing')

Add the app to the INSTALLED_APPS setting

with open(os.path.join(project_dir, 'settings.py'), 'a') as f:
f.write(" 'digital_marketing',\n")

Create a model

os.system('python manage.py makemigrations digital_marketing')
os.system('python manage.py migrate')

Create a view

with open(os.path.join(project_dir, 'digital_marketing/views.py'), 'w') as f:
f.write("""
from django.shortcuts import render

def home(request):
return render(request, 'digital_marketing/home.html')
""")

Create a template

with open(os.path.join(project_dir, 'digital_marketing/templates/digital_marketing/home.html'), 'w') as f:
f.write("""
{% extends 'base.html' %}

{% block content %}

Welcome to the Digital Marketing website!

{% endblock %} """)

Start the server

os.system('python manage.py runserver')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants