These are chat archives for django/django

1st
Jun 2017
John
@flyboy1565
Jun 01 2017 00:25
Yes, you can use the read-only setting in the database settings... You can also use inspect DB to auto import the model @gonzofish
Kavin Ruengprateepsang
@kavinvin
Jun 01 2017 03:06
Hello guys, I'm trying to deploy my first Django application (from cookiecutter template) on Heroku, but I've errors here when it tried to run gunicorn. Does anyone know to fix it? Or may be make gunicorn give me more detailed error message.
app[web.1]: [2017-06-01 02:45:05 +0000] [4] [INFO] Starting gunicorn 19.7.1
app[web.1]: [2017-06-01 02:45:05 +0000] [4] [DEBUG] Arbiter booted
app[web.1]: [2017-06-01 02:45:05 +0000] [4] [INFO] Listening at: http://0.0.0.0:45605 (4)
app[web.1]: [2017-06-01 02:45:05 +0000] [4] [INFO] Using worker: sync
app[web.1]: [2017-06-01 02:45:05 +0000] [8] [INFO] Booting worker with pid: 8
app[web.1]: [2017-06-01 02:45:05 +0000] [9] [INFO] Booting worker with pid: 9
app[web.1]: [2017-06-01 02:45:05 +0000] [4] [DEBUG] 2 workers
app[web.1]: Traceback (most recent call last):
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 209, in run
app[web.1]:     self.sleep()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 359, in sleep
app[web.1]:     ready = select.select([self.PIPE[0]], [], [], 1.0)
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
app[web.1]:     self.reap_workers()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
app[web.1]: 
app[web.1]: During handling of the above exception, another exception occurred:
app[web.1]: 
app[web.1]: Traceback (most recent call last):
app[web.1]:   File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
app[web.1]:     sys.exit(run())
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
app[web.1]:     WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 203, in run
app[web.1]:     super(Application, self).run()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
app[web.1]:     Arbiter(self).run()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 231, in run
app[web.1]:     self.halt(reason=inst.reason, exit_status=inst.exit_status)
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 344, in halt
app[web.1]:     self.stop()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
app[web.1]:     time.sleep(0.1)
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 244, in handle_chld
app[web.1]:     self.reap_workers()
app[web.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 524, in reap_workers
app[web.1]:     raise HaltServer(reason, self.WORKER_BOOT_ERROR)
app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
heroku[web.1]: State changed from starting to up
heroku[web.1]: State changed from up to crashed
heroku[web.1]: Process exited with status 1
Kavin Ruengprateepsang
@kavinvin
Jun 01 2017 04:10
My mistake ;w; I forgot to change to the production setting files
Pavel Burns
@63phc
Jun 01 2017 04:26
hello world
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:06
Hello!
Is anyone here experienced with css?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:15
yes @YiiKuoChong what's ur q
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:17
Currently I am trying to style the header of the site so that the width will fill the entire browser but I can only do that with position: absolute. I do not want that since it'd be hard for me to make the website responsive since all the elements would overlap if the browser is squezed or if you view it on a phone. I tried to use other positioning and google it but It seems that I don't know the correct term for it.
How to make the header container "width" fullscreen without white space around it?
prototype.png
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:19
what framework are you using?
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:19
It should look like this but instead of using position: absolute, I want to use ones that can be responsive. I am using Django
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:19
no i mean ur CSS framework
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:19
None
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:19
are you using the grid
ah
i mean
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:20
it's pure css
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:20
are you using like bootstrap 4?
ohhh
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:20
no
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:20
ugh ya i worked w/ pure css before (the yahoo library)
or you mean you're just writing plain old css
?
just clarifying
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:20
plain old css
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:20
easiest fix i would say
download bootstrap
it should work w/ django
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:20
A lot of people recomended me that.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:20
bootstrap 4 can be finicky (latest version) but it will make everything automatically responsive, trust me
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:21
It's so popular
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:21
i was using an older version of the framework
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:21
Okay!
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:21
agh ya i hate boostrap lol bc im a css person from the 90s lol that is like ahh frameworks but now im lazy bc im doing more AR and AI so i dont have time lol
and i was a reactjs dev for a while too
so ya i mean u can't go wrong w/ bootstrap, everything will look the same
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:21
AR and AI?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:21
but CSS fundamentals are still important
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:21
That is true
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:21
augmented reality and artificial intelligence
so basically what i would say is
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:21
wow
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:21
let me see again so ure tryin to remove what white space?
so i understand ur question better
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:22
Capture.PNG
Around the image.
Here is my code pretty much
header {
    display: block;

    width: 100%;
    height: 30%;

    position: relative;
    top: 0;

    padding: 0;
    margin: 0;
    overflow: hidden;


    background: url("../image/background.jpg") no-repeat center center fixed;
    background-size: cover;
}

.header_title {
    text-align: center;
    vertical-align: center;
}

.header_navigation {
    background-color: rgba(0, 0, 0, 0.5);
}

footer {
    display: block;
I can't seem to make <header> fit the entire browser viewport.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:23
wait
so you have
the first png is what you have
but the 2nd png is what you want
?
i mean the otherw ay around
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:24
Yes
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:24
u have white space but u want to eliminate it
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:24
the other way around
The previous version only works on full screen desktop browser
any smaller it fucks up
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:25
what 'previous version?'
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:25
so the second picture is the second version
first picture
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:25
huh sorry im not following
so basically what you are saying is
when u change the code
it only works on a certain browser or desktop but not on mobile?
so youre checkin everything in chrome at 300x600 etc. right?
and it doesnt look right or it looks right in some but not everything
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:26
The first picture/first version, I used position: absolute to style my page. The second picture/ second version is the version where I am trying to make it more responsive.
yes
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:26
ya bc position: absolute usually fixes things
ya
ok ya i mean i get it fucks it all up
everyone hates CSS bc of this
it isn't an object oriented language and it's made for static layout like ...print design
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:26
The first version looks great only on full screen desktop but not minimized or mobile
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:27
so that can be furstrated as fuck tell me about it
yup
so 1) download bootstrap
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:27
yes
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:27
find a template you like that you can fill in
and just swap stuff
test
most will have jumbotron
the thing u have in ur big header
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:27
Jumbotron?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:27
that will be
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:27
ooh
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:27
..what is it full-width i think is the term
it's usually like
in the css
background-image: url=(path://)
something of that nature
and then
background: full or something like that (blankin atm id have to look up)
and then it's background: no repeat
something like that
that' slike pretty standarda
*and
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:28
I did that in my ori code/
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:28
and that should fix it
ya it always works better in boostrap
not the older versions tho
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:28
The header it self doesnt want to fill the width
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:29
i noticed bc i just installed a new template the other day and had the same issue
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:29
I am reading the guides now.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:29
try the framework
it should fix it automatically
it automatically fixed everything on my mobile w/o me having to write any css queries
i was surprised
usually i get frustrated w/ any bought templates or for ones that claim responsive but aren't out of this box
i was on boostrap 2 or 3 and then it didn't work
i overrode with bootstrap 4 and it fixed everything
so that should fix a lot of ur problems, beyond the top header, like all other elements
it should just be automatic
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:30
I can see why a lot of developers use bootstrap.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:30
worst case scenario is u have to read the docs, write some css media queries or re-read stuff on columns
and if u do JS then u would use reactJS
that's a whol eother story of mixing JS and CSS lol
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:31
I was thinking that I could get my css game down first before I use any css frameworks
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:31
but i wouldn't do that if ure jus doing stuff on python and flask
ah
it's ok
if youre aski these questions and it's not workin
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:31
yea
lols
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:31
cuz i tried to write everything pure like u did since i dev'ed in the 90s and fuckin hated frameworks
now im a lazy dev bc i have to do more back end or more 3d oriented crap that i dont have time for that
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:31
what happened?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:31
so i ended up using frameworks
lol
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:31
ah
It makes your life easier
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:32
and now im like..fck this i have to do harder shit in hololens, im tempted to use squarespace unless i do d3 visualizations and then make separate project sites for that lol
ya i mean basically dont stress yourself out
work on the back end that reqs more of ur time
no one willc are about those small mistakes bc theyre not payin u do front end
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:32
when you said back end, I am assuming you are talki9ng about a site?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:32
only designers like me can spot shit like that bc we lived and breathed fixing stuff like that to make it pretty
we;re on a django channel
spent time on python
not on all the other front end crap if that's not what ur main job is
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:33
Basically, just do what they pay you for and fuck all the other stuff?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:33
so what im saying is, just fix it w/ bootstrap and ull be fine, dont waste your energies writing css plain
yup
i hate sayin that but
u cant do everythin
lol
bc i tried do that
and i dated idk how many chief architects that were allf ront end who all competed like their CSS framework was the best
that i wanted to write my own frameworks bc fuck otherppls frameworks
and then i realized, fck it if it works, out of the box, then use it
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:34
Hhaa
haha
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:34
i know all this stuff 'position absolute' media queries blablhab can drive ppl crazy
i mean i was around the time when tables were there and float wasn't even invented yet
that's how old i am
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:35
It was driving me crazy. I spent a few days trying to fix it until you told me to just use bootstrap.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:35
lol so honestly dont waste ur time if u get stressed out, just use a template, replace the elements (like the pix and colors nad shit)
and then spend time on more important things
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:35
Yes maam!
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:35
not that design isn't important (it is and im a hybrid) but ya, trust me i hate all that shit too
if u have trouble
read the documentationa
nd if u are reallyyyy lazy
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:36
?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:36
buy a cheap template and integrate it but htat's harder bc sometimes some of them dont work well (like if i do reactjs , it wont play well w/ a tempalte in jquery, youre better off just using a wp template) wordpress
*documentation
hybrid, oh im a designer and dev
so design to me is important unlike a lot of devs
but ya css stresses me out to bc it hasn't evolved in some ways they should have adopted in css future (..not css, the css not 4 but whatever the next standard spec they haven't adopted bc ppl are old school)
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:37
I heard that Jquery use more resources and cause problem especially on low end mobile phones.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:37
jquery has pretty animations
ya it's true
and that sucks sometimes
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:38
I like jquery
I think it's because I like logics.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:38
aaand this is why i went to native mobile for a while
and then i got bored of that an dwent into AR and VR
where my biggest problem is set-up hell lol
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:38
What do you do in Augmented Reality?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:38
which is not harder than git just annoying
experimental shit lol
but basically ya i mean there's a lot of outdated stuff on any front end
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:39
AR and VR is pretty connected right?
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:39
all of that is changing i hope with webVR but it needs to evolve faster so better adoption
ya
AR VR MR XR immersive and emerging technology
same shit different names
anyhow i hope that helps answer ur q
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:39
I hope we can upload our minds during my lifetime. Would love to be immortal.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:40
oh dont get me started
read a book on connectomics talin about cryonics the other day
*talking
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:40
The problem with that is would it be a copy or actually you being uploaded.
Erin Jerri Pangilinan
@erinjerri
Jun 01 2017 06:40
ok i gg bc im tryin to get this numpy thing working
ugh
unless u want to answer a non django python question in numpy heh
Ghost
@ghost~58e3220cd73408ce4f55e9fb
Jun 01 2017 06:40
You do that. I don't want to bother you.
azaleas
@azaleas
Jun 01 2017 08:36
@/all Stipo - YelpFusion Api + django + reactjs . Nightlife coordination app completed.
Heroku demo: http://bit.ly/2rX6WnF
Details: http://bit.ly/2rebEMv
sanyam bansal
@sanyambansal76_twitter
Jun 01 2017 08:47

Hi I am working on Angular Application with the Django Backend i am getting a issue while redirecting the user after login to a next page

I am having the url something like this http://localhost:8000/login/?next=/projects/gky6/#/phase/2

and having a hidden input field in the template

<input type="hidden" name="next" value = {{ request.GET.next }}

but in the request.POST.get('next') or request.GET.get('next') i am getting '/project/gky6/'

'/#/phase2/' stripped from the next

So if any one have idea regarding this please let me know

Thanks in Advance

1rjun
@1rjun
Jun 01 2017 09:17
how can i use reactjs at frontend in django???
????
:]
@elcolie
Jun 01 2017 10:56
Any pyrad experience here?

If I change line to

    srv.hosts["0.0.0.0"] = server.RemoteHost("0.0.0.0", b"secretsecret", "localhost")

What does it means?

Kavin Ruengprateepsang
@kavinvin
Jun 01 2017 13:42

I've added WhiteNoise to middleware but it stills give me this error

The file 'css/project.css' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x7f3f872b7c88>

Do I have to run python manage collectstatic even I use WhiteNoise?
And if it is, how can I use it on Heroku, which collectstatic won't works?

Anish Shrestha
@annshress
Jun 01 2017 13:55
@YiiKuoChong @erinjerri Go private chat :tongue:
Kavin Ruengprateepsang
@kavinvin
Jun 01 2017 14:11
Nevermind I got it :3
Lim H.
@limdauto
Jun 01 2017 15:16
Hi, does anyone know a good Python connection pool for MySQL that supports Django? Not proxy like proxysql. Django connections map directly to number of threads. I wonder if I can keep the pool size bound to number of processes