Django deployment
My app is working in Heroku and I'm deploying it using Dokploy. I get the error
I'm using
SECRET_KEY = os.getenv('SECRET_KEY')
in my settings.py and it's definitely in my environment variables with Dokploy. Anything else I'm missing?33 Replies
I can look into that I will create a django application.
In the meantime can you try with nixpacks?
https://nixpacks.com/docs/providers/python#start
Python | Nixpacks
App source + Nix packages + Docker = Image
Tried with nixpacks and it didn't support Django 5+
Only 4.2.11
I ran into dependency issues
I'll see if I can get it working with 4.2.11
I think the main issue is not seeing my env vars
What was the issue?
`

@James Flores I'm back, i will create a new django application what exactly version you had in order to reproduce?
5.0.4 (thank you)
I got working in a previous version for now 4.2.11, i attach the settings, also you need to add a Procfile in order to work, here is the repo https://github.com/Dokploy/django-demo/blob/main/mysite/Procfile, tomorrow i will try with that version



Did you have any environment variables?
Can the app read any of them? That was my main issue but I will have a look at your repo soon.
Was this with nixpacks?
On my end, environment variables are also not working. i tried to deploy a Next.js application. I've tried using Dockerfile and Nixpacks, but nothing seems to work.
Ok. Great to hear it’s not just me 😌
I tried another project specifically which requires enviroment variables from a postgres database and is working the migrations were apply succesfully
https://github.com/Dokploy/django-demo/tree/demo-2 is a fork from railways projects
GitHub
GitHub - Dokploy/django-demo at demo-2
Contribute to Dokploy/django-demo development by creating an account on GitHub.



the database

you can see the tables of migration

@arifkubel @James Flores you were both right, the environment variables was not passing right to the nixpacks builder, they was passing as a index something like --env 0 --env 1, now is fixed, and the version
Django==5.0.4
is working now, i will make the release today
Thanks so much! I'm actually just testing your repo now
So with the repo, were you using Heroku buildpacks?
Now I can use Nixpacks when you make the release?
probably it will not work now since you need to set this env NIXPACKS_PYTHON_VERSION=3.10, and the fix is here
https://github.com/Dokploy/dokploy/pull/21
GitHub
Fix/builder env wrong way by Siumauricio · Pull Request #21 · Dokpl...
Fix: Currently there was a wrong way to pass the enviroments to the builder, we was passing as a index(number) instead of the real value.
Yes, when i make the release you can start using
No, i was using nixpacks
So I'll try this
these are my envs
Got it to build with nixpacks on the main branch with Django 4.2.11
port 8000 right?

Yes
Testing the changes on canary and the build and everything is working now version 5
https://canary-app-1.dokploy.com/
I will push to latest in a few minutes
thanks. How do we upgrade our dokploy instance?
Updating Procedure:
Navigate to Settings > Server.
Upon entry, the system will automatically begin downloading the latest server image. Please wait approximately 2 minutes for the download to complete.
Once the download is finished, an "Update Server" button will appear. Click this button to proceed with the server update.
if you can't see the button simply reload the page
Done. Should it update the version number in the footer?
It built! But how to do I fix "ERR_TOO_MANY_REDIRECTS"
I'm using cloudflare
no, the current version is the v0.0.1 so no worries
Someone ask the same on github here is the answer for that https://github.com/Dokploy/dokploy/issues/18
GitHub
Exposing Port 3001 in Docker Container for Node.js Application · Is...
Hello, I want to thank you for the excellent work you've done. Currently, I'm running a Node.js application on port 3001, but this port hasn't been exposed by Docker. I'd like to kn...
I turned off cloudflare for the record for now, so I can see that it's working. Now the page returns "Bad gateway"
NVM. My issue there with deploy lol
Nice
❤️