Windows – Python Tools for Visual Studio
-
Clone the repository.
First, clone the repository using the URL provided on development section.
Open the solution file (.sln) that is included in the root of the repository.
-
Change the requirements file.
Double-click on requirements.txt. If you’re using a PostgreSQL database, add psycopg2==2.6.2.
If you’re using a MySQL database, add mysqlclient==1.3.7. By default, requirements.txt contains the driver for a PostgreSQL database.
-
Create a virtual environment.
Right-click on Python Environments and select Add Virtual Environment. Make sure the name is env. Click Create, this will create the virtual environment and the dependencies listed in requirenments.txt.
-
Change the information on the database.
Open the folder MsBlog and double-click on settings.py.
Scroll down until you find the DATABASES. Change the information according to your database. Save.
Engine for PostgreSQL: 'django.db.backends.postgresql_psycopg2'
Engine for MySQL: 'django.db.backends.mysql'
-
Migrate and create a superuser.
To migrate the information into the new database, right-click on the root project, select python and click-on migrate.
Now, create the super user. As before, right-click on the root project, select python and select Create Superuser.
Django will prompt a command-line to set the superuser. Follow the instructions.
+Collect static files.
To collect the static files, right-click on the root project, select python and click-on Collect Static Files.
-
Run using developer server.
Press F5 to start debugging, and your web browser will open automatically to the page running locally.
-
Make changes.
Now you can experiment by making changes to the application sources and/or templates.
To access the admin page to add users, or add new posts, access through /admin/.
Once you have logged in, you can either add posts through the admins page or in the website as /posts/create/.
After you’ve tested your changes, commit to the Git repository. -
Deploy to Azure.
If you need help with git, please refer to [Local Git Deployment to Azure App Service] (https://github.com/Azure/azure-content/blob/master/articles/app-service-web/app-service-deploy-local-git.md).