Compare commits
5 Commits
65a098d70a
...
02a9c3c629
Author | SHA1 | Date | |
---|---|---|---|
|
02a9c3c629 | ||
|
7b9a9730aa | ||
|
6c9e7d4b60 | ||
|
76355136ea | ||
|
d4ae61bc6a |
@ -20,7 +20,7 @@
|
||||
sudo apt install python3.10-venv
|
||||
- Create python virtual environment on local machine:
|
||||
|
||||
python3 -m venv env
|
||||
python3 -m venv env
|
||||
|
||||
- Activate python virtual environment on local machine:
|
||||
|
||||
@ -68,7 +68,6 @@ to create the DB schemas locally
|
||||
|
||||
)
|
||||
|
||||
|
||||
*** CREATING NEW PROJECT (alreay completed, leaving for notes)***
|
||||
|
||||
create new Django project (make sure you are in dir you want project to be created):
|
||||
@ -86,9 +85,16 @@ create your own admin superuser:
|
||||
- start Django dev server:
|
||||
- set env DEV_MODE variable:
|
||||
DEV_MODE=True
|
||||
|
||||
- start Django dev server in terminal:
|
||||
DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver
|
||||
- linux:
|
||||
`DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver`
|
||||
- windows (command prompt):
|
||||
|
||||
`set DJANGO_SETTINGS_MODULE=main_project.dev_settings&& python -m manage runserver`
|
||||
|
||||
- windows (powershell):
|
||||
|
||||
`$env:DJANGO_SETTINGS_MODULE = "main_project.dev_settings"; python -m manage runserver`
|
||||
|
||||
you should be able to access backend admin portal at
|
||||
127.0.0.1:8000/api/admin
|
||||
@ -128,11 +134,9 @@ To run vs code debugger:
|
||||
In main_project folder, create .env file
|
||||
add these env vars:
|
||||
|
||||
|
||||
DEV_DOMAIN=http://127.0.0.1:8000
|
||||
DEV_MODE=True
|
||||
|
||||
|
||||
If you were preveiously in production mode, stop all nginx and gunicorn servers and open
|
||||
your browser's dev tools and clear all cache and cookie data:
|
||||
|
||||
|
@ -13,7 +13,16 @@ DEV_MODE=True
|
||||
|
||||
(if you haven't set up these servers yet, you can ignore the rest of the steps and just run:
|
||||
|
||||
DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver
|
||||
DJANGO_SETTINGS_MODULE=main_project.dev_settings python manage.py runserver (linux)
|
||||
|
||||
or
|
||||
|
||||
set DJANGO_SETTINGS_MODULE=main_project.dev_settings&& python -m manage runserver (windows cmd)
|
||||
|
||||
or
|
||||
|
||||
$env:DJANGO_SETTINGS_MODULE = "main_project.dev_settings"; python -m manage runserver (windows powershell)
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
@ -1,18 +1,18 @@
|
||||
# react native app setup (not using Expo)
|
||||
# REACT NATIVE CLI QUICKSTART, NOT EXPO GO QUICKSTART
|
||||
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): https://reactnative.dev/docs/environment-setup
|
||||
|
||||
# REACT NATIVE CLI QUICKSTART (NOT EXPO GO) QUICKSTART
|
||||
|
||||
# follow setup guide for each specific platform (iOS or Android) and OS (Linux, Windows, MacOS): [https://reactnative.dev/docs/environment-setup](https://reactnative.dev/docs/environment-setup "setup")
|
||||
|
||||
- make sure you have node and npm installed
|
||||
|
||||
- cd to directory where you want this app to be installed
|
||||
- create app:
|
||||
- create app (already accomplished, keeping for notes):
|
||||
|
||||
npx react-native@latest init SelahReactNativeApp
|
||||
`npx react-native@latest init SelahReactNativeApp`
|
||||
|
||||
- select yes for installing react-native packages
|
||||
|
||||
NOTE: some of the files might complain about not being able to detect the babel.config.js file. Add this to your
|
||||
settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
|
||||
NOTE: in VS Code some of the created files might show errors and complain about not being able to detect the `babel.config.js` file. Add this to your settings.json file in VS Code (Open command pallete: View-> Command Pallete or Ctrl+Shift-P and type "settings"):
|
||||
|
||||
```
|
||||
"eslint.workingDirectories": [
|
||||
@ -20,10 +20,27 @@ settings.json file in VS Code (Open command pallete: View-> Command Pallete or C
|
||||
]
|
||||
```
|
||||
|
||||
- to run the app, open a new terminal and start Metro which is the js bundler that ships with react native. cd into
|
||||
react-native app directory and run:
|
||||
Run the app (Android emulator)
|
||||
|
||||
npx react-native start
|
||||
- make sure your android emulator is running (running API 33 tiramisu per the react-native setup docs)
|
||||
- start Metro which is a js bundler that ships with react native. cd into react-native app directory and run:
|
||||
|
||||
- to start the app in an android device
|
||||
`npx react-native start`
|
||||
|
||||
select yes to install react-native packages
|
||||
|
||||
- let metro run in its own terminal. Open a new terminal to start the app in an android device:
|
||||
|
||||
`npx react-native run-android`
|
||||
|
||||
NOTE: if you get a `error: unknown command 'run-android'` try this command
|
||||
`npm install --save react-native`
|
||||
|
||||
and try again:
|
||||
|
||||
`npx react-native run-android`
|
||||
|
||||
You should have a running react-native app in Android!
|
||||
|
||||
|
||||
TODO: mac/iOS local setup...
|
||||
|
@ -3,7 +3,14 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
|
||||
<!-- add
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
fields to appplication tag below and add mipmap
|
||||
folders to
|
||||
/android/app/src/main/res/
|
||||
when icons are created
|
||||
-->
|
||||
<application
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:targetApi="28"
|
||||
|
2
frontend/SelahReactNativeApp/package-lock.json
generated
2
frontend/SelahReactNativeApp/package-lock.json
generated
@ -9,7 +9,7 @@
|
||||
"version": "0.0.1",
|
||||
"dependencies": {
|
||||
"react": "18.2.0",
|
||||
"react-native": "0.71.11"
|
||||
"react-native": "^0.71.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "18.2.0",
|
||||
"react-native": "0.71.11"
|
||||
"react-native": "^0.71.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
Loading…
Reference in New Issue
Block a user