Django Pain

in #django8 years ago

With Django I have a Love - Hate relationship.
In the past years, I developed and set up some application with that framework, bit it is always a pain.

The Good

From development side, it is just awesome.
Install it, start your project and let the server run.
Development anywhere, anytime, without going through webserver maintenance or systems configuration.
Spin it up and start developing your apps.
Nice and easy.
And on one of your machines, you can let quite some apps run at the same time, no config change or anything on OS level.
Pure dev fun

The Bad

Until you reach staging/production level.
WTF?
You need mod_wsgi installed.
And configure it for your virtual hosts. Don't do anything wrong there. It will only throw http 500 errors. Without any explanation.
Your app has no debug logging in prod env?
Tough luck!
The hours I have cried, to get my wonderful app into the open world.
Hell, at some points I did just let the included runserver handle everything.
Let it run, this app is just for my parents, nobody will notice it.
If you cannot give me any decent error description, you will not get into my apache!

The Ugly

It gets worse.
I struggled days on that.
steem-python.
Forget that.
Well, I will.
My apache server is running with mod_wsgi compiled against python 3.4.2.
Steem Python needs 3.6.
2 options:

  • Compile mod_wsgi again, this time against 3.6 and load this module into apache.
    But that would also include, to go through my other applications, reset their virtual environment and roll out 3.6 there, too. Only one mod_wsgi module allowed in your apache config, for obvious reasons
    Nope, this is way to risky.
  • Forget steem python and do every request there by hand.
    This option is my current solution, as I don't need that many functions. Some API calls, 4-5, everything just reading, nothing writing. Should be fine.

Well, there would be a third option: rewrite steem-python against python 3.4.2
Nope, will skip on that.

Ah, there is option number 4:
Let the script, that runs in Django, execute python 3.6 . Something like:

os.system('python3.6 my_steem_script.py')

Wow, that would truly be ugly

If you like this django post and want more of it, vote for @isnochys as witness! You will even gain a bit of SBD from doing so.

Sort:  

This post has been upvoted by @microbot with 7.4%!
Thank you for giving your trust and witness vote to my creator @isnochys!

This post has been upvoted by @minibot with 60.0%!
Thank you for giving your trust and witness vote to my creator @isnochys!

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.083
BTC 62847.89
ETH 1686.36
USDT 1.00
SBD 0.42