TLDR; This Django China tutorial provides you with a step-by-step solution to deploy and host your Django project in China.
What is Django?
Django is an open source web application framework developed based on Python. The Django framework not only provides a complete code directory structure, but also uses the structure model, view, and template. This makes the code easy to standardize during the development process. Among them, Django Admin provides an out-of-the-box back-end management system and is the “Go-To” by many Python developers and startups.
21YunBox provides a very simple Django deployment method in China. You can deploy on the 21YunBox in the Python environment.
How to Deploy Django in China?
- Signup on 21YunBox
- Create a PostgreSQL database
- Fork django example
- Create a Cloud Service on the 21YunBox, and allow the 21YunBox to access your code base
- Configure the following settings
Environment
PYTHON 3.7
Build command:
./build.sh
Start command:
gunicorn hello.wsgi:application
Click Advanced Configuration to configure environment variables:
KEY | VALUE |
---|---|
DJANGO_DB_URL | In the first step to create a cloud database midpoint Database URL Obtain |
DJANGO_ALLOWED_HOSTS | <service name>.21yunbox.com,127.0.0.1 |
For more Django-related configurations, please refer to Official Document. In this example,
DJANGO_DEBUG=True
is a demonstration and example only. You can setDJANGO_DEBUG
toFalse
in the environment variable when it goes live.
Once the build is complete, use the remote connection of the 21YunBox to create a Django administrator account
./manage.py createsuperuser
It’s that easy! When the build is completed, your application will be accessible in the subdomain of 21YunBox.
If the description of the above text is not clear, you can refer to the following actual operation video:
Related Posts
- How to Deploy Laravel Apps in China? (2022 updated)
- How to Deploy Parse Dashboard in China? (A Step-by-Step Guide)
- How to Host WordPress in China?
- How to host Ghost Blog in China?
- How to Deploy Ruby on Rails Apps in China? (A Step-by-Step Guide)
- How to Deploy Java Spring Apps in China? (A Step-by-Step Guide)
- How to Deploy Go Gin Apps in China? (A Step-by-Step Guide)
- How to Deploy Streamlit App in China? (A Step-by-Step Guide)
- How to Deploy Express Apps in China? (A Step-by-Step Guide)
- How to Deploy Python Flask Apps in China? (A Step-by-Step Guide)
Recent Posts
-
Shopify China: A Comprehensive Guide to Making Your Store Thrive in the Chinese Market (2024 Updated)
Jan 7, 2024
-
Unleashing Heroku's Full Potential in China for Web Applications: A Practical Guide (2023 Update)
Dec 3, 2023
-
Your Ultimate Guide to Launching Apps on Huawei, Xiaomi, Oppo, Vivo, and Tencent Stores
Dec 1, 2023
-
Guide to Preparing Your Mobile App for ICP Filing in China
Nov 20, 2023
-
Unlocking Success: A Comprehensive Guide to B2B Marketing in China
Nov 17, 2023