I developing a mobile application, using react-native like a front-end and python Django REST framework like a back-end. The question is what I should write in Django settings.py ALLOWED_HOSTS, besides my server's adress? I don't use any website like a front-end, because my application is on App Store and Google Play.
If I will write ['*'], it certainly will work, but it is not a safe method
Related
I'm creating a website using Django as a back-end and next I will make a native mobile app using Flutter, so how can I bond these together (share same database and funcionality)? Making what is called PWA (progressive web app)
I think you should use Django Rest Framework so that Flutter app can interact with Djanggo Backend
Does Django render websites and serve them from a views folder similar to how the express framework works in JavaScript? Or does it render pages on the client side similar to an applicatipn running express in the back-end and some fron end framework such as Vue.js in the front-end
Django can do either, but it is designed to render on the server side in its default configuration, not the client side.
To use server side rendering, use Django as intended and according to the many tutorials out there.
To use client side rendering with something like React or Vue, use the Django Rest Framework.
If you are talking about the template language, it happens on the backend. This is true of every framework and every language. In the templates, the placeholders are replaced, they produce a valid html/javascript page, and that's what is returned to the browser (or, to whatever accessed that url). Essentially, it is a shortcut for creating an html file by concatenating strings.
A suggestion: don't use the template language, in any backend framework. Just use django to create rest services that return the data, and use a front-end framework like Vue/angular/react to create the actual front end part.
It's now 2022 and you should definitely check out https://www.reactivated.io/.
It effectively is plain old Django with server-rendered React.
I have backend of web app by django, include registrations/user profile,
the ability to add photo(video) file and view them, and list of places with the ability to book them.
Now I need to add the ability to work with a mobile application written in ReactJS.
The problem is that before that I did not work with mobile applications and I do not know what strategy to choose, but the frontend developer did not work with the backend. Can I pass django variables directly to the ReactJS code? Do I need additional technologies or frameworks? I would be grateful if someone shared their experience and described how to do it (preferably the least simple way)
You have to build a REST API. In your case, the best solution would be creating the API with Django REST Framework.
It is a very powerful framework for building APIs. They provide some nice tutorials to get started with it.
After that, you can create the frontend app with React by using API calls.
I'm new to the API concept.I have a doubt about the API. I created a web app in Python-django framework.I need to create an API for this web application.I need to use this same app in mobile as mobile app.How can I possible this?
Can I create seperate API for the mobile app also? I searched this in google. but i can't find a correct answer.Please help me...
An API does not care if the client that sends the requests is a mobile app or browser (unless of course you send and use the information on purpose). For example if your API exposes the "www.myapp.com/registeruser/" URL and requires a POST with username and password, you can call this URL with those parameters from any client that is able to send that.
If what you want is use the same client-side code for both desktop and mobile (trying to understand what you need!), you can look at responsive websites. A package like django-bootstrap3 works very well with Django and is easy to use.
If your goal is to develop a native mobile application that will consume your API, then you can use Django REST framework to add API endpoint to your current Django application. One possibility is that you will have another file added in every app of your Django project, and it is serializers.py (at the same level as models.py).
I'm going to build a website using OSQA which is built on Django (a famous framework of Python). I'll host this site to Google App Engine (GAE). I wonder if GAE has support all features of OSQA.?
I'm also new to web admin, so I don't know that I could use my own domain name (e.g abc.com) to point to my site hosted on GAE?
I'm going to build a website using OSQA which is built on Django (a famous framework of Python). I'll host this site to Google App Engine (GAE). I wonder if GAE has support all features of OSQA.?
At GAE you don't have support for relational databases (unless you are a beta-tester for CloudSQL). That means no admin, which is 90% of Django's sex-appeal.
Django-nonrel adds NoSQL database support to the ORM. This enables admin on GAE, but it is not fully compatible (Django-nonrel is almost Django but it is not 100% Django). Throw OSQA at it and see if it sticks - if so, you are probably good to go with GAE.
Other Django friendly PaaS worth a look:
Heroku
Gondor
AppHosted
Epio
For my Django projects I like Linode VPS, but I used to work as Linux sysadmin before being a full-time developer - I'll give you my root account when you take it from my cold, dead hands :-). Jokes apart, I would wait CloudSQL before using GAE for Django stuff.
[ update 1 ]
I'm also new to web admin, so I don't know that I could use my own domain name (e.g abc.com) to point to my site hosted on GAE?
You can't use your naked domain - abc.com is out, but you can use anything.abc.com. The FAQ suggests setting a redirect, which is easy enough. Note however that you won't be able to use your domain name with HTTPS at all on GAE - you are constrained to hideous URLs like https://your_app_id.appspot.com.
If you are on GAE, using Google Apps for your domain makes a lot of sense, so you can have Gmail handling email for your domain as well. It is free for 10 email accounts and will handle email for your naked domain (email#abc.com).
Go to http://appengine.google.com.
Choise your app.
Go to App setting.
Click to Add Domain in Domain Setting menu.
Add domain.
But domain must be registered at Google Apps (http://www.google.com/apps/intl/ru/business/index.html) :(
See http://code.google.com/intl/us-US/appengine/docs/domain.html for detail.